treewide: Try to make a few bootstrapping things more consistent

- Introduce `preLibcCrossHeaders` to bootstrap libgcc and compiler-rt
the same way.

- Organize LLVM bintools as `bintools{-unwrapped,,NoLibc}` for
consistency with GNU Binutils and Apple's cctools.

- Do Android changes for all `llvmPackages` for consistency.

- Improve the way the default GCC and LLVM versions are selected.

+301 -169
pkgs/development/compilers/llvm/10/bintools.nix pkgs/development/compilers/llvm/10/bintools/default.nix
+7 -7
pkgs/development/compilers/llvm/10/compiler-rt/default.nix
··· 4 5 useLLVM = stdenv.hostPlatform.useLLVM or false; 6 bareMetal = stdenv.hostPlatform.parsed.kernel.name == "none"; 7 inherit (stdenv.hostPlatform) isMusl; 8 9 in 10 11 - stdenv.mkDerivation rec { 12 - pname = "compiler-rt"; 13 inherit version; 14 - src = fetch pname "1yjqjri753w0fzmxcyz687nvd97sbc9rsqrxzpq720na47hwh3fr"; 15 16 nativeBuildInputs = [ cmake python3 llvm.dev ]; 17 buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi; ··· 29 "-DCOMPILER_RT_BUILD_XRAY=OFF" 30 "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF" 31 "-DCOMPILER_RT_BUILD_PROFILE=OFF" 32 - ] ++ lib.optionals (useLLVM || bareMetal) [ 33 "-DCMAKE_C_COMPILER_WORKS=ON" 34 "-DCMAKE_CXX_COMPILER_WORKS=ON" 35 "-DCOMPILER_RT_BAREMETAL_BUILD=ON" 36 "-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}" 37 ] ++ lib.optionals (useLLVM) [ 38 "-DCOMPILER_RT_BUILD_BUILTINS=ON" 39 - "-DCMAKE_C_FLAGS=-nodefaultlibs" 40 #https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program 41 "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY" 42 ] ++ lib.optionals (bareMetal) [ ··· 57 ./gnu-install-dirs.patch 58 ]# ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch 59 ++ lib.optional stdenv.hostPlatform.isAarch32 ./armv7l.patch; 60 - 61 62 # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks 63 # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra ··· 88 ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o 89 ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/crtendS.o 90 ''; 91 - 92 }
··· 4 5 useLLVM = stdenv.hostPlatform.useLLVM or false; 6 bareMetal = stdenv.hostPlatform.parsed.kernel.name == "none"; 7 + haveLibc = stdenv.cc.libc != null; 8 inherit (stdenv.hostPlatform) isMusl; 9 10 in 11 12 + stdenv.mkDerivation { 13 + pname = "compiler-rt" + lib.optionalString (haveLibc) "-libc"; 14 inherit version; 15 + src = fetch "compiler-rt" "1yjqjri753w0fzmxcyz687nvd97sbc9rsqrxzpq720na47hwh3fr"; 16 17 nativeBuildInputs = [ cmake python3 llvm.dev ]; 18 buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi; ··· 30 "-DCOMPILER_RT_BUILD_XRAY=OFF" 31 "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF" 32 "-DCOMPILER_RT_BUILD_PROFILE=OFF" 33 + ] ++ lib.optionals ((useLLVM || bareMetal) && !haveLibc) [ 34 "-DCMAKE_C_COMPILER_WORKS=ON" 35 "-DCMAKE_CXX_COMPILER_WORKS=ON" 36 "-DCOMPILER_RT_BAREMETAL_BUILD=ON" 37 "-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}" 38 + ] ++ lib.optionals (useLLVM && !haveLibc) [ 39 + "-DCMAKE_C_FLAGS=-nodefaultlibs" 40 ] ++ lib.optionals (useLLVM) [ 41 "-DCOMPILER_RT_BUILD_BUILTINS=ON" 42 #https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program 43 "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY" 44 ] ++ lib.optionals (bareMetal) [ ··· 59 ./gnu-install-dirs.patch 60 ]# ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch 61 ++ lib.optional stdenv.hostPlatform.isAarch32 ./armv7l.patch; 62 63 # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks 64 # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra ··· 89 ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o 90 ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/crtendS.o 91 ''; 92 }
+41 -17
pkgs/development/compilers/llvm/10/default.nix
··· 1 - { lowPrio, newScope, pkgs, lib, stdenv, cmake, gccForLibs 2 , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith 3 , buildLlvmTools # tools, but from the previous stage, for cross 4 , targetLlvmLibraries # libraries, but from the next stage, for cross ··· 93 # doesn’t support like LLVM. Probably we should move to some other 94 # file. 95 96 - bintools = callPackage ./bintools.nix {}; 97 98 lldClang = wrapCCWith rec { 99 cc = tools.clang-unwrapped; ··· 112 echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags 113 '' + lib.optionalString (!stdenv.targetPlatform.isWasm) '' 114 echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags 115 '' + lib.optionalString stdenv.targetPlatform.isWasm '' 116 echo "-fno-exceptions" >> $out/nix-support/cc-cflags 117 '' + mkExtraBuildCommands cc; ··· 120 lldClangNoLibcxx = wrapCCWith rec { 121 cc = tools.clang-unwrapped; 122 libcxx = null; 123 - bintools = wrapBintoolsWith { 124 - inherit (tools) bintools; 125 - }; 126 extraPackages = [ 127 targetLlvmLibraries.compiler-rt 128 ]; ··· 136 lldClangNoLibc = wrapCCWith rec { 137 cc = tools.clang-unwrapped; 138 libcxx = null; 139 - bintools = wrapBintoolsWith { 140 - inherit (tools) bintools; 141 - libc = null; 142 - }; 143 extraPackages = [ 144 targetLlvmLibraries.compiler-rt 145 ]; ··· 152 lldClangNoCompilerRt = wrapCCWith rec { 153 cc = tools.clang-unwrapped; 154 libcxx = null; 155 - bintools = wrapBintoolsWith { 156 - inherit (tools) bintools; 157 - libc = null; 158 - }; 159 extraPackages = [ ]; 160 extraBuildCommands = '' 161 echo "-nostartfiles" >> $out/nix-support/cc-cflags 162 '' + mkExtraBuildCommands0 cc; 163 }; 164 165 }); 166 167 libraries = lib.makeExtensible (libraries: let 168 callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; }); 169 in { 170 171 - compiler-rt = callPackage ./compiler-rt ({} // 172 - (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { 173 - stdenv = overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt; 174 - })); 175 176 stdenv = overrideCC stdenv buildLlvmTools.clang; 177
··· 1 + { lowPrio, newScope, pkgs, lib, stdenv, cmake 2 + , gccForLibs, preLibcCrossHeaders 3 , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith 4 , buildLlvmTools # tools, but from the previous stage, for cross 5 , targetLlvmLibraries # libraries, but from the next stage, for cross ··· 94 # doesn’t support like LLVM. Probably we should move to some other 95 # file. 96 97 + bintools-unwrapped = callPackage ./bintools {}; 98 + 99 + bintoolsNoLibc = wrapBintoolsWith { 100 + bintools = tools.bintools-unwrapped; 101 + libc = preLibcCrossHeaders; 102 + }; 103 + 104 + bintools = wrapBintoolsWith { 105 + bintools = tools.bintools-unwrapped; 106 + }; 107 108 lldClang = wrapCCWith rec { 109 cc = tools.clang-unwrapped; ··· 122 echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags 123 '' + lib.optionalString (!stdenv.targetPlatform.isWasm) '' 124 echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags 125 + '' + lib.optionalString (stdenv.targetPlatform.isAndroid && stdenv.targetPlatform.useLLVM) '' 126 + echo "-lunwind" >> $out/nix-support/cc-ldflags 127 '' + lib.optionalString stdenv.targetPlatform.isWasm '' 128 echo "-fno-exceptions" >> $out/nix-support/cc-cflags 129 '' + mkExtraBuildCommands cc; ··· 132 lldClangNoLibcxx = wrapCCWith rec { 133 cc = tools.clang-unwrapped; 134 libcxx = null; 135 + inherit (tools) bintools; 136 extraPackages = [ 137 targetLlvmLibraries.compiler-rt 138 ]; ··· 146 lldClangNoLibc = wrapCCWith rec { 147 cc = tools.clang-unwrapped; 148 libcxx = null; 149 + bintools = tools.bintoolsNoLibc; 150 extraPackages = [ 151 targetLlvmLibraries.compiler-rt 152 ]; ··· 159 lldClangNoCompilerRt = wrapCCWith rec { 160 cc = tools.clang-unwrapped; 161 libcxx = null; 162 + bintools = tools.bintoolsNoLibc; 163 extraPackages = [ ]; 164 extraBuildCommands = '' 165 echo "-nostartfiles" >> $out/nix-support/cc-cflags 166 '' + mkExtraBuildCommands0 cc; 167 }; 168 169 + lldClangNoCompilerRtWithLibc = wrapCCWith rec { 170 + cc = tools.clang-unwrapped; 171 + libcxx = null; 172 + inherit (tools) bintools; 173 + extraPackages = [ ]; 174 + extraBuildCommands = mkExtraBuildCommands0 cc; 175 + }; 176 + 177 }); 178 179 libraries = lib.makeExtensible (libraries: let 180 callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; }); 181 in { 182 183 + compiler-rt-libc = callPackage ./compiler-rt { 184 + stdenv = if stdenv.hostPlatform.useLLVM or false 185 + then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRtWithLibc 186 + else stdenv; 187 + }; 188 + 189 + compiler-rt-no-libc = callPackage ./compiler-rt { 190 + stdenv = if stdenv.hostPlatform.useLLVM or false 191 + then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt 192 + else stdenv; 193 + }; 194 + 195 + # N.B. condition is safe because without useLLVM both are the same. 196 + compiler-rt = if stdenv.hostPlatform.isAndroid 197 + then libraries.compiler-rt-libc 198 + else libraries.compiler-rt-no-libc; 199 200 stdenv = overrideCC stdenv buildLlvmTools.clang; 201
pkgs/development/compilers/llvm/11/bintools.nix pkgs/development/compilers/llvm/11/bintools/default.nix
+7 -7
pkgs/development/compilers/llvm/11/compiler-rt/default.nix
··· 4 5 useLLVM = stdenv.hostPlatform.useLLVM or false; 6 bareMetal = stdenv.hostPlatform.parsed.kernel.name == "none"; 7 inherit (stdenv.hostPlatform) isMusl; 8 9 in 10 11 - stdenv.mkDerivation rec { 12 - pname = "compiler-rt"; 13 inherit version; 14 - src = fetch pname "0x1j8ngf1zj63wlnns9vlibafq48qcm72p4jpaxkmkb4qw0grwfy"; 15 16 nativeBuildInputs = [ cmake python3 llvm.dev ]; 17 buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi; ··· 29 "-DCOMPILER_RT_BUILD_XRAY=OFF" 30 "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF" 31 "-DCOMPILER_RT_BUILD_PROFILE=OFF" 32 - ] ++ lib.optionals (useLLVM || bareMetal) [ 33 "-DCMAKE_C_COMPILER_WORKS=ON" 34 "-DCMAKE_CXX_COMPILER_WORKS=ON" 35 "-DCOMPILER_RT_BAREMETAL_BUILD=ON" 36 "-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}" 37 ] ++ lib.optionals (useLLVM) [ 38 "-DCOMPILER_RT_BUILD_BUILTINS=ON" 39 - "-DCMAKE_C_FLAGS=-nodefaultlibs" 40 #https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program 41 "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY" 42 ] ++ lib.optionals (bareMetal) [ ··· 58 ./normalize-var.patch 59 ]# ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch 60 ++ lib.optional stdenv.hostPlatform.isAarch32 ./armv7l.patch; 61 - 62 63 # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks 64 # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra ··· 91 ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o 92 ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/crtendS.o 93 ''; 94 - 95 }
··· 4 5 useLLVM = stdenv.hostPlatform.useLLVM or false; 6 bareMetal = stdenv.hostPlatform.parsed.kernel.name == "none"; 7 + haveLibc = stdenv.cc.libc != null; 8 inherit (stdenv.hostPlatform) isMusl; 9 10 in 11 12 + stdenv.mkDerivation { 13 + pname = "compiler-rt" + lib.optionalString (haveLibc) "-libc"; 14 inherit version; 15 + src = fetch "compiler-rt" "0x1j8ngf1zj63wlnns9vlibafq48qcm72p4jpaxkmkb4qw0grwfy"; 16 17 nativeBuildInputs = [ cmake python3 llvm.dev ]; 18 buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi; ··· 30 "-DCOMPILER_RT_BUILD_XRAY=OFF" 31 "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF" 32 "-DCOMPILER_RT_BUILD_PROFILE=OFF" 33 + ] ++ lib.optionals ((useLLVM || bareMetal) && !haveLibc) [ 34 "-DCMAKE_C_COMPILER_WORKS=ON" 35 "-DCMAKE_CXX_COMPILER_WORKS=ON" 36 "-DCOMPILER_RT_BAREMETAL_BUILD=ON" 37 "-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}" 38 + ] ++ lib.optionals (useLLVM && !haveLibc) [ 39 + "-DCMAKE_C_FLAGS=-nodefaultlibs" 40 ] ++ lib.optionals (useLLVM) [ 41 "-DCOMPILER_RT_BUILD_BUILTINS=ON" 42 #https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program 43 "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY" 44 ] ++ lib.optionals (bareMetal) [ ··· 60 ./normalize-var.patch 61 ]# ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch 62 ++ lib.optional stdenv.hostPlatform.isAarch32 ./armv7l.patch; 63 64 # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks 65 # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra ··· 92 ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o 93 ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/crtendS.o 94 ''; 95 }
+41 -17
pkgs/development/compilers/llvm/11/default.nix
··· 1 - { lowPrio, newScope, pkgs, lib, stdenv, cmake, gccForLibs 2 , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith 3 , buildLlvmTools # tools, but from the previous stage, for cross 4 , targetLlvmLibraries # libraries, but from the next stage, for cross ··· 94 # doesn’t support like LLVM. Probably we should move to some other 95 # file. 96 97 - bintools = callPackage ./bintools.nix {}; 98 99 lldClang = wrapCCWith rec { 100 cc = tools.clang-unwrapped; ··· 113 echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags 114 '' + lib.optionalString (!stdenv.targetPlatform.isWasm) '' 115 echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags 116 '' + lib.optionalString stdenv.targetPlatform.isWasm '' 117 echo "-fno-exceptions" >> $out/nix-support/cc-cflags 118 '' + mkExtraBuildCommands cc; ··· 121 lldClangNoLibcxx = wrapCCWith rec { 122 cc = tools.clang-unwrapped; 123 libcxx = null; 124 - bintools = wrapBintoolsWith { 125 - inherit (tools) bintools; 126 - }; 127 extraPackages = [ 128 targetLlvmLibraries.compiler-rt 129 ]; ··· 137 lldClangNoLibc = wrapCCWith rec { 138 cc = tools.clang-unwrapped; 139 libcxx = null; 140 - bintools = wrapBintoolsWith { 141 - inherit (tools) bintools; 142 - libc = null; 143 - }; 144 extraPackages = [ 145 targetLlvmLibraries.compiler-rt 146 ]; ··· 153 lldClangNoCompilerRt = wrapCCWith rec { 154 cc = tools.clang-unwrapped; 155 libcxx = null; 156 - bintools = wrapBintoolsWith { 157 - inherit (tools) bintools; 158 - libc = null; 159 - }; 160 extraPackages = [ ]; 161 extraBuildCommands = '' 162 echo "-nostartfiles" >> $out/nix-support/cc-cflags 163 '' + mkExtraBuildCommands0 cc; 164 }; 165 166 }); 167 168 libraries = lib.makeExtensible (libraries: let 169 callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; }); 170 in { 171 172 - compiler-rt = callPackage ./compiler-rt ({} // 173 - (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { 174 - stdenv = overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt; 175 - })); 176 177 stdenv = overrideCC stdenv buildLlvmTools.clang; 178
··· 1 + { lowPrio, newScope, pkgs, lib, stdenv, cmake 2 + , gccForLibs, preLibcCrossHeaders 3 , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith 4 , buildLlvmTools # tools, but from the previous stage, for cross 5 , targetLlvmLibraries # libraries, but from the next stage, for cross ··· 95 # doesn’t support like LLVM. Probably we should move to some other 96 # file. 97 98 + bintools-unwrapped = callPackage ./bintools {}; 99 + 100 + bintoolsNoLibc = wrapBintoolsWith { 101 + bintools = tools.bintools-unwrapped; 102 + libc = preLibcCrossHeaders; 103 + }; 104 + 105 + bintools = wrapBintoolsWith { 106 + bintools = tools.bintools-unwrapped; 107 + }; 108 109 lldClang = wrapCCWith rec { 110 cc = tools.clang-unwrapped; ··· 123 echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags 124 '' + lib.optionalString (!stdenv.targetPlatform.isWasm) '' 125 echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags 126 + '' + lib.optionalString (stdenv.targetPlatform.isAndroid && stdenv.targetPlatform.useLLVM) '' 127 + echo "-lunwind" >> $out/nix-support/cc-ldflags 128 '' + lib.optionalString stdenv.targetPlatform.isWasm '' 129 echo "-fno-exceptions" >> $out/nix-support/cc-cflags 130 '' + mkExtraBuildCommands cc; ··· 133 lldClangNoLibcxx = wrapCCWith rec { 134 cc = tools.clang-unwrapped; 135 libcxx = null; 136 + inherit (tools) bintools; 137 extraPackages = [ 138 targetLlvmLibraries.compiler-rt 139 ]; ··· 147 lldClangNoLibc = wrapCCWith rec { 148 cc = tools.clang-unwrapped; 149 libcxx = null; 150 + bintools = tools.bintoolsNoLibc; 151 extraPackages = [ 152 targetLlvmLibraries.compiler-rt 153 ]; ··· 160 lldClangNoCompilerRt = wrapCCWith rec { 161 cc = tools.clang-unwrapped; 162 libcxx = null; 163 + bintools = tools.bintoolsNoLibc; 164 extraPackages = [ ]; 165 extraBuildCommands = '' 166 echo "-nostartfiles" >> $out/nix-support/cc-cflags 167 '' + mkExtraBuildCommands0 cc; 168 }; 169 170 + lldClangNoCompilerRtWithLibc = wrapCCWith rec { 171 + cc = tools.clang-unwrapped; 172 + libcxx = null; 173 + inherit (tools) bintools; 174 + extraPackages = [ ]; 175 + extraBuildCommands = mkExtraBuildCommands0 cc; 176 + }; 177 + 178 }); 179 180 libraries = lib.makeExtensible (libraries: let 181 callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; }); 182 in { 183 184 + compiler-rt-libc = callPackage ./compiler-rt { 185 + stdenv = if stdenv.hostPlatform.useLLVM or false 186 + then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRtWithLibc 187 + else stdenv; 188 + }; 189 + 190 + compiler-rt-no-libc = callPackage ./compiler-rt { 191 + stdenv = if stdenv.hostPlatform.useLLVM or false 192 + then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt 193 + else stdenv; 194 + }; 195 + 196 + # N.B. condition is safe because without useLLVM both are the same. 197 + compiler-rt = if stdenv.hostPlatform.isAndroid 198 + then libraries.compiler-rt-libc 199 + else libraries.compiler-rt-no-libc; 200 201 stdenv = overrideCC stdenv buildLlvmTools.clang; 202
+1 -2
pkgs/development/compilers/llvm/12/compiler-rt/default.nix
··· 9 10 in 11 12 - stdenv.mkDerivation rec { 13 pname = "compiler-rt" + lib.optionalString (haveLibc) "-libc"; 14 inherit version; 15 src = fetch "compiler-rt" "0d444qihq9jhqnfv003cr704v363va72zl6qaw2algj1c85cva45"; ··· 60 ./normalize-var.patch 61 ]# ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch 62 ++ lib.optional stdenv.hostPlatform.isAarch32 ./armv7l.patch; 63 - 64 65 # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks 66 # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra
··· 9 10 in 11 12 + stdenv.mkDerivation { 13 pname = "compiler-rt" + lib.optionalString (haveLibc) "-libc"; 14 inherit version; 15 src = fetch "compiler-rt" "0d444qihq9jhqnfv003cr704v363va72zl6qaw2algj1c85cva45"; ··· 60 ./normalize-var.patch 61 ]# ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch 62 ++ lib.optional stdenv.hostPlatform.isAarch32 ./armv7l.patch; 63 64 # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks 65 # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra
+28 -24
pkgs/development/compilers/llvm/12/default.nix
··· 1 - { lowPrio, newScope, pkgs, lib, stdenv, cmake, gccForLibs 2 , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith 3 , buildLlvmTools # tools, but from the previous stage, for cross 4 , targetLlvmLibraries # libraries, but from the next stage, for cross ··· 112 # doesn’t support like LLVM. Probably we should move to some other 113 # file. 114 115 - bintools = callPackage ./bintools {}; 116 117 lldClang = wrapCCWith rec { 118 cc = tools.clang-unwrapped; ··· 141 lldClangNoLibcxx = wrapCCWith rec { 142 cc = tools.clang-unwrapped; 143 libcxx = null; 144 - bintools = wrapBintoolsWith { 145 - inherit (tools) bintools; 146 - }; 147 extraPackages = [ 148 targetLlvmLibraries.compiler-rt 149 ]; ··· 157 lldClangNoLibc = wrapCCWith rec { 158 cc = tools.clang-unwrapped; 159 libcxx = null; 160 - bintools = wrapBintoolsWith { 161 - inherit (tools) bintools; 162 - libc = null; 163 - }; 164 extraPackages = [ 165 targetLlvmLibraries.compiler-rt 166 ]; ··· 173 lldClangNoCompilerRt = wrapCCWith rec { 174 cc = tools.clang-unwrapped; 175 libcxx = null; 176 - bintools = wrapBintoolsWith { 177 - inherit (tools) bintools; 178 - libc = null; 179 - }; 180 extraPackages = [ ]; 181 extraBuildCommands = '' 182 echo "-nostartfiles" >> $out/nix-support/cc-cflags ··· 186 lldClangNoCompilerRtWithLibc = wrapCCWith rec { 187 cc = tools.clang-unwrapped; 188 libcxx = null; 189 - bintools = wrapBintoolsWith { 190 - inherit (tools) bintools; 191 - }; 192 extraPackages = [ ]; 193 extraBuildCommands = mkExtraBuildCommands0 cc; 194 }; ··· 199 callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; }); 200 in { 201 202 - compiler-rt-libc = callPackage ./compiler-rt ({ inherit llvm_meta; } // 203 - (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { 204 - stdenv = overrideCC stdenv buildLlvmTools.lldClangNoCompilerRtWithLibc; 205 - })); 206 207 - compiler-rt-no-libc = callPackage ./compiler-rt ({ inherit llvm_meta; } // 208 - (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { 209 - stdenv = overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt; 210 - })); 211 212 # N.B. condition is safe because without useLLVM both are the same. 213 compiler-rt = if stdenv.hostPlatform.isAndroid
··· 1 + { lowPrio, newScope, pkgs, lib, stdenv, cmake 2 + , gccForLibs, preLibcCrossHeaders 3 , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith 4 , buildLlvmTools # tools, but from the previous stage, for cross 5 , targetLlvmLibraries # libraries, but from the next stage, for cross ··· 113 # doesn’t support like LLVM. Probably we should move to some other 114 # file. 115 116 + bintools-unwrapped = callPackage ./bintools {}; 117 + 118 + bintoolsNoLibc = wrapBintoolsWith { 119 + bintools = tools.bintools-unwrapped; 120 + libc = preLibcCrossHeaders; 121 + }; 122 + 123 + bintools = wrapBintoolsWith { 124 + bintools = tools.bintools-unwrapped; 125 + }; 126 127 lldClang = wrapCCWith rec { 128 cc = tools.clang-unwrapped; ··· 151 lldClangNoLibcxx = wrapCCWith rec { 152 cc = tools.clang-unwrapped; 153 libcxx = null; 154 + inherit (tools) bintools; 155 extraPackages = [ 156 targetLlvmLibraries.compiler-rt 157 ]; ··· 165 lldClangNoLibc = wrapCCWith rec { 166 cc = tools.clang-unwrapped; 167 libcxx = null; 168 + bintools = tools.bintoolsNoLibc; 169 extraPackages = [ 170 targetLlvmLibraries.compiler-rt 171 ]; ··· 178 lldClangNoCompilerRt = wrapCCWith rec { 179 cc = tools.clang-unwrapped; 180 libcxx = null; 181 + bintools = tools.bintoolsNoLibc; 182 extraPackages = [ ]; 183 extraBuildCommands = '' 184 echo "-nostartfiles" >> $out/nix-support/cc-cflags ··· 188 lldClangNoCompilerRtWithLibc = wrapCCWith rec { 189 cc = tools.clang-unwrapped; 190 libcxx = null; 191 + inherit (tools) bintools; 192 extraPackages = [ ]; 193 extraBuildCommands = mkExtraBuildCommands0 cc; 194 }; ··· 199 callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; }); 200 in { 201 202 + compiler-rt-libc = callPackage ./compiler-rt { 203 + inherit llvm_meta; 204 + stdenv = if stdenv.hostPlatform.useLLVM or false 205 + then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRtWithLibc 206 + else stdenv; 207 + }; 208 209 + compiler-rt-no-libc = callPackage ./compiler-rt { 210 + inherit llvm_meta; 211 + stdenv = if stdenv.hostPlatform.useLLVM or false 212 + then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt 213 + else stdenv; 214 + }; 215 216 # N.B. condition is safe because without useLLVM both are the same. 217 compiler-rt = if stdenv.hostPlatform.isAndroid
pkgs/development/compilers/llvm/7/bintools.nix pkgs/development/compilers/llvm/7/bintools/default.nix
+9 -8
pkgs/development/compilers/llvm/7/compiler-rt/default.nix
··· 4 5 useLLVM = stdenv.hostPlatform.useLLVM or false; 6 bareMetal = stdenv.hostPlatform.parsed.kernel.name == "none"; 7 inherit (stdenv.hostPlatform) isMusl; 8 9 in 10 11 stdenv.mkDerivation { 12 - pname = "compiler-rt"; 13 inherit version; 14 src = fetch "compiler-rt" "1n48p8gjarihkws0i2bay5w9bdwyxyxxbpwyng7ba58jb30dlyq5"; 15 ··· 29 "-DCOMPILER_RT_BUILD_XRAY=OFF" 30 "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF" 31 "-DCOMPILER_RT_BUILD_PROFILE=OFF" 32 - ] ++ lib.optionals (useLLVM || bareMetal) [ 33 "-DCMAKE_C_COMPILER_WORKS=ON" 34 "-DCMAKE_CXX_COMPILER_WORKS=ON" 35 "-DCOMPILER_RT_BAREMETAL_BUILD=ON" 36 "-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}" 37 ] ++ lib.optionals (useLLVM) [ 38 "-DCOMPILER_RT_BUILD_BUILTINS=ON" 39 - "-DCMAKE_C_FLAGS=-nodefaultlibs" 40 #https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program 41 "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY" 42 ] ++ lib.optionals (bareMetal) [ ··· 83 postInstall = lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) '' 84 ln -s "$out/lib"/*/* "$out/lib" 85 '' + lib.optionalString (useLLVM) '' 86 - ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/linux/crtbegin.o 87 - ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/linux/crtend.o 88 - ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/linux/crtbeginS.o 89 - ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/linux/crtendS.o 90 ''; 91 - 92 }
··· 4 5 useLLVM = stdenv.hostPlatform.useLLVM or false; 6 bareMetal = stdenv.hostPlatform.parsed.kernel.name == "none"; 7 + haveLibc = stdenv.cc.libc != null; 8 inherit (stdenv.hostPlatform) isMusl; 9 10 in 11 12 stdenv.mkDerivation { 13 + pname = "compiler-rt" + lib.optionalString (haveLibc) "-libc"; 14 inherit version; 15 src = fetch "compiler-rt" "1n48p8gjarihkws0i2bay5w9bdwyxyxxbpwyng7ba58jb30dlyq5"; 16 ··· 30 "-DCOMPILER_RT_BUILD_XRAY=OFF" 31 "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF" 32 "-DCOMPILER_RT_BUILD_PROFILE=OFF" 33 + ] ++ lib.optionals ((useLLVM || bareMetal) && !haveLibc) [ 34 "-DCMAKE_C_COMPILER_WORKS=ON" 35 "-DCMAKE_CXX_COMPILER_WORKS=ON" 36 "-DCOMPILER_RT_BAREMETAL_BUILD=ON" 37 "-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}" 38 + ] ++ lib.optionals (useLLVM && !haveLibc) [ 39 + "-DCMAKE_C_FLAGS=-nodefaultlibs" 40 ] ++ lib.optionals (useLLVM) [ 41 "-DCOMPILER_RT_BUILD_BUILTINS=ON" 42 #https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program 43 "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY" 44 ] ++ lib.optionals (bareMetal) [ ··· 85 postInstall = lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) '' 86 ln -s "$out/lib"/*/* "$out/lib" 87 '' + lib.optionalString (useLLVM) '' 88 + ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/crtbegin.o 89 + ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/crtend.o 90 + ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o 91 + ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/crtendS.o 92 ''; 93 }
+37 -14
pkgs/development/compilers/llvm/7/default.nix
··· 1 - { lowPrio, newScope, pkgs, lib, stdenv, cmake, gccForLibs 2 , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith 3 , buildLlvmTools # tools, but from the previous stage, for cross 4 , targetLlvmLibraries # libraries, but from the next stage, for cross ··· 95 # doesn’t support like LLVM. Probably we should move to some other 96 # file. 97 98 - bintools = callPackage ./bintools.nix {}; 99 100 lldClang = wrapCCWith rec { 101 cc = tools.clang-unwrapped; ··· 114 echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags 115 '' + lib.optionalString (!stdenv.targetPlatform.isWasm) '' 116 echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags 117 '' + lib.optionalString stdenv.targetPlatform.isWasm '' 118 echo "-fno-exceptions" >> $out/nix-support/cc-cflags 119 '' + mkExtraBuildCommands cc; ··· 122 lldClangNoLibcxx = wrapCCWith rec { 123 cc = tools.clang-unwrapped; 124 libcxx = null; 125 - bintools = wrapBintoolsWith { 126 - inherit (tools) bintools; 127 - }; 128 extraPackages = [ 129 targetLlvmLibraries.compiler-rt 130 ]; ··· 138 lldClangNoLibc = wrapCCWith rec { 139 cc = tools.clang-unwrapped; 140 libcxx = null; 141 - bintools = wrapBintoolsWith { 142 - inherit (tools) bintools; 143 - libc = null; 144 - }; 145 extraPackages = [ 146 targetLlvmLibraries.compiler-rt 147 ]; ··· 154 lldClangNoCompilerRt = wrapCCWith rec { 155 cc = tools.clang-unwrapped; 156 libcxx = null; 157 - bintools = wrapBintoolsWith { 158 - inherit (tools) bintools; 159 - libc = null; 160 - }; 161 extraPackages = [ ]; 162 extraBuildCommands = '' 163 echo "-nostartfiles" >> $out/nix-support/cc-cflags 164 '' + mkExtraBuildCommands0 cc; 165 }; 166 167 }); 168 169 libraries = lib.makeExtensible (libraries: let 170 callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; }); 171 in { 172 173 - compiler-rt = callPackage ./compiler-rt { 174 stdenv = if stdenv.hostPlatform.useLLVM or false 175 then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt 176 else stdenv; 177 }; 178 179 stdenv = overrideCC stdenv buildLlvmTools.clang; 180
··· 1 + { lowPrio, newScope, pkgs, lib, stdenv, cmake 2 + , gccForLibs, preLibcCrossHeaders 3 , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith 4 , buildLlvmTools # tools, but from the previous stage, for cross 5 , targetLlvmLibraries # libraries, but from the next stage, for cross ··· 96 # doesn’t support like LLVM. Probably we should move to some other 97 # file. 98 99 + bintools-unwrapped = callPackage ./bintools {}; 100 + 101 + bintoolsNoLibc = wrapBintoolsWith { 102 + bintools = tools.bintools-unwrapped; 103 + libc = preLibcCrossHeaders; 104 + }; 105 + 106 + bintools = wrapBintoolsWith { 107 + bintools = tools.bintools-unwrapped; 108 + }; 109 110 lldClang = wrapCCWith rec { 111 cc = tools.clang-unwrapped; ··· 124 echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags 125 '' + lib.optionalString (!stdenv.targetPlatform.isWasm) '' 126 echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags 127 + '' + lib.optionalString (stdenv.targetPlatform.isAndroid && stdenv.targetPlatform.useLLVM) '' 128 + echo "-lunwind" >> $out/nix-support/cc-ldflags 129 '' + lib.optionalString stdenv.targetPlatform.isWasm '' 130 echo "-fno-exceptions" >> $out/nix-support/cc-cflags 131 '' + mkExtraBuildCommands cc; ··· 134 lldClangNoLibcxx = wrapCCWith rec { 135 cc = tools.clang-unwrapped; 136 libcxx = null; 137 + inherit (tools) bintools; 138 extraPackages = [ 139 targetLlvmLibraries.compiler-rt 140 ]; ··· 148 lldClangNoLibc = wrapCCWith rec { 149 cc = tools.clang-unwrapped; 150 libcxx = null; 151 + bintools = tools.bintoolsNoLibc; 152 extraPackages = [ 153 targetLlvmLibraries.compiler-rt 154 ]; ··· 161 lldClangNoCompilerRt = wrapCCWith rec { 162 cc = tools.clang-unwrapped; 163 libcxx = null; 164 + bintools = tools.bintoolsNoLibc; 165 extraPackages = [ ]; 166 extraBuildCommands = '' 167 echo "-nostartfiles" >> $out/nix-support/cc-cflags 168 '' + mkExtraBuildCommands0 cc; 169 }; 170 171 + lldClangNoCompilerRtWithLibc = wrapCCWith rec { 172 + cc = tools.clang-unwrapped; 173 + libcxx = null; 174 + inherit (tools) bintools; 175 + extraPackages = [ ]; 176 + extraBuildCommands = mkExtraBuildCommands0 cc; 177 + }; 178 + 179 }); 180 181 libraries = lib.makeExtensible (libraries: let 182 callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; }); 183 in { 184 185 + compiler-rt-libc = callPackage ./compiler-rt { 186 + stdenv = if stdenv.hostPlatform.useLLVM or false 187 + then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRtWithLibc 188 + else stdenv; 189 + }; 190 + 191 + compiler-rt-no-libc = callPackage ./compiler-rt { 192 stdenv = if stdenv.hostPlatform.useLLVM or false 193 then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt 194 else stdenv; 195 }; 196 + 197 + # N.B. condition is safe because without useLLVM both are the same. 198 + compiler-rt = if stdenv.hostPlatform.isAndroid 199 + then libraries.compiler-rt-libc 200 + else libraries.compiler-rt-no-libc; 201 202 stdenv = overrideCC stdenv buildLlvmTools.clang; 203
pkgs/development/compilers/llvm/8/bintools.nix pkgs/development/compilers/llvm/8/bintools/default.nix
+5 -4
pkgs/development/compilers/llvm/8/compiler-rt/default.nix
··· 4 5 useLLVM = stdenv.hostPlatform.useLLVM or false; 6 bareMetal = stdenv.hostPlatform.parsed.kernel.name == "none"; 7 inherit (stdenv.hostPlatform) isMusl; 8 9 in 10 11 stdenv.mkDerivation { 12 - pname = "compiler-rt"; 13 inherit version; 14 src = fetch "compiler-rt" "0dqqf8f930l8gag4d9qjgn1n0pj0nbv2anviqqhdi1rkhas8z0hi"; 15 ··· 29 "-DCOMPILER_RT_BUILD_XRAY=OFF" 30 "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF" 31 "-DCOMPILER_RT_BUILD_PROFILE=OFF" 32 - ] ++ lib.optionals (useLLVM || bareMetal) [ 33 "-DCMAKE_C_COMPILER_WORKS=ON" 34 "-DCMAKE_CXX_COMPILER_WORKS=ON" 35 "-DCOMPILER_RT_BAREMETAL_BUILD=ON" 36 "-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}" 37 ] ++ lib.optionals (useLLVM) [ 38 "-DCOMPILER_RT_BUILD_BUILTINS=ON" 39 - "-DCMAKE_C_FLAGS=-nodefaultlibs" 40 #https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program 41 "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY" 42 ] ++ lib.optionals (bareMetal) [ ··· 88 ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o 89 ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/crtendS.o 90 ''; 91 - 92 }
··· 4 5 useLLVM = stdenv.hostPlatform.useLLVM or false; 6 bareMetal = stdenv.hostPlatform.parsed.kernel.name == "none"; 7 + haveLibc = stdenv.cc.libc != null; 8 inherit (stdenv.hostPlatform) isMusl; 9 10 in 11 12 stdenv.mkDerivation { 13 + pname = "compiler-rt" + lib.optionalString (haveLibc) "-libc"; 14 inherit version; 15 src = fetch "compiler-rt" "0dqqf8f930l8gag4d9qjgn1n0pj0nbv2anviqqhdi1rkhas8z0hi"; 16 ··· 30 "-DCOMPILER_RT_BUILD_XRAY=OFF" 31 "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF" 32 "-DCOMPILER_RT_BUILD_PROFILE=OFF" 33 + ] ++ lib.optionals ((useLLVM || bareMetal) && !haveLibc) [ 34 "-DCMAKE_C_COMPILER_WORKS=ON" 35 "-DCMAKE_CXX_COMPILER_WORKS=ON" 36 "-DCOMPILER_RT_BAREMETAL_BUILD=ON" 37 "-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}" 38 + ] ++ lib.optionals (useLLVM && !haveLibc) [ 39 + "-DCMAKE_C_FLAGS=-nodefaultlibs" 40 ] ++ lib.optionals (useLLVM) [ 41 "-DCOMPILER_RT_BUILD_BUILTINS=ON" 42 #https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program 43 "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY" 44 ] ++ lib.optionals (bareMetal) [ ··· 90 ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o 91 ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/crtendS.o 92 ''; 93 }
+41 -17
pkgs/development/compilers/llvm/8/default.nix
··· 1 - { lowPrio, newScope, pkgs, lib, stdenv, cmake, gccForLibs 2 , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith 3 , buildLlvmTools # tools, but from the previous stage, for cross 4 , targetLlvmLibraries # libraries, but from the next stage, for cross ··· 96 # doesn’t support like LLVM. Probably we should move to some other 97 # file. 98 99 - bintools = callPackage ./bintools.nix {}; 100 101 lldClang = wrapCCWith rec { 102 cc = tools.clang-unwrapped; ··· 115 echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags 116 '' + lib.optionalString (!stdenv.targetPlatform.isWasm) '' 117 echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags 118 '' + lib.optionalString stdenv.targetPlatform.isWasm '' 119 echo "-fno-exceptions" >> $out/nix-support/cc-cflags 120 '' + mkExtraBuildCommands cc; ··· 123 lldClangNoLibcxx = wrapCCWith rec { 124 cc = tools.clang-unwrapped; 125 libcxx = null; 126 - bintools = wrapBintoolsWith { 127 - inherit (tools) bintools; 128 - }; 129 extraPackages = [ 130 targetLlvmLibraries.compiler-rt 131 ]; ··· 139 lldClangNoLibc = wrapCCWith rec { 140 cc = tools.clang-unwrapped; 141 libcxx = null; 142 - bintools = wrapBintoolsWith { 143 - inherit (tools) bintools; 144 - libc = null; 145 - }; 146 extraPackages = [ 147 targetLlvmLibraries.compiler-rt 148 ]; ··· 155 lldClangNoCompilerRt = wrapCCWith rec { 156 cc = tools.clang-unwrapped; 157 libcxx = null; 158 - bintools = wrapBintoolsWith { 159 - inherit (tools) bintools; 160 - libc = null; 161 - }; 162 extraPackages = [ ]; 163 extraBuildCommands = '' 164 echo "-nostartfiles" >> $out/nix-support/cc-cflags 165 '' + mkExtraBuildCommands0 cc; 166 }; 167 168 }); 169 170 libraries = lib.makeExtensible (libraries: let 171 callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; }); 172 in { 173 174 - compiler-rt = callPackage ./compiler-rt ({} // 175 - (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { 176 - stdenv = overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt; 177 - })); 178 179 stdenv = overrideCC stdenv buildLlvmTools.clang; 180
··· 1 + { lowPrio, newScope, pkgs, lib, stdenv, cmake 2 + , gccForLibs, preLibcCrossHeaders 3 , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith 4 , buildLlvmTools # tools, but from the previous stage, for cross 5 , targetLlvmLibraries # libraries, but from the next stage, for cross ··· 97 # doesn’t support like LLVM. Probably we should move to some other 98 # file. 99 100 + bintools-unwrapped = callPackage ./bintools {}; 101 + 102 + bintoolsNoLibc = wrapBintoolsWith { 103 + bintools = tools.bintools-unwrapped; 104 + libc = preLibcCrossHeaders; 105 + }; 106 + 107 + bintools = wrapBintoolsWith { 108 + bintools = tools.bintools-unwrapped; 109 + }; 110 111 lldClang = wrapCCWith rec { 112 cc = tools.clang-unwrapped; ··· 125 echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags 126 '' + lib.optionalString (!stdenv.targetPlatform.isWasm) '' 127 echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags 128 + '' + lib.optionalString (stdenv.targetPlatform.isAndroid && stdenv.targetPlatform.useLLVM) '' 129 + echo "-lunwind" >> $out/nix-support/cc-ldflags 130 '' + lib.optionalString stdenv.targetPlatform.isWasm '' 131 echo "-fno-exceptions" >> $out/nix-support/cc-cflags 132 '' + mkExtraBuildCommands cc; ··· 135 lldClangNoLibcxx = wrapCCWith rec { 136 cc = tools.clang-unwrapped; 137 libcxx = null; 138 + inherit (tools) bintools; 139 extraPackages = [ 140 targetLlvmLibraries.compiler-rt 141 ]; ··· 149 lldClangNoLibc = wrapCCWith rec { 150 cc = tools.clang-unwrapped; 151 libcxx = null; 152 + bintools = tools.bintoolsNoLibc; 153 extraPackages = [ 154 targetLlvmLibraries.compiler-rt 155 ]; ··· 162 lldClangNoCompilerRt = wrapCCWith rec { 163 cc = tools.clang-unwrapped; 164 libcxx = null; 165 + bintools = tools.bintoolsNoLibc; 166 extraPackages = [ ]; 167 extraBuildCommands = '' 168 echo "-nostartfiles" >> $out/nix-support/cc-cflags 169 '' + mkExtraBuildCommands0 cc; 170 }; 171 172 + lldClangNoCompilerRtWithLibc = wrapCCWith rec { 173 + cc = tools.clang-unwrapped; 174 + libcxx = null; 175 + inherit (tools) bintools; 176 + extraPackages = [ ]; 177 + extraBuildCommands = mkExtraBuildCommands0 cc; 178 + }; 179 + 180 }); 181 182 libraries = lib.makeExtensible (libraries: let 183 callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; }); 184 in { 185 186 + compiler-rt-libc = callPackage ./compiler-rt { 187 + stdenv = if stdenv.hostPlatform.useLLVM or false 188 + then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRtWithLibc 189 + else stdenv; 190 + }; 191 + 192 + compiler-rt-no-libc = callPackage ./compiler-rt { 193 + stdenv = if stdenv.hostPlatform.useLLVM or false 194 + then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt 195 + else stdenv; 196 + }; 197 + 198 + # N.B. condition is safe because without useLLVM both are the same. 199 + compiler-rt = if stdenv.hostPlatform.isAndroid 200 + then libraries.compiler-rt-libc 201 + else libraries.compiler-rt-no-libc; 202 203 stdenv = overrideCC stdenv buildLlvmTools.clang; 204
pkgs/development/compilers/llvm/9/bintools.nix pkgs/development/compilers/llvm/9/bintools/default.nix
+7 -5
pkgs/development/compilers/llvm/9/compiler-rt/default.nix
··· 4 5 useLLVM = stdenv.hostPlatform.useLLVM or false; 6 bareMetal = stdenv.hostPlatform.parsed.kernel.name == "none"; 7 inherit (stdenv.hostPlatform) isMusl; 8 9 in 10 11 - stdenv.mkDerivation rec { 12 - pname = "compiler-rt"; 13 inherit version; 14 - src = fetch pname "0xwh79g3zggdabxgnd0bphry75asm1qz7mv3hcqihqwqr6aspgy2"; 15 16 nativeBuildInputs = [ cmake python3 llvm.dev ]; 17 buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi; ··· 29 "-DCOMPILER_RT_BUILD_XRAY=OFF" 30 "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF" 31 "-DCOMPILER_RT_BUILD_PROFILE=OFF" 32 - ] ++ lib.optionals (useLLVM || bareMetal) [ 33 "-DCMAKE_C_COMPILER_WORKS=ON" 34 "-DCMAKE_CXX_COMPILER_WORKS=ON" 35 "-DCOMPILER_RT_BAREMETAL_BUILD=ON" 36 "-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}" 37 ] ++ lib.optionals (useLLVM) [ 38 "-DCOMPILER_RT_BUILD_BUILTINS=ON" 39 - "-DCMAKE_C_FLAGS=-nodefaultlibs" 40 #https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program 41 "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY" 42 ] ++ lib.optionals (bareMetal) [
··· 4 5 useLLVM = stdenv.hostPlatform.useLLVM or false; 6 bareMetal = stdenv.hostPlatform.parsed.kernel.name == "none"; 7 + haveLibc = stdenv.cc.libc != null; 8 inherit (stdenv.hostPlatform) isMusl; 9 10 in 11 12 + stdenv.mkDerivation { 13 + pname = "compiler-rt" + lib.optionalString (haveLibc) "-libc"; 14 inherit version; 15 + src = fetch "compiler-rt" "0xwh79g3zggdabxgnd0bphry75asm1qz7mv3hcqihqwqr6aspgy2"; 16 17 nativeBuildInputs = [ cmake python3 llvm.dev ]; 18 buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi; ··· 30 "-DCOMPILER_RT_BUILD_XRAY=OFF" 31 "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF" 32 "-DCOMPILER_RT_BUILD_PROFILE=OFF" 33 + ] ++ lib.optionals ((useLLVM || bareMetal) && !haveLibc) [ 34 "-DCMAKE_C_COMPILER_WORKS=ON" 35 "-DCMAKE_CXX_COMPILER_WORKS=ON" 36 "-DCOMPILER_RT_BAREMETAL_BUILD=ON" 37 "-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}" 38 + ] ++ lib.optionals (useLLVM && !haveLibc) [ 39 + "-DCMAKE_C_FLAGS=-nodefaultlibs" 40 ] ++ lib.optionals (useLLVM) [ 41 "-DCOMPILER_RT_BUILD_BUILTINS=ON" 42 #https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program 43 "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY" 44 ] ++ lib.optionals (bareMetal) [
+41 -17
pkgs/development/compilers/llvm/9/default.nix
··· 1 - { lowPrio, newScope, pkgs, lib, stdenv, cmake, gccForLibs 2 , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith 3 , buildLlvmTools # tools, but from the previous stage, for cross 4 , targetLlvmLibraries # libraries, but from the next stage, for cross ··· 96 # doesn’t support like LLVM. Probably we should move to some other 97 # file. 98 99 - bintools = callPackage ./bintools.nix {}; 100 101 lldClang = wrapCCWith rec { 102 cc = tools.clang-unwrapped; ··· 115 echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags 116 '' + lib.optionalString (!stdenv.targetPlatform.isWasm) '' 117 echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags 118 '' + lib.optionalString stdenv.targetPlatform.isWasm '' 119 echo "-fno-exceptions" >> $out/nix-support/cc-cflags 120 '' + mkExtraBuildCommands cc; ··· 123 lldClangNoLibcxx = wrapCCWith rec { 124 cc = tools.clang-unwrapped; 125 libcxx = null; 126 - bintools = wrapBintoolsWith { 127 - inherit (tools) bintools; 128 - }; 129 extraPackages = [ 130 targetLlvmLibraries.compiler-rt 131 ]; ··· 139 lldClangNoLibc = wrapCCWith rec { 140 cc = tools.clang-unwrapped; 141 libcxx = null; 142 - bintools = wrapBintoolsWith { 143 - inherit (tools) bintools; 144 - libc = null; 145 - }; 146 extraPackages = [ 147 targetLlvmLibraries.compiler-rt 148 ]; ··· 155 lldClangNoCompilerRt = wrapCCWith rec { 156 cc = tools.clang-unwrapped; 157 libcxx = null; 158 - bintools = wrapBintoolsWith { 159 - inherit (tools) bintools; 160 - libc = null; 161 - }; 162 extraPackages = [ ]; 163 extraBuildCommands = '' 164 echo "-nostartfiles" >> $out/nix-support/cc-cflags 165 '' + mkExtraBuildCommands0 cc; 166 }; 167 168 }); 169 170 libraries = lib.makeExtensible (libraries: let 171 callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; }); 172 in { 173 174 - compiler-rt = callPackage ./compiler-rt ({} // 175 - (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) { 176 - stdenv = overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt; 177 - })); 178 179 stdenv = overrideCC stdenv buildLlvmTools.clang; 180
··· 1 + { lowPrio, newScope, pkgs, lib, stdenv, cmake 2 + , gccForLibs, preLibcCrossHeaders 3 , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith 4 , buildLlvmTools # tools, but from the previous stage, for cross 5 , targetLlvmLibraries # libraries, but from the next stage, for cross ··· 97 # doesn’t support like LLVM. Probably we should move to some other 98 # file. 99 100 + bintools-unwrapped = callPackage ./bintools {}; 101 + 102 + bintoolsNoLibc = wrapBintoolsWith { 103 + bintools = tools.bintools-unwrapped; 104 + libc = preLibcCrossHeaders; 105 + }; 106 + 107 + bintools = wrapBintoolsWith { 108 + bintools = tools.bintools-unwrapped; 109 + }; 110 111 lldClang = wrapCCWith rec { 112 cc = tools.clang-unwrapped; ··· 125 echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags 126 '' + lib.optionalString (!stdenv.targetPlatform.isWasm) '' 127 echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags 128 + '' + lib.optionalString (stdenv.targetPlatform.isAndroid && stdenv.targetPlatform.useLLVM) '' 129 + echo "-lunwind" >> $out/nix-support/cc-ldflags 130 '' + lib.optionalString stdenv.targetPlatform.isWasm '' 131 echo "-fno-exceptions" >> $out/nix-support/cc-cflags 132 '' + mkExtraBuildCommands cc; ··· 135 lldClangNoLibcxx = wrapCCWith rec { 136 cc = tools.clang-unwrapped; 137 libcxx = null; 138 + inherit (tools) bintools; 139 extraPackages = [ 140 targetLlvmLibraries.compiler-rt 141 ]; ··· 149 lldClangNoLibc = wrapCCWith rec { 150 cc = tools.clang-unwrapped; 151 libcxx = null; 152 + bintools = tools.bintoolsNoLibc; 153 extraPackages = [ 154 targetLlvmLibraries.compiler-rt 155 ]; ··· 162 lldClangNoCompilerRt = wrapCCWith rec { 163 cc = tools.clang-unwrapped; 164 libcxx = null; 165 + bintools = tools.bintoolsNoLibc; 166 extraPackages = [ ]; 167 extraBuildCommands = '' 168 echo "-nostartfiles" >> $out/nix-support/cc-cflags 169 '' + mkExtraBuildCommands0 cc; 170 }; 171 172 + lldClangNoCompilerRtWithLibc = wrapCCWith rec { 173 + cc = tools.clang-unwrapped; 174 + libcxx = null; 175 + inherit (tools) bintools; 176 + extraPackages = [ ]; 177 + extraBuildCommands = mkExtraBuildCommands0 cc; 178 + }; 179 + 180 }); 181 182 libraries = lib.makeExtensible (libraries: let 183 callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; }); 184 in { 185 186 + compiler-rt-libc = callPackage ./compiler-rt { 187 + stdenv = if stdenv.hostPlatform.useLLVM or false 188 + then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRtWithLibc 189 + else stdenv; 190 + }; 191 + 192 + compiler-rt-no-libc = callPackage ./compiler-rt { 193 + stdenv = if stdenv.hostPlatform.useLLVM or false 194 + then overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt 195 + else stdenv; 196 + }; 197 + 198 + # N.B. condition is safe because without useLLVM both are the same. 199 + compiler-rt = if stdenv.hostPlatform.isAndroid 200 + then libraries.compiler-rt-libc 201 + else libraries.compiler-rt-no-libc; 202 203 stdenv = overrideCC stdenv buildLlvmTools.clang; 204
+34 -29
pkgs/top-level/all-packages.nix
··· 10345 gerbil-support = callPackage ../development/compilers/gerbil/gerbil-support.nix { }; 10346 gerbilPackages-unstable = gerbil-support.gerbilPackages-unstable; # NB: don't recurseIntoAttrs for (unstable!) libraries 10347 10348 - gccFun = callPackage (if (with stdenv.targetPlatform; isVc4 || libc == "relibc") 10349 - then ../development/compilers/gcc/6 10350 - else ../development/compilers/gcc/10); 10351 - gcc = if (with stdenv.targetPlatform; isVc4 || libc == "relibc") 10352 - then gcc6 else 10353 - # aarch64-darwin doesn't support earlier gcc 10354 - if (stdenv.targetPlatform.isAarch64 && stdenv.isDarwin) then gcc11 10355 - else if stdenv.targetPlatform.isAarch64 then gcc9 else gcc10; 10356 gcc-unwrapped = gcc.cc; 10357 10358 wrapNonDeterministicGcc = stdenv: ccWrapper: ··· 10430 10431 crossLibcStdenv = 10432 if stdenv.hostPlatform.useLLVM or false 10433 - then overrideCC stdenv buildPackages.llvmPackages_8.lldClangNoLibc 10434 else gccCrossLibcStdenv; 10435 10436 # The GCC used to build libc for the target platform. Normal gccs will be ··· 11175 llvm_6 = llvmPackages_6.llvm; 11176 llvm_5 = llvmPackages_5.llvm; 11177 11178 - llvmPackages = with targetPlatform; 11179 - if isDarwin then 11180 - llvmPackages_7 11181 - else if isFreeBSD then 11182 - llvmPackages_7 11183 - else if isAndroid then 11184 - llvmPackages_12 11185 - else if isLinux then 11186 - llvmPackages_7 11187 - else if isWasm then 11188 - llvmPackages_8 11189 - else 11190 - llvmPackages_latest; 11191 11192 llvmPackages_5 = recurseIntoAttrs (callPackage ../development/compilers/llvm/5 { 11193 inherit (stdenvAdapters) overrideCC; ··· 12602 }); 12603 binutilsNoLibc = wrapBintoolsWith { 12604 bintools = binutils-unwrapped; 12605 - libc = 12606 - /**/ if stdenv.targetPlatform.libc == "msvcrt" then targetPackages.windows.mingw_w64_headers 12607 - else if stdenv.targetPlatform.libc == "libSystem" then darwin.xcode 12608 - else if stdenv.targetPlatform.libc == "nblibc" then targetPackages.netbsdCross.headers 12609 - else null; 12610 }; 12611 12612 bison = callPackage ../development/tools/parsing/bison { }; ··· 14741 stdenv = crossLibcStdenv; 14742 }; 14743 14744 # We can choose: 14745 libcCrossChooser = name: 14746 # libc is hackily often used from the previous stage. This `or` ··· 14755 else if name == "newlib" then targetPackages.newlibCross or newlibCross 14756 else if name == "musl" then targetPackages.muslCross or muslCross 14757 else if name == "msvcrt" then targetPackages.windows.mingw_w64 or windows.mingw_w64 14758 - else if stdenv.targetPlatform.useiOSPrebuilt then targetPackages.darwin.iosSdkPkgs.libraries or darwin.iosSdkPkgs.libraries 14759 - else if name == "libSystem" then targetPackages.darwin.xcode 14760 else if name == "nblibc" then targetPackages.netbsdCross.libc or netbsdCross.libc 14761 else if name == "wasilibc" then targetPackages.wasilibc or wasilibc 14762 else if name == "relibc" then targetPackages.relibc or relibc
··· 10345 gerbil-support = callPackage ../development/compilers/gerbil/gerbil-support.nix { }; 10346 gerbilPackages-unstable = gerbil-support.gerbilPackages-unstable; # NB: don't recurseIntoAttrs for (unstable!) libraries 10347 10348 + inherit (let 10349 + num = 10350 + if (with stdenv.targetPlatform; isVc4 || libc == "relibc") then 6 10351 + else if (stdenv.targetPlatform.isAarch64 && stdenv.isDarwin) then 11 10352 + else if stdenv.targetPlatform.isAarch64 then 9 10353 + else 10; 10354 + numS = toString num; 10355 + in { 10356 + gcc = pkgs.${"gcc${numS}"}; 10357 + gccFun = callPackage (../development/compilers/gcc + "/${numS}"); 10358 + }) gcc gccFun; 10359 gcc-unwrapped = gcc.cc; 10360 10361 wrapNonDeterministicGcc = stdenv: ccWrapper: ··· 10433 10434 crossLibcStdenv = 10435 if stdenv.hostPlatform.useLLVM or false 10436 + then overrideCC stdenv buildPackages.llvmPackages.lldClangNoLibc 10437 else gccCrossLibcStdenv; 10438 10439 # The GCC used to build libc for the target platform. Normal gccs will be ··· 11178 llvm_6 = llvmPackages_6.llvm; 11179 llvm_5 = llvmPackages_5.llvm; 11180 11181 + llvmPackages = let 11182 + choose = platform: 11183 + /**/ if platform.isDarwin then "7" 11184 + else if platform.isFreeBSD then "7" 11185 + else if platform.isAndroid then "12" 11186 + else if platform.isLinux then "7" 11187 + else if platform.isWasm then "8" 11188 + else "latest"; 11189 + minSupported = lib.min (choose stdenv.hostPlatform) (choose stdenv.targetPlatform); 11190 + in pkgs.${"llvmPackages_${minSupported}"}; 11191 11192 llvmPackages_5 = recurseIntoAttrs (callPackage ../development/compilers/llvm/5 { 11193 inherit (stdenvAdapters) overrideCC; ··· 12602 }); 12603 binutilsNoLibc = wrapBintoolsWith { 12604 bintools = binutils-unwrapped; 12605 + libc = preLibcCrossHeaders; 12606 }; 12607 12608 bison = callPackage ../development/tools/parsing/bison { }; ··· 14737 stdenv = crossLibcStdenv; 14738 }; 14739 14740 + # These are used when buiding compiler-rt / libgcc, prior to building libc. 14741 + preLibcCrossHeaders = let 14742 + inherit (stdenv.targetPlatform) libc; 14743 + in if libc == "msvcrt" then targetPackages.windows.mingw_w64_headers 14744 + else if libc == "nblibc" then targetPackages.netbsdCross.headers 14745 + else null; 14746 + 14747 # We can choose: 14748 libcCrossChooser = name: 14749 # libc is hackily often used from the previous stage. This `or` ··· 14758 else if name == "newlib" then targetPackages.newlibCross or newlibCross 14759 else if name == "musl" then targetPackages.muslCross or muslCross 14760 else if name == "msvcrt" then targetPackages.windows.mingw_w64 or windows.mingw_w64 14761 + else if name == "libSystem" then 14762 + if stdenv.targetPlatform.useiOSPrebuilt 14763 + then targetPackages.darwin.iosSdkPkgs.libraries or darwin.iosSdkPkgs.libraries 14764 + else throw "don't yet have a `targetPackages.darwin.LibsystemCross`" 14765 else if name == "nblibc" then targetPackages.netbsdCross.libc or netbsdCross.libc 14766 else if name == "wasilibc" then targetPackages.wasilibc or wasilibc 14767 else if name == "relibc" then targetPackages.relibc or relibc
+2 -1
pkgs/top-level/darwin-packages.nix
··· 2 , buildPackages, pkgs, targetPackages 3 , pkgsBuildBuild, pkgsBuildHost, pkgsBuildTarget, pkgsHostHost, pkgsTargetTarget 4 , stdenv, splicePackages, newScope 5 }: 6 7 let ··· 52 }; 53 54 binutilsNoLibc = pkgs.wrapBintoolsWith { 55 - libc = null; 56 bintools = self.binutils-unwrapped; 57 }; 58
··· 2 , buildPackages, pkgs, targetPackages 3 , pkgsBuildBuild, pkgsBuildHost, pkgsBuildTarget, pkgsHostHost, pkgsTargetTarget 4 , stdenv, splicePackages, newScope 5 + , preLibcCrossHeaders 6 }: 7 8 let ··· 53 }; 54 55 binutilsNoLibc = pkgs.wrapBintoolsWith { 56 + libc = preLibcCrossHeaders; 57 bintools = self.binutils-unwrapped; 58 }; 59