Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rustc: Hint to the linker about static/shared libs
If a linker finds both a static and a dynamic version of the same library, then the linker often chooses the dynamic version. This is surprising when a native library is specified as being "static" in rust source. This modifies the linker command line to obey the hints given in rust source files and instructing the linker to prefer a particular version of a found library. Unfortunately, this patch has no effect on osx because the linker supports no such hint, and it also has no effect on windows because the linker apparently just ignores it. For now this is predominately used to enable the previous patch of linking to libstdc++ statically, but more support would need to be added for this in the future if we wanted to officially support it. cc #12557 (doesn't close because it doesn't support OSX and windows)
- Loading branch information
ad3de7f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from brson
at alexcrichton@ad3de7f
ad3de7f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging alexcrichton/rust/up-llvm = ad3de7f into auto
ad3de7f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alexcrichton/rust/up-llvm = ad3de7f merged ok, testing candidate = cd064a87
ad3de7f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some tests failed:
failure: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/5399
exception: http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/5299
exception: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/5295
exception: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-c/builds/4388
exception: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/4401
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/5397
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-c/builds/4484
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/4492
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/4490
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/2284
exception: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/5394
exception: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-c/builds/4491
exception: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/4504