From 810cef75ba11c147c99f72e6db6d2df90ad8f50d Mon Sep 17 00:00:00 2001 From: SharzyL Date: Sun, 15 Oct 2023 10:35:33 +0800 Subject: [PATCH] llvmPackages_*.clangUseLLVM: add libunwind to lib search path --- pkgs/development/compilers/llvm/10/default.nix | 1 + pkgs/development/compilers/llvm/11/default.nix | 1 + pkgs/development/compilers/llvm/12/default.nix | 1 + pkgs/development/compilers/llvm/13/default.nix | 1 + pkgs/development/compilers/llvm/14/default.nix | 1 + pkgs/development/compilers/llvm/15/default.nix | 1 + pkgs/development/compilers/llvm/16/default.nix | 1 + pkgs/development/compilers/llvm/8/default.nix | 1 + pkgs/development/compilers/llvm/9/default.nix | 1 + pkgs/development/compilers/llvm/git/default.nix | 1 + 10 files changed, 10 insertions(+) diff --git a/pkgs/development/compilers/llvm/10/default.nix b/pkgs/development/compilers/llvm/10/default.nix index bc72be0ce7a16..16238221e279e 100644 --- a/pkgs/development/compilers/llvm/10/default.nix +++ b/pkgs/development/compilers/llvm/10/default.nix @@ -158,6 +158,7 @@ let echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags '' + lib.optionalString (!stdenv.targetPlatform.isWasm) '' echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags + echo "-L${targetLlvmLibraries.libunwind}/lib" >> $out/nix-support/cc-ldflags '' + lib.optionalString (!stdenv.targetPlatform.isWasm && stdenv.targetPlatform.useLLVM or false) '' echo "-lunwind" >> $out/nix-support/cc-ldflags '' + lib.optionalString stdenv.targetPlatform.isWasm '' diff --git a/pkgs/development/compilers/llvm/11/default.nix b/pkgs/development/compilers/llvm/11/default.nix index 2d9790fe61ace..3044199e28112 100644 --- a/pkgs/development/compilers/llvm/11/default.nix +++ b/pkgs/development/compilers/llvm/11/default.nix @@ -173,6 +173,7 @@ let echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags '' + lib.optionalString (!stdenv.targetPlatform.isWasm) '' echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags + echo "-L${targetLlvmLibraries.libunwind}/lib" >> $out/nix-support/cc-ldflags '' + lib.optionalString (!stdenv.targetPlatform.isWasm && stdenv.targetPlatform.useLLVM or false) '' echo "-lunwind" >> $out/nix-support/cc-ldflags '' + lib.optionalString stdenv.targetPlatform.isWasm '' diff --git a/pkgs/development/compilers/llvm/12/default.nix b/pkgs/development/compilers/llvm/12/default.nix index 4de0488270715..a38e35e91f6d0 100644 --- a/pkgs/development/compilers/llvm/12/default.nix +++ b/pkgs/development/compilers/llvm/12/default.nix @@ -173,6 +173,7 @@ let echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags '' + lib.optionalString (!stdenv.targetPlatform.isWasm) '' echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags + echo "-L${targetLlvmLibraries.libunwind}/lib" >> $out/nix-support/cc-ldflags '' + lib.optionalString (!stdenv.targetPlatform.isWasm && stdenv.targetPlatform.useLLVM or false) '' echo "-lunwind" >> $out/nix-support/cc-ldflags '' + lib.optionalString stdenv.targetPlatform.isWasm '' diff --git a/pkgs/development/compilers/llvm/13/default.nix b/pkgs/development/compilers/llvm/13/default.nix index c46ebee1d0dba..c811b24c48ef4 100644 --- a/pkgs/development/compilers/llvm/13/default.nix +++ b/pkgs/development/compilers/llvm/13/default.nix @@ -213,6 +213,7 @@ in let echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags '' + lib.optionalString (!stdenv.targetPlatform.isWasm) '' echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags + echo "-L${targetLlvmLibraries.libunwind}/lib" >> $out/nix-support/cc-ldflags '' + lib.optionalString (!stdenv.targetPlatform.isWasm && stdenv.targetPlatform.useLLVM or false) '' echo "-lunwind" >> $out/nix-support/cc-ldflags '' + lib.optionalString stdenv.targetPlatform.isWasm '' diff --git a/pkgs/development/compilers/llvm/14/default.nix b/pkgs/development/compilers/llvm/14/default.nix index 3513833c6f560..090eec2348869 100644 --- a/pkgs/development/compilers/llvm/14/default.nix +++ b/pkgs/development/compilers/llvm/14/default.nix @@ -216,6 +216,7 @@ in let (!stdenv.targetPlatform.isWasm && stdenv.targetPlatform.useLLVM or false) "-lunwind" ++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions"; + nixSupport.cc-ldflags = lib.optionals (!stdenv.targetPlatform.isWasm) [ "-L${targetLlvmLibraries.libunwind}/lib" ]; }; clangNoLibcxx = wrapCCWith rec { diff --git a/pkgs/development/compilers/llvm/15/default.nix b/pkgs/development/compilers/llvm/15/default.nix index 9e9008c7f1eeb..45512528fde68 100644 --- a/pkgs/development/compilers/llvm/15/default.nix +++ b/pkgs/development/compilers/llvm/15/default.nix @@ -215,6 +215,7 @@ in let (!stdenv.targetPlatform.isWasm && stdenv.targetPlatform.useLLVM or false) "-lunwind" ++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions"; + nixSupport.cc-ldflags = lib.optionals (!stdenv.targetPlatform.isWasm) [ "-L${targetLlvmLibraries.libunwind}/lib" ]; }; clangNoLibcxx = wrapCCWith rec { diff --git a/pkgs/development/compilers/llvm/16/default.nix b/pkgs/development/compilers/llvm/16/default.nix index 30da7d57e7912..e4fe73fd60ad6 100644 --- a/pkgs/development/compilers/llvm/16/default.nix +++ b/pkgs/development/compilers/llvm/16/default.nix @@ -220,6 +220,7 @@ in let (!stdenv.targetPlatform.isWasm && stdenv.targetPlatform.useLLVM or false) "-lunwind" ++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions"; + nixSupport.cc-ldflags = lib.optionals (!stdenv.targetPlatform.isWasm) [ "-L${targetLlvmLibraries.libunwind}/lib" ]; }; clangNoLibcxx = wrapCCWith rec { diff --git a/pkgs/development/compilers/llvm/8/default.nix b/pkgs/development/compilers/llvm/8/default.nix index 0483916a620b7..83e19e7e90a29 100644 --- a/pkgs/development/compilers/llvm/8/default.nix +++ b/pkgs/development/compilers/llvm/8/default.nix @@ -161,6 +161,7 @@ let echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags '' + lib.optionalString (!stdenv.targetPlatform.isWasm) '' echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags + echo "-L${targetLlvmLibraries.libunwind}/lib" >> $out/nix-support/cc-ldflags '' + lib.optionalString (!stdenv.targetPlatform.isWasm && stdenv.targetPlatform.useLLVM or false) '' echo "-lunwind" >> $out/nix-support/cc-ldflags '' + lib.optionalString stdenv.targetPlatform.isWasm '' diff --git a/pkgs/development/compilers/llvm/9/default.nix b/pkgs/development/compilers/llvm/9/default.nix index fbd2e57805be2..a6274c8b2b9c0 100644 --- a/pkgs/development/compilers/llvm/9/default.nix +++ b/pkgs/development/compilers/llvm/9/default.nix @@ -161,6 +161,7 @@ let echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags '' + lib.optionalString (!stdenv.targetPlatform.isWasm) '' echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags + echo "-L${targetLlvmLibraries.libunwind}/lib" >> $out/nix-support/cc-ldflags '' + lib.optionalString (!stdenv.targetPlatform.isWasm && stdenv.targetPlatform.useLLVM or false) '' echo "-lunwind" >> $out/nix-support/cc-ldflags '' + lib.optionalString stdenv.targetPlatform.isWasm '' diff --git a/pkgs/development/compilers/llvm/git/default.nix b/pkgs/development/compilers/llvm/git/default.nix index 41ce6076da5f3..efa8daf5d98b9 100644 --- a/pkgs/development/compilers/llvm/git/default.nix +++ b/pkgs/development/compilers/llvm/git/default.nix @@ -216,6 +216,7 @@ in let (!stdenv.targetPlatform.isWasm && stdenv.targetPlatform.useLLVM or false) "-lunwind" ++ lib.optional stdenv.targetPlatform.isWasm "-fno-exceptions"; + nixSupport.cc-ldflags = lib.optionals (!stdenv.targetPlatform.isWasm) [ "-L${targetLlvmLibraries.libunwind}/lib" ]; }; clangNoLibcxx = wrapCCWith rec {