about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-07-07 21:33:44 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-07-08 15:24:23 -0700
commit9bc8e6d1472a57441afe3592078838d2bc767996 (patch)
tree07bb476f368f42c89b476671ecc9082175d91b69 /src/rustllvm/RustWrapper.cpp
parentd23239b48e2066d3f38eb03e2429427bffade822 (diff)
downloadrust-9bc8e6d1472a57441afe3592078838d2bc767996.tar.gz
rust-9bc8e6d1472a57441afe3592078838d2bc767996.zip
trans: Link rlibs to dylibs with --whole-archive
This commit starts passing the `--whole-archive` flag (`-force_load` on OSX) to
the linker when linking rlibs into dylibs. The primary purpose of this commit is
to ensure that the linker doesn't strip out objects from an archive when
creating a dynamic library. Information on how this can go wrong can be found in
issues #14344 and #25185.

The unfortunate part about passing this flag to the linker is that we have to
preprocess the rlib to remove the metadata and compressed bytecode found within.
This means that creating a dylib will now take longer to link as we've got to
copy around the input rlibs to a temporary location, modify them, and then
invoke the linker. This isn't done for executables, however, so the "hello
world" compile time is not affected.

This fix was instigated because of the previous commit where rlibs may not
contain multiple object files instead of one due to codegen units being greater
than one. That change prevented the main distribution from being compiled with
more than one codegen-unit and this commit fixes that.

Closes #14344
Closes #25185
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions