libunwind: Fix build against compiler-rt-using clang

main
Shea Levy 2 years ago
parent 4c0d5f80fc
commit 078a07708a
No known key found for this signature in database
GPG Key ID: 5C0BD6957D86FE27
  1. 3
      pkgs/build-support/cc-wrapper/default.nix
  2. 3
      pkgs/development/compilers/llvm/13/default.nix
  3. 4
      pkgs/development/compilers/llvm/13/libunwind/default.nix
  4. 3
      pkgs/development/compilers/llvm/14/default.nix
  5. 4
      pkgs/development/compilers/llvm/14/libunwind/default.nix
  6. 3
      pkgs/development/compilers/llvm/git/default.nix
  7. 4
      pkgs/development/compilers/llvm/git/libunwind/default.nix

@ -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…
Cancel
Save