llvmPackages_*.llvm: fix llvm-config-native with static libs#148367
Merged
7c6f434c merged 1 commit intoNixOS:stagingfrom Dec 24, 2021
Merged
llvmPackages_*.llvm: fix llvm-config-native with static libs#1483677c6f434c merged 1 commit intoNixOS:stagingfrom
7c6f434c merged 1 commit intoNixOS:stagingfrom
Conversation
sbourdeauducq
suggested changes
Dec 3, 2021
Contributor
sbourdeauducq
left a comment
There was a problem hiding this comment.
Thanks for this!
You also need to patch unconditionally, e.g.:
--- a/pkgs/development/compilers/llvm/12/llvm/default.nix
+++ b/pkgs/development/compilers/llvm/12/llvm/default.nix
@@ -74,7 +74,7 @@ in stdenv.mkDerivation (rec {
--replace 'set(_install_rpath "@loader_path/../''${CMAKE_INSTALL_LIBDIR}''${LLVM_LIBDIR_SUFFIX}" ''${extra_libdir})' ""
''
# Patch llvm-config to return correct library path based on --link-{shared,static}.
- + optionalString (enableSharedLibraries) ''
+ + ''
substitute '${./outputs.patch}' ./outputs.patch --subst-var lib
patch -p1 < ./outputs.patch
'' + ''
Since both static and shared libs are installed to the same `lib` output, we override the ActiveLibDir unconditionally. Fixes `llvm-config-native --link-static --libs`
7ec6a03 to
544707d
Compare
Contributor
Author
|
Good catch, thanks! |
sbourdeauducq
approved these changes
Dec 3, 2021
Contributor
sbourdeauducq
left a comment
There was a problem hiding this comment.
Checked that cross-compilation now works fine in my LLVM 12 project with this patch, and some LLVM 13 programs (lld, rustc, cargo) are still OK.
Anything else I should test?
Contributor
Author
|
Cool project! Yeah, that seems like a reasonable amount of testing. This will go through staging so I'll be able to keep an eye out for regressions on hydra. |
Merged
1 task
Contributor
|
Successfully created backport PR #151996 for |
23 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since both static and shared libs are installed to the same
liboutput, we override the ActiveLibDir unconditionally.
Fixes
llvm-config-native --link-static --libsMotivation for this change
Fixes #148117
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notes