-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
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
llvm: fix cross compiling for v4, v5, v6. #40604
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ | |
, enableManpages ? false | ||
, enableSharedLibraries ? true | ||
, darwin | ||
, hostLLVM | ||
}: | ||
|
||
let | ||
|
@@ -40,7 +41,9 @@ in stdenv.mkDerivation (rec { | |
++ stdenv.lib.optional enableSharedLibraries "lib"; | ||
|
||
nativeBuildInputs = [ cmake python ] | ||
++ stdenv.lib.optional enableManpages python.pkgs.sphinx; | ||
++ stdenv.lib.optional enableManpages python.pkgs.sphinx | ||
++ stdenv.lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) | ||
hostLLVM; | ||
|
||
buildInputs = [ libxml2 libffi ] | ||
++ stdenv.lib.optionals stdenv.isDarwin [ libcxxabi ]; | ||
|
@@ -115,6 +118,10 @@ in stdenv.mkDerivation (rec { | |
"-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}" | ||
"-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.targetPlatform.config}" | ||
"-DTARGET_TRIPLE=${stdenv.targetPlatform.config}" | ||
] | ||
++ stdenv.lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ | ||
"-DCMAKE_CROSSCOMPILING=True" | ||
"-DLLVM_TABLEGEN=${hostLLVM}/bin/llvm-tblgen" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm this is the way forward given how we use cmake for cross--which unfortunately is "wrong" and means we aren't taken advantage of any of LLVM / cmake's infrastructure for these things. More outside review .... |
||
]; | ||
|
||
postBuild = '' | ||
|
@@ -148,7 +155,9 @@ in stdenv.mkDerivation (rec { | |
ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${release_version}.dylib | ||
''; | ||
|
||
doCheck = stdenv.isLinux && (!stdenv.isi686); | ||
doCheck = stdenv.isLinux | ||
&& (!stdenv.isi686) | ||
&& (stdenv.buildPlatform == stdenv.hostPlatform); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is handled by default/already? Please LMK if that's not what you're seeing! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Huh, you're right, thanks! |
||
|
||
checkTarget = "check-all"; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should definitely be called buildLLVM.