-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
1.48 beta installer spuriously installing libLLVM.so, also into the incorrect location #78932
Comments
@Mark-Simulacrum Possibly to do with the new RustDev component and especially this snippet: // Copy libLLVM.so to the target lib dir as well, so the RPATH like
// `$ORIGIN/../lib` can find it. It may also be used as a dependency
// of `rustc-dev` to support the inherited `-lLLVM` when using the
// compiler libraries.
maybe_install_llvm(builder, target, &image.join("lib")); This is a regression; 1.47 had the correct behaviour of not trying to install LLVM at all. Note that I am not explicitly referencing RustDev at all, I am just calling |
I plan to investigate fixing this soon, I think it's important we get this fixed. Could you provide instructions on how to verify things are working so I can check locally? (I guess I can compare against a 1.47 build but would be good to get what command you're running). |
in config.toml:
then with The documentation for llvm-config says "Note that if this is specified we don't compile LLVM at all for this target." - so possibly this bug can be fixed simply by changing this snippet in if !builder.config.llvm_link_shared {
// We do not need to copy LLVM files into the sysroot if it is not
// dynamically linked; it is already included into librustc_llvm
// statically.
return;
} to check for whether |
The cross-compiling wrong-location/clobbering issue still exists as I described in the OP, but it does not affect my use-case since we're not installing libLLVM.so. On Debian we are in fact moving everything from |
I think it was actually #76349's commit a7b092f that changed this, specifically around here: Before, we would only copy Lines 45 to 52 in 5404efc
I think it would work to change |
Though one could argue that is wrong (in some cases) right? That is, if you don't copy, it'll not work unless the original location is in LD_LIBRARY_PATH or equivalent. I'd be fine changing/reverting to not copy on custom llvm though, that seems like the right fix for now - it seems rare to have custom LLVM and want the copy. |
Filed #78986 with the suggested fix here. |
I see it the same as any other system library that we might link against. e.g. Cargo links to the system openssl by default, and we don't try to pull that into dist tarballs. |
Good point :) |
Install CI llvm into the library directory In other words, my concern in rust-lang#78932 (comment) was perfectly justified by something we were already doing. For now just special case CI LLVM, but in the future we may want a more general fix. Fixes rust-lang#79071. r? `@alexcrichton`
Since 1.48 beta,
x.py install
is now installing libLLVM.so even when dynamically linking against the system one.Not only that, the install path is unaware of the target architecture, which breaks during cross-compiling. I am not sure exactly what happens - possibly (a) the host is installed instead of the target or (b) both are installed, and the host clobbers the target - in any case the end result I observe is that the host-arch libLLVM.so ends up in the install directory instead of the target-arch one, which would be correct.
The text was updated successfully, but these errors were encountered: