forked from rarias/bscpkgs
Use lld linker for clangOmpss2 for LTO
This commit is contained in:
@@ -67,7 +67,7 @@ stdenv.mkDerivation rec {
|
||||
"-DCMAKE_CXX_FLAGS_DEBUG=-g -ggnu-pubnames"
|
||||
"-DCMAKE_EXE_LINKER_FLAGS_DEBUG=-Wl,-gdb-index"
|
||||
"-DLLVM_LIT_ARGS=-sv --xunit-xml-output=xunit.xml"
|
||||
"-DLLVM_ENABLE_PROJECTS=clang;openmp;compiler-rt;flang"
|
||||
"-DLLVM_ENABLE_PROJECTS=clang;openmp;compiler-rt;flang;lld"
|
||||
"-DLLVM_ENABLE_ASSERTIONS=${enableAssertions}"
|
||||
"-DLLVM_INSTALL_TOOLCHAIN_ONLY=ON"
|
||||
"-DCMAKE_INSTALL_BINDIR=bin"
|
||||
|
||||
@@ -4,14 +4,27 @@
|
||||
, nanos6
|
||||
, clangOmpss2Unwrapped
|
||||
, wrapCCWith
|
||||
, llvmPackages
|
||||
}:
|
||||
|
||||
|
||||
let
|
||||
|
||||
# We need to replace the lld linker from bintools with our linker just built,
|
||||
# otherwise we run into incompatibility issues when mixing compiler and linker
|
||||
# versions.
|
||||
bintools-unwrapped = llvmPackages.tools.bintools-unwrapped.override {
|
||||
lld = clangOmpss2Unwrapped;
|
||||
};
|
||||
bintools = llvmPackages.tools.bintools.override {
|
||||
bintools = bintools-unwrapped;
|
||||
};
|
||||
|
||||
targetConfig = stdenv.targetPlatform.config;
|
||||
inherit gcc nanos6;
|
||||
in wrapCCWith rec {
|
||||
cc = clangOmpss2Unwrapped;
|
||||
in wrapCCWith {
|
||||
inherit cc bintools;
|
||||
extraBuildCommands = ''
|
||||
echo "-target ${targetConfig}" >> $out/nix-support/cc-cflags
|
||||
echo "-B${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-cflags
|
||||
|
||||
Reference in New Issue
Block a user