This avoids issues with overwriting files that are being used.
Correctly handles symlinks so we can get rid of the COPY_LIBS stuff.