diff options
Diffstat (limited to 'pkgs/development/compilers/llvm/14/compiler-rt')
-rw-r--r-- | pkgs/development/compilers/llvm/14/compiler-rt/default.nix | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pkgs/development/compilers/llvm/14/compiler-rt/default.nix b/pkgs/development/compilers/llvm/14/compiler-rt/default.nix index 021eba5a7b63f..98ee8135b8fa0 100644 --- a/pkgs/development/compilers/llvm/14/compiler-rt/default.nix +++ b/pkgs/development/compilers/llvm/14/compiler-rt/default.nix @@ -54,8 +54,6 @@ stdenv.mkDerivation { "-DCMAKE_CXX_COMPILER_WORKS=ON" "-DCOMPILER_RT_BAREMETAL_BUILD=ON" "-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}" - ] ++ lib.optionals (useLLVM && !haveLibc) [ - "-DCMAKE_C_FLAGS=-nodefaultlibs" ] ++ lib.optionals (useLLVM) [ "-DCOMPILER_RT_BUILD_BUILTINS=ON" #https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program @@ -109,6 +107,10 @@ stdenv.mkDerivation { --replace "#include <assert.h>" "" ''; + preConfigure = lib.optionalString (useLLVM && !haveLibc) '' + cmakeFlagsArray+=(-DCMAKE_C_FLAGS="-nodefaultlibs -ffreestanding") + ''; + # Hack around weird upsream RPATH bug postInstall = lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) '' ln -s "$out/lib"/*/* "$out/lib" |