Skip to content

Fix linker on Solaris/Illumos #35821

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 22, 2016
Merged

Conversation

nbaksalyar
Copy link
Contributor

This patch provides a fix for the GnuLinker::export_symbols function that currently relies on a --retain-symbols-file option which is not supported by the Solaris & Illumos linker.

Instead, a version script is used on this platform to achieve the same goal. Here's an example of a similar approach in LLVM's CMake script: https://github.com/llvm-mirror/llvm/blob/master/cmake/modules/AddLLVM.cmake#L88-L94.

Perhaps other platforms like OpenBSD could benefit from this as well. /cc @semarie

@rust-highfive
Copy link
Contributor

r? @nrc

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member

@bors: r+ dfd8b4c680457b70bd1efeefc1d2033d4a23fc4b

Thanks!

@nbaksalyar
Copy link
Contributor Author

nbaksalyar commented Aug 19, 2016

Whoops, sorry - the build seems to be broken (code seems to be diverged a bit from 1.11).
Fixed now.

@alexcrichton
Copy link
Member

@bors: r+ de8bb0c0dc73fb47ca567318b88ad0582f65beb2

Solaris linker doesn't support the `--retain-symbols-file` option,
so this patch provides version scripts as an alternative on that
platform.
@nbaksalyar
Copy link
Contributor Author

Oh well, that's a shame, I missed a single & symbol. Sorry - now it certainly builds OK.

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Collaborator

bors commented Aug 20, 2016

📌 Commit c08b7b9 has been approved by alexcrichton

@bors
Copy link
Collaborator

bors commented Aug 22, 2016

⌛ Testing commit c08b7b9 with merge c44534e...

bors added a commit that referenced this pull request Aug 22, 2016
Fix linker on Solaris/Illumos

This patch provides a fix for the `GnuLinker::export_symbols` function that currently relies on a `--retain-symbols-file` option which is not supported by the Solaris & Illumos linker.

Instead, a [version script](https://www.gnu.org/software/gnulib/manual/html_node/LD-Version-Scripts.html) is used on this platform to achieve the same goal. Here's an example of a similar approach in LLVM's CMake script: https://github.com/llvm-mirror/llvm/blob/master/cmake/modules/AddLLVM.cmake#L88-L94.

Perhaps other platforms like OpenBSD could benefit from this as well. /cc @semarie
@bors bors merged commit c08b7b9 into rust-lang:master Aug 22, 2016
@nbaksalyar nbaksalyar deleted the solaris-trans-fix branch August 22, 2016 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants