libunwind: Fix build against compiler-rt-using clang
This commit is contained in:
parent
4c0d5f80fc
commit
078a07708a
@ -17,6 +17,7 @@
|
||||
, isGNU ? false, isClang ? cc.isClang or false, gnugrep ? null
|
||||
, buildPackages ? {}
|
||||
, libcxx ? null
|
||||
, isCompilerRT ? false
|
||||
}:
|
||||
|
||||
with lib;
|
||||
@ -145,7 +146,7 @@ stdenv.mkDerivation {
|
||||
# Binutils, and Apple's "cctools"; "bintools" as an attempt to find an
|
||||
# unused middle-ground name that evokes both.
|
||||
inherit bintools;
|
||||
inherit libc nativeTools nativeLibc nativePrefix isGNU isClang;
|
||||
inherit libc nativeTools nativeLibc nativePrefix isGNU isClang isCompilerRT;
|
||||
|
||||
emacsBufferSetup = pkgs: ''
|
||||
; We should handle propagation here too
|
||||
|
@ -168,6 +168,7 @@ let
|
||||
'' + lib.optionalString stdenv.targetPlatform.isWasm ''
|
||||
echo "-fno-exceptions" >> $out/nix-support/cc-cflags
|
||||
'' + mkExtraBuildCommands cc;
|
||||
isCompilerRT = true;
|
||||
};
|
||||
|
||||
clangNoLibcxx = wrapCCWith rec {
|
||||
@ -182,6 +183,7 @@ let
|
||||
echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags
|
||||
echo "-nostdlib++" >> $out/nix-support/cc-cflags
|
||||
'' + mkExtraBuildCommands cc;
|
||||
isCompilerRT = true;
|
||||
};
|
||||
|
||||
clangNoLibc = wrapCCWith rec {
|
||||
@ -195,6 +197,7 @@ let
|
||||
echo "-rtlib=compiler-rt" >> $out/nix-support/cc-cflags
|
||||
echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags
|
||||
'' + mkExtraBuildCommands cc;
|
||||
isCompilerRT = true;
|
||||
};
|
||||
|
||||
clangNoCompilerRt = wrapCCWith rec {
|
||||
|
@ -17,7 +17,9 @@ stdenv.mkDerivation rec {
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
|
||||
cmakeFlags = lib.optional (!enableShared) "-DLIBUNWIND_ENABLE_SHARED=OFF";
|
||||
cmakeFlags =
|
||||
lib.optional (!enableShared) "-DLIBUNWIND_ENABLE_SHARED=OFF"
|
||||
++ lib.optional (stdenv.cc.isCompilerRT) "-DLIBUNWIND_USE_COMPILER_RT=TRUE";
|
||||
|
||||
meta = llvm_meta // {
|
||||
# Details: https://github.com/llvm/llvm-project/blob/main/libunwind/docs/index.rst
|
||||
|
@ -168,6 +168,7 @@ let
|
||||
'' + lib.optionalString stdenv.targetPlatform.isWasm ''
|
||||
echo "-fno-exceptions" >> $out/nix-support/cc-cflags
|
||||
'' + mkExtraBuildCommands cc;
|
||||
isCompilerRT = true;
|
||||
};
|
||||
|
||||
clangNoLibcxx = wrapCCWith rec {
|
||||
@ -182,6 +183,7 @@ let
|
||||
echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags
|
||||
echo "-nostdlib++" >> $out/nix-support/cc-cflags
|
||||
'' + mkExtraBuildCommands cc;
|
||||
isCompilerRT = true;
|
||||
};
|
||||
|
||||
clangNoLibc = wrapCCWith rec {
|
||||
@ -195,6 +197,7 @@ let
|
||||
echo "-rtlib=compiler-rt" >> $out/nix-support/cc-cflags
|
||||
echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags
|
||||
'' + mkExtraBuildCommands cc;
|
||||
isCompilerRT = true;
|
||||
};
|
||||
|
||||
clangNoCompilerRt = wrapCCWith rec {
|
||||
|
@ -31,7 +31,9 @@ stdenv.mkDerivation rec {
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
|
||||
cmakeFlags = lib.optional (!enableShared) "-DLIBUNWIND_ENABLE_SHARED=OFF";
|
||||
cmakeFlags =
|
||||
lib.optional (!enableShared) "-DLIBUNWIND_ENABLE_SHARED=OFF"
|
||||
++ lib.optional (stdenv.cc.isCompilerRT) "-DLIBUNWIND_USE_COMPILER_RT=TRUE";
|
||||
|
||||
meta = llvm_meta // {
|
||||
# Details: https://github.com/llvm/llvm-project/blob/main/libunwind/docs/index.rst
|
||||
|
@ -168,6 +168,7 @@ let
|
||||
'' + lib.optionalString stdenv.targetPlatform.isWasm ''
|
||||
echo "-fno-exceptions" >> $out/nix-support/cc-cflags
|
||||
'' + mkExtraBuildCommands cc;
|
||||
isCompilerRT = true;
|
||||
};
|
||||
|
||||
clangNoLibcxx = wrapCCWith rec {
|
||||
@ -182,6 +183,7 @@ let
|
||||
echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags
|
||||
echo "-nostdlib++" >> $out/nix-support/cc-cflags
|
||||
'' + mkExtraBuildCommands cc;
|
||||
isCompilerRT = true;
|
||||
};
|
||||
|
||||
clangNoLibc = wrapCCWith rec {
|
||||
@ -195,6 +197,7 @@ let
|
||||
echo "-rtlib=compiler-rt" >> $out/nix-support/cc-cflags
|
||||
echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags
|
||||
'' + mkExtraBuildCommands cc;
|
||||
isCompilerRT = true;
|
||||
};
|
||||
|
||||
clangNoCompilerRt = wrapCCWith rec {
|
||||
|
@ -31,7 +31,9 @@ stdenv.mkDerivation rec {
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
|
||||
cmakeFlags = lib.optional (!enableShared) "-DLIBUNWIND_ENABLE_SHARED=OFF";
|
||||
cmakeFlags =
|
||||
lib.optional (!enableShared) "-DLIBUNWIND_ENABLE_SHARED=OFF"
|
||||
++ lib.optional stdenv.cc.isCompilerRT "-DLIBUNWIND_USE_COMPILER_RT=TRUE";
|
||||
|
||||
meta = llvm_meta // {
|
||||
# Details: https://github.com/llvm/llvm-project/blob/main/libunwind/docs/index.rst
|
||||
|
Loading…
Reference in New Issue
Block a user