Skip to content
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

use system library on openbsd #241

Merged
merged 1 commit into from
May 12, 2018
Merged

use system library on openbsd #241

merged 1 commit into from
May 12, 2018

Conversation

semarie
Copy link
Contributor

@semarie semarie commented May 12, 2018

compiler_rt is provided by default on OpenBSD, so use it instead of
rebuilding it from source.

compiler_rt is provided by default on OpenBSD, so use it instead of
rebuilding it from source.
@alexcrichton
Copy link
Member

Hm I don't think this is correct? Surely OpenBSD doesn't have __rust_probestack

@semarie
Copy link
Contributor Author

semarie commented May 12, 2018

The purpose is to avoid recompiling compiler_rt (what build.rs does), and make the crate uses the system library instead of.

I used this way to avoid a missing symbol (from emutls) while compiling rustc (since 1.23.0, I think). It was related to librustc_binaryen if I correctly remember. On OpenBSD the symbol is only available via libcompiler_rt, but I couldn't mix the system library with the compiled one from compiler-builtins (where emutls isn't compiled).

Without such change, I have the following error while compiling rustc (nightly):

rustc:/data/semarie/build-rust/build_dir/build/x86_64-unknown-openbsd/stage1/lib/rustlib/x86_64-unknown-openbsd/codegen-backends/librustc_trans-llvm.so: undefined symbol '__emutls_get_address'
error: couldn't load codegen backend "/data/semarie/build-rust/build_dir/build/x86_64unknown-openbsd/stage1/lib/rustlib/x86_64-unknown-openbsd/codegen-backends/librustc_trans-llvm.so": "Cannot load specified object"

Avoiding to compiling the C part at all and using libcompiler_rt.a from system solve the issue.

If I didn't mess myself __rust_probestack is in the rust part. So it will be compiled and linked with the system library.

@alexcrichton
Copy link
Member

Ah right yes sorry, got mixed up!

@alexcrichton alexcrichton merged commit 4cfd710 into rust-lang:master May 12, 2018
@semarie semarie deleted the openbsd branch May 13, 2018 05:10
bors added a commit to rust-lang/rust that referenced this pull request May 14, 2018
…ichton

update libcompiler_builtins

let's OpenBSD to use libcompiler_rt.a from system library. it unbreaks
the build from source on OpenBSD.

see rust-lang/compiler-builtins#241 for related PR

note this PR brings some other changes (on `floatdisf`/`floatundisf`) with compiler-builtins update.

r? @alexcrichton
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.

2 participants