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

Fails to build with LLVM_LINK_SHARED=1 #265

Open
Vogtinator opened this issue May 11, 2022 · 0 comments
Open

Fails to build with LLVM_LINK_SHARED=1 #265

Vogtinator opened this issue May 11, 2022 · 0 comments

Comments

@Vogtinator
Copy link
Contributor

Many linux distros build LLVM as shared libraries only, so statically linking is not possible. For various reasons it's preferred to use the system LLVM instead of the bundled one, which requires that rustc is also linked dynamically against LLVM libraries.

rustc's configure has an option --enable-llvm-link-shared to do that, which internally sets the LLVM_LINK_SHARED environment variable to 1. Doing the same with mrustc's bootstrap scripts works, but only until the final link of rustc_main. I think this is because the rustc-link-lib=dylib=LLVM flag from the rustc_llvm crate's build config is not taken into account when linking the final rustc_main binary. I added a hack to minicargo/build.cpp to add -lLLVM when building rustc_main and the binary is built successfully that way.

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

No branches or pull requests

1 participant