diff options
author | Alyssa Ross <hi@alyssa.is> | 2020-05-13 00:32:00 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2020-05-13 00:41:26 +0000 |
commit | 439d80fbdcdf6245444e99e3764f233122c86358 (patch) | |
tree | bd769aabc0c8e46d3fdf8f0cc80297463e7d0dba /pkgs/development/compilers/llvm | |
parent | cc2d9c385f776f38fa37656b8440b5c4a460e9a7 (diff) | |
parent | 9f5e9ef4b71a2a1ea8efef56f5876cdc846d6387 (diff) | |
download | nixpkgs-439d80fbdcdf6245444e99e3764f233122c86358.tar nixpkgs-439d80fbdcdf6245444e99e3764f233122c86358.tar.gz nixpkgs-439d80fbdcdf6245444e99e3764f233122c86358.tar.bz2 nixpkgs-439d80fbdcdf6245444e99e3764f233122c86358.tar.lz nixpkgs-439d80fbdcdf6245444e99e3764f233122c86358.tar.xz nixpkgs-439d80fbdcdf6245444e99e3764f233122c86358.tar.zst nixpkgs-439d80fbdcdf6245444e99e3764f233122c86358.zip |
Merge remote-tracking branch 'nixpkgs/master' into master
Diffstat (limited to 'pkgs/development/compilers/llvm')
60 files changed, 457 insertions, 95 deletions
diff --git a/pkgs/development/compilers/llvm/10/clang/default.nix b/pkgs/development/compilers/llvm/10/clang/default.nix index 51c0cd9ccc3..10026ca4eb1 100644 --- a/pkgs/development/compilers/llvm/10/clang/default.nix +++ b/pkgs/development/compilers/llvm/10/clang/default.nix @@ -95,7 +95,7 @@ let meta = { description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler"; - homepage = "http://llvm.org/"; + homepage = "https://llvm.org/"; license = stdenv.lib.licenses.ncsa; platforms = stdenv.lib.platforms.all; }; diff --git a/pkgs/development/compilers/llvm/10/compiler-rt-armv7l.patch b/pkgs/development/compilers/llvm/10/compiler-rt-armv7l.patch new file mode 100644 index 00000000000..120cfe6feb2 --- /dev/null +++ b/pkgs/development/compilers/llvm/10/compiler-rt-armv7l.patch @@ -0,0 +1,32 @@ +diff -ur compiler-rt-10.0.0.src/cmake/builtin-config-ix.cmake compiler-rt-10.0.0.src-patched/cmake/builtin-config-ix.cmake +--- compiler-rt-10.0.0.src/cmake/builtin-config-ix.cmake 2020-03-24 00:01:02.000000000 +0900 ++++ compiler-rt-10.0.0.src-patched/cmake/builtin-config-ix.cmake 2020-05-10 03:42:00.883450706 +0900 +@@ -24,7 +24,7 @@ + + + set(ARM64 aarch64) +-set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k) ++set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k armv7l) + set(HEXAGON hexagon) + set(X86 i386) + set(X86_64 x86_64) +diff -ur compiler-rt-10.0.0.src/lib/builtins/CMakeLists.txt compiler-rt-10.0.0.src-patched/lib/builtins/CMakeLists.txt +--- compiler-rt-10.0.0.src/lib/builtins/CMakeLists.txt 2020-03-24 00:01:02.000000000 +0900 ++++ compiler-rt-10.0.0.src-patched/lib/builtins/CMakeLists.txt 2020-05-10 03:44:49.468579650 +0900 +@@ -474,6 +474,7 @@ + set(armv7_SOURCES ${arm_SOURCES}) + set(armv7s_SOURCES ${arm_SOURCES}) + set(armv7k_SOURCES ${arm_SOURCES}) ++set(armv7l_SOURCES ${arm_SOURCES}) + set(arm64_SOURCES ${aarch64_SOURCES}) + + # macho_embedded archs +@@ -595,7 +596,7 @@ + foreach (arch ${BUILTIN_SUPPORTED_ARCH}) + if (CAN_TARGET_${arch}) + # For ARM archs, exclude any VFP builtins if VFP is not supported +- if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7m|armv7em)$") ++ if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7l|armv7m|armv7em)$") + string(REPLACE ";" " " _TARGET_${arch}_CFLAGS "${TARGET_${arch}_CFLAGS}") + check_compile_definition(__VFP_FP__ "${CMAKE_C_FLAGS} ${_TARGET_${arch}_CFLAGS}" COMPILER_RT_HAS_${arch}_VFP) + if(NOT COMPILER_RT_HAS_${arch}_VFP) diff --git a/pkgs/development/compilers/llvm/10/compiler-rt.nix b/pkgs/development/compilers/llvm/10/compiler-rt.nix index 02bbc17c967..68f64ef4256 100644 --- a/pkgs/development/compilers/llvm/10/compiler-rt.nix +++ b/pkgs/development/compilers/llvm/10/compiler-rt.nix @@ -1,4 +1,13 @@ { stdenv, version, fetch, cmake, python3, llvm, libcxxabi }: + +let + + useLLVM = stdenv.hostPlatform.useLLVM or false; + bareMetal = stdenv.hostPlatform.parsed.kernel.name == "none"; + inherit (stdenv.hostPlatform) isMusl; + +in + stdenv.mkDerivation rec { pname = "compiler-rt"; inherit version; @@ -11,27 +20,26 @@ stdenv.mkDerivation rec { "-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0" ]; - cmakeFlags = stdenv.lib.optionals (stdenv.hostPlatform.useLLVM or false) [ + cmakeFlags = [ "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}" "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}" - "-DCMAKE_C_FLAGS=-nodefaultlibs" - "-DCMAKE_CXX_COMPILER_WORKS=ON" + ] ++ stdenv.lib.optionals (useLLVM || bareMetal || isMusl) [ "-DCOMPILER_RT_BUILD_SANITIZERS=OFF" "-DCOMPILER_RT_BUILD_XRAY=OFF" "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF" "-DCOMPILER_RT_BUILD_PROFILE=OFF" + ] ++ stdenv.lib.optionals (useLLVM || bareMetal) [ + "-DCMAKE_C_COMPILER_WORKS=ON" + "-DCMAKE_CXX_COMPILER_WORKS=ON" "-DCOMPILER_RT_BAREMETAL_BUILD=ON" + "-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}" + ] ++ stdenv.lib.optionals (useLLVM) [ + "-DCOMPILER_RT_BUILD_BUILTINS=ON" + "-DCMAKE_C_FLAGS=-nodefaultlibs" #https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY" - "-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}" - ] ++ stdenv.lib.optionals stdenv.hostPlatform.isMusl [ - "-DCOMPILER_RT_BUILD_SANITIZERS=OFF" - "-DCOMPILER_RT_BUILD_XRAY=OFF" - "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF" - "-DCOMPILER_RT_BUILD_PROFILE=OFF" - ] ++ stdenv.lib.optionals (stdenv.hostPlatform.parsed.kernel.name == "none") [ - "-DCOMPILER_RT_BAREMETAL_BUILD=ON" + ] ++ stdenv.lib.optionals (bareMetal) [ "-DCOMPILER_RT_OS_DIR=baremetal" ]; @@ -40,17 +48,22 @@ stdenv.mkDerivation rec { patches = [ ./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory ./find-darwin-sdk-version.patch # don't test for macOS being >= 10.15 - ];# ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch + ]# ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch + ++ stdenv.lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch; + # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra # can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd # get no binary cache for the entire platform. If you really find yourself wanting the TSAN, make this controllable by # a flag and turn the flag off during the stdenv build. - postPatch = stdenv.lib.optionalString stdenv.isDarwin '' + postPatch = '' + substituteInPlace cmake/builtin-config-ix.cmake \ + --replace 'set(X86 i386)' 'set(X86 i386 i486 i586 i686)' + '' + stdenv.lib.optionalString stdenv.isDarwin '' substituteInPlace cmake/config-ix.cmake \ --replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)' - '' + stdenv.lib.optionalString (stdenv.hostPlatform.useLLVM or false) '' + '' + stdenv.lib.optionalString (useLLVM) '' substituteInPlace lib/builtins/int_util.c \ --replace "#include <stdlib.h>" "" substituteInPlace lib/builtins/clear_cache.c \ @@ -62,7 +75,7 @@ stdenv.mkDerivation rec { # Hack around weird upsream RPATH bug postInstall = stdenv.lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) '' ln -s "$out/lib"/*/* "$out/lib" - '' + stdenv.lib.optionalString (stdenv.hostPlatform.useLLVM or false) '' + '' + stdenv.lib.optionalString (useLLVM) '' ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/crtbegin.o ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/crtend.o ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o diff --git a/pkgs/development/compilers/llvm/10/default.nix b/pkgs/development/compilers/llvm/10/default.nix index 462f246b89d..4181ab29bd7 100644 --- a/pkgs/development/compilers/llvm/10/default.nix +++ b/pkgs/development/compilers/llvm/10/default.nix @@ -1,4 +1,4 @@ -{ lowPrio, newScope, pkgs, stdenv, cmake, libstdcxxHook +{ lowPrio, newScope, pkgs, stdenv, cmake, gcc, libstdcxxHook , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith , buildLlvmTools # tools, but from the previous stage, for cross , targetLlvmLibraries # libraries, but from the next stage, for cross @@ -7,6 +7,7 @@ let release_version = "10.0.0"; version = release_version; # differentiating these (variables) is important for rc's + targetConfig = stdenv.targetPlatform.config; fetch = name: sha256: fetchurl { url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-${release_version}/${name}-${version}.src.tar.xz"; @@ -60,7 +61,12 @@ let libstdcxxHook targetLlvmLibraries.compiler-rt ]; - extraBuildCommands = mkExtraBuildCommands cc; + extraBuildCommands = '' + echo "-target ${targetConfig}" >> $out/nix-support/cc-cflags + echo "-B${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-cflags + echo "-L${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-ldflags + echo "-L${gcc.cc.lib}/${targetConfig}/lib" >> $out/nix-support/cc-ldflags + '' + mkExtraBuildCommands cc; }; libcxxClang = wrapCCWith rec { diff --git a/pkgs/development/compilers/llvm/10/libc++/default.nix b/pkgs/development/compilers/llvm/10/libc++/default.nix index f7064bdc452..ed76ce77a8b 100644 --- a/pkgs/development/compilers/llvm/10/libc++/default.nix +++ b/pkgs/development/compilers/llvm/10/libc++/default.nix @@ -47,7 +47,7 @@ stdenv.mkDerivation { ]; meta = { - homepage = "http://libcxx.llvm.org/"; + homepage = "https://libcxx.llvm.org/"; description = "A new implementation of the C++ standard library, targeting C++11"; license = with stdenv.lib.licenses; [ ncsa mit ]; platforms = stdenv.lib.platforms.all; diff --git a/pkgs/development/compilers/llvm/10/libc++abi.nix b/pkgs/development/compilers/llvm/10/libc++abi.nix index b3b90687a2a..ab45f27d24f 100644 --- a/pkgs/development/compilers/llvm/10/libc++abi.nix +++ b/pkgs/development/compilers/llvm/10/libc++abi.nix @@ -40,7 +40,7 @@ stdenv.mkDerivation { # this should be done in CMake, but having trouble figuring out # the magic combination of necessary CMake variables # if you fancy a try, take a look at - # http://www.cmake.org/Wiki/CMake_RPATH_handling + # https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling install_name_tool -id $out/$file $file done make install @@ -58,7 +58,7 @@ stdenv.mkDerivation { ''; meta = { - homepage = "http://libcxxabi.llvm.org/"; + homepage = "https://libcxxabi.llvm.org/"; description = "A new implementation of low level support for a standard C++ library"; license = with stdenv.lib.licenses; [ ncsa mit ]; maintainers = with stdenv.lib.maintainers; [ vlstill ]; diff --git a/pkgs/development/compilers/llvm/10/lld.nix b/pkgs/development/compilers/llvm/10/lld.nix index 8c66697c67e..6a0032de2ac 100644 --- a/pkgs/development/compilers/llvm/10/lld.nix +++ b/pkgs/development/compilers/llvm/10/lld.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation rec { meta = { description = "The LLVM Linker"; - homepage = "http://lld.llvm.org/"; + homepage = "https://lld.llvm.org/"; license = stdenv.lib.licenses.ncsa; platforms = stdenv.lib.platforms.all; }; diff --git a/pkgs/development/compilers/llvm/10/lldb.nix b/pkgs/development/compilers/llvm/10/lldb.nix index a4816a635e4..90716f67f83 100644 --- a/pkgs/development/compilers/llvm/10/lldb.nix +++ b/pkgs/development/compilers/llvm/10/lldb.nix @@ -71,7 +71,7 @@ stdenv.mkDerivation (rec { meta = with stdenv.lib; { description = "A next-generation high-performance debugger"; - homepage = "http://lldb.llvm.org"; + homepage = "https://lldb.llvm.org"; license = licenses.ncsa; platforms = platforms.all; }; diff --git a/pkgs/development/compilers/llvm/10/llvm.nix b/pkgs/development/compilers/llvm/10/llvm.nix index f36f58d8203..dd0728b40c9 100644 --- a/pkgs/development/compilers/llvm/10/llvm.nix +++ b/pkgs/development/compilers/llvm/10/llvm.nix @@ -16,6 +16,7 @@ , enableSharedLibraries ? true , enablePFM ? !(stdenv.isDarwin || stdenv.isAarch64 # broken for Ampere eMAG 8180 (c2.large.arm on Packet) #56245 + || stdenv.isAarch32 # broken for the armv7l builder ) , enablePolly ? true }: @@ -159,9 +160,10 @@ in stdenv.mkDerivation (rec { enableParallelBuilding = true; + requiredSystemFeatures = [ "big-parallel" ]; meta = { description = "Collection of modular and reusable compiler and toolchain technologies"; - homepage = "http://llvm.org/"; + homepage = "https://llvm.org/"; license = stdenv.lib.licenses.ncsa; maintainers = with stdenv.lib.maintainers; [ lovek323 raskin dtzWill ]; platforms = stdenv.lib.platforms.all; diff --git a/pkgs/development/compilers/llvm/10/openmp.nix b/pkgs/development/compilers/llvm/10/openmp.nix index 940f53f4cf7..624c99bc868 100644 --- a/pkgs/development/compilers/llvm/10/openmp.nix +++ b/pkgs/development/compilers/llvm/10/openmp.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation rec { meta = { description = "Components required to build an executable OpenMP program"; - homepage = "http://openmp.llvm.org/"; + homepage = "https://openmp.llvm.org/"; license = stdenv.lib.licenses.mit; platforms = stdenv.lib.platforms.all; }; diff --git a/pkgs/development/compilers/llvm/5/clang/default.nix b/pkgs/development/compilers/llvm/5/clang/default.nix index 0317271f003..1016398992f 100644 --- a/pkgs/development/compilers/llvm/5/clang/default.nix +++ b/pkgs/development/compilers/llvm/5/clang/default.nix @@ -83,7 +83,7 @@ let meta = { description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler"; - homepage = "http://llvm.org/"; + homepage = "https://llvm.org/"; license = stdenv.lib.licenses.ncsa; platforms = stdenv.lib.platforms.all; }; diff --git a/pkgs/development/compilers/llvm/5/compiler-rt-armv7l.patch b/pkgs/development/compilers/llvm/5/compiler-rt-armv7l.patch new file mode 100644 index 00000000000..77bf2640c47 --- /dev/null +++ b/pkgs/development/compilers/llvm/5/compiler-rt-armv7l.patch @@ -0,0 +1,23 @@ +diff -ur compiler-rt-5.0.2.src/cmake/builtin-config-ix.cmake compiler-rt-5.0.2.src-patched/cmake/builtin-config-ix.cmake +--- compiler-rt-5.0.2.src/cmake/builtin-config-ix.cmake 2017-05-25 00:53:24.000000000 +0900 ++++ compiler-rt-5.0.2.src-patched/cmake/builtin-config-ix.cmake 2020-05-10 03:24:24.937433155 +0900 +@@ -24,7 +24,7 @@ + + + set(ARM64 aarch64) +-set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k) ++set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k armv7l) + set(X86 i386 i686) + set(X86_64 x86_64) + set(MIPS32 mips mipsel) +diff -ur compiler-rt-5.0.2.src/lib/builtins/CMakeLists.txt compiler-rt-5.0.2.src-patched/lib/builtins/CMakeLists.txt +--- compiler-rt-5.0.2.src/lib/builtins/CMakeLists.txt 2017-07-13 04:33:30.000000000 +0900 ++++ compiler-rt-5.0.2.src-patched/lib/builtins/CMakeLists.txt 2020-05-10 03:24:45.945075423 +0900 +@@ -444,6 +444,7 @@ + set(armv7_SOURCES ${arm_SOURCES}) + set(armv7s_SOURCES ${arm_SOURCES}) + set(armv7k_SOURCES ${arm_SOURCES}) ++set(armv7l_SOURCES ${arm_SOURCES}) + set(arm64_SOURCES ${aarch64_SOURCES}) + + # macho_embedded archs diff --git a/pkgs/development/compilers/llvm/5/compiler-rt.nix b/pkgs/development/compilers/llvm/5/compiler-rt.nix index 4740180eb29..624034b5228 100644 --- a/pkgs/development/compilers/llvm/5/compiler-rt.nix +++ b/pkgs/development/compilers/llvm/5/compiler-rt.nix @@ -1,5 +1,13 @@ { stdenv, version, fetch, cmake, python3, llvm, libcxxabi }: -with stdenv.lib; + +let + + useLLVM = stdenv.hostPlatform.useLLVM or false; + bareMetal = stdenv.hostPlatform.parsed.kernel.name == "none"; + inherit (stdenv.hostPlatform) isMusl; + +in + stdenv.mkDerivation { pname = "compiler-rt"; inherit version; @@ -8,16 +16,40 @@ stdenv.mkDerivation { nativeBuildInputs = [ cmake python3 llvm ]; buildInputs = stdenv.lib.optional stdenv.hostPlatform.isDarwin libcxxabi; - configureFlags = [ + NIX_CFLAGS_COMPILE = [ + "-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0" + ]; + + cmakeFlags = [ "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" + "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}" + "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}" + ] ++ stdenv.lib.optionals (useLLVM || bareMetal || isMusl) [ + "-DCOMPILER_RT_BUILD_SANITIZERS=OFF" + "-DCOMPILER_RT_BUILD_XRAY=OFF" + "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF" + "-DCOMPILER_RT_BUILD_PROFILE=OFF" + ] ++ stdenv.lib.optionals (useLLVM || bareMetal) [ + "-DCMAKE_C_COMPILER_WORKS=ON" + "-DCMAKE_CXX_COMPILER_WORKS=ON" + "-DCOMPILER_RT_BAREMETAL_BUILD=ON" + "-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}" + ] ++ stdenv.lib.optionals (useLLVM) [ + "-DCOMPILER_RT_BUILD_BUILTINS=ON" + "-DCMAKE_C_FLAGS=-nodefaultlibs" + #https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program + "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY" + ] ++ stdenv.lib.optionals (bareMetal) [ + "-DCOMPILER_RT_OS_DIR=baremetal" ]; outputs = [ "out" "dev" ]; patches = [ ./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory - ] ++ optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch - ++ optional (stdenv.hostPlatform.libc == "glibc") ./compiler-rt-sys-ustat.patch; + ] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch + ++ stdenv.lib.optional (stdenv.hostPlatform.libc == "glibc") ./compiler-rt-sys-ustat.patch + ++ stdenv.lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch; # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra @@ -27,11 +59,23 @@ stdenv.mkDerivation { postPatch = stdenv.lib.optionalString stdenv.isDarwin '' substituteInPlace cmake/config-ix.cmake \ --replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)' + '' + stdenv.lib.optionalString (useLLVM) '' + substituteInPlace lib/builtins/int_util.c \ + --replace "#include <stdlib.h>" "" + substituteInPlace lib/builtins/clear_cache.c \ + --replace "#include <assert.h>" "" + substituteInPlace lib/builtins/cpu_model.c \ + --replace "#include <assert.h>" "" ''; # Hack around weird upsream RPATH bug - postInstall = stdenv.lib.optionalString stdenv.isDarwin '' + postInstall = stdenv.lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) '' ln -s "$out/lib"/*/* "$out/lib" + '' + stdenv.lib.optionalString (useLLVM) '' + ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/linux/crtbegin.o + ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/linux/crtend.o + ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/linux/crtbeginS.o + ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/linux/crtendS.o ''; enableParallelBuilding = true; diff --git a/pkgs/development/compilers/llvm/5/default.nix b/pkgs/development/compilers/llvm/5/default.nix index 3c1b07e7ca7..e7083a6ed13 100644 --- a/pkgs/development/compilers/llvm/5/default.nix +++ b/pkgs/development/compilers/llvm/5/default.nix @@ -1,4 +1,4 @@ -{ lowPrio, newScope, pkgs, stdenv, cmake, libstdcxxHook +{ lowPrio, newScope, pkgs, stdenv, cmake, gcc, libstdcxxHook , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith , buildLlvmTools # tools, but from the previous stage, for cross , targetLlvmLibraries # libraries, but from the next stage, for cross @@ -7,6 +7,7 @@ let release_version = "5.0.2"; version = release_version; # differentiating these is important for rc's + targetConfig = stdenv.targetPlatform.config; fetch = name: sha256: fetchurl { url = "https://releases.llvm.org/${release_version}/${name}-${version}.src.tar.xz"; @@ -56,7 +57,12 @@ let extraPackages = [ targetLlvmLibraries.compiler-rt ]; - extraBuildCommands = mkExtraBuildCommands cc; + extraBuildCommands = '' + echo "-target ${targetConfig}" >> $out/nix-support/cc-cflags + echo "-B${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-cflags + echo "-L${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-ldflags + echo "-L${gcc.cc.lib}/${targetConfig}/lib" >> $out/nix-support/cc-ldflags + '' + mkExtraBuildCommands cc; }; libcxxClang = wrapCCWith rec { diff --git a/pkgs/development/compilers/llvm/5/libc++/default.nix b/pkgs/development/compilers/llvm/5/libc++/default.nix index 5bd3cde2329..88ad3c29c3e 100644 --- a/pkgs/development/compilers/llvm/5/libc++/default.nix +++ b/pkgs/development/compilers/llvm/5/libc++/default.nix @@ -45,7 +45,7 @@ stdenv.mkDerivation { ]; meta = { - homepage = "http://libcxx.llvm.org/"; + homepage = "https://libcxx.llvm.org/"; description = "A new implementation of the C++ standard library, targeting C++11"; license = with stdenv.lib.licenses; [ ncsa mit ]; platforms = stdenv.lib.platforms.unix; diff --git a/pkgs/development/compilers/llvm/5/libc++abi.nix b/pkgs/development/compilers/llvm/5/libc++abi.nix index e3ffc473c34..96d6e78e01e 100644 --- a/pkgs/development/compilers/llvm/5/libc++abi.nix +++ b/pkgs/development/compilers/llvm/5/libc++abi.nix @@ -25,7 +25,7 @@ stdenv.mkDerivation { # this should be done in CMake, but having trouble figuring out # the magic combination of necessary CMake variables # if you fancy a try, take a look at - # http://www.cmake.org/Wiki/CMake_RPATH_handling + # https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling install_name_tool -id $out/$file $file done make install @@ -42,7 +42,7 @@ stdenv.mkDerivation { ''; meta = { - homepage = "http://libcxxabi.llvm.org/"; + homepage = "https://libcxxabi.llvm.org/"; description = "A new implementation of low level support for a standard C++ library"; license = with stdenv.lib.licenses; [ ncsa mit ]; maintainers = with stdenv.lib.maintainers; [ vlstill ]; diff --git a/pkgs/development/compilers/llvm/5/lld.nix b/pkgs/development/compilers/llvm/5/lld.nix index 7ab02c1d35c..3d9ed6ee663 100644 --- a/pkgs/development/compilers/llvm/5/lld.nix +++ b/pkgs/development/compilers/llvm/5/lld.nix @@ -25,7 +25,7 @@ stdenv.mkDerivation { meta = { description = "The LLVM Linker"; - homepage = "http://lld.llvm.org/"; + homepage = "https://lld.llvm.org/"; license = stdenv.lib.licenses.ncsa; platforms = stdenv.lib.platforms.all; badPlatforms = [ "x86_64-darwin" ]; diff --git a/pkgs/development/compilers/llvm/5/lldb.nix b/pkgs/development/compilers/llvm/5/lldb.nix index 4a0d678cc2a..e0698e1dcf3 100644 --- a/pkgs/development/compilers/llvm/5/lldb.nix +++ b/pkgs/development/compilers/llvm/5/lldb.nix @@ -50,7 +50,7 @@ stdenv.mkDerivation { meta = with stdenv.lib; { description = "A next-generation high-performance debugger"; - homepage = "http://llvm.org/"; + homepage = "https://llvm.org/"; license = licenses.ncsa; platforms = platforms.all; }; diff --git a/pkgs/development/compilers/llvm/5/llvm.nix b/pkgs/development/compilers/llvm/5/llvm.nix index 1bf86115bc2..987e6258527 100644 --- a/pkgs/development/compilers/llvm/5/llvm.nix +++ b/pkgs/development/compilers/llvm/5/llvm.nix @@ -151,7 +151,7 @@ stdenv.mkDerivation ({ requiredSystemFeatures = [ "big-parallel" ]; meta = { description = "Collection of modular and reusable compiler and toolchain technologies"; - homepage = "http://llvm.org/"; + homepage = "https://llvm.org/"; license = stdenv.lib.licenses.ncsa; maintainers = with stdenv.lib.maintainers; [ lovek323 raskin dtzWill ]; platforms = stdenv.lib.platforms.all; diff --git a/pkgs/development/compilers/llvm/5/openmp.nix b/pkgs/development/compilers/llvm/5/openmp.nix index 34e6bc64bfd..da328de24d1 100644 --- a/pkgs/development/compilers/llvm/5/openmp.nix +++ b/pkgs/development/compilers/llvm/5/openmp.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation { meta = { description = "Components required to build an executable OpenMP program"; - homepage = "http://openmp.llvm.org/"; + homepage = "https://openmp.llvm.org/"; license = stdenv.lib.licenses.mit; platforms = stdenv.lib.platforms.all; }; diff --git a/pkgs/development/compilers/llvm/6/clang/default.nix b/pkgs/development/compilers/llvm/6/clang/default.nix index 7139e15d1dc..e2f7166354a 100644 --- a/pkgs/development/compilers/llvm/6/clang/default.nix +++ b/pkgs/development/compilers/llvm/6/clang/default.nix @@ -83,7 +83,7 @@ let meta = { description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler"; - homepage = "http://llvm.org/"; + homepage = "https://llvm.org/"; license = stdenv.lib.licenses.ncsa; platforms = stdenv.lib.platforms.all; }; diff --git a/pkgs/development/compilers/llvm/6/compiler-rt-armv7l.patch b/pkgs/development/compilers/llvm/6/compiler-rt-armv7l.patch new file mode 100644 index 00000000000..ca2ed632faa --- /dev/null +++ b/pkgs/development/compilers/llvm/6/compiler-rt-armv7l.patch @@ -0,0 +1,32 @@ +diff -ur compiler-rt-6.0.1.src/cmake/builtin-config-ix.cmake compiler-rt-6.0.1.src-patched/cmake/builtin-config-ix.cmake +--- compiler-rt-6.0.1.src/cmake/builtin-config-ix.cmake 2017-12-01 06:04:11.000000000 +0900 ++++ compiler-rt-6.0.1.src-patched/cmake/builtin-config-ix.cmake 2020-05-10 03:30:01.939694303 +0900 +@@ -24,7 +24,7 @@ + + + set(ARM64 aarch64) +-set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k) ++set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k armv7l) + set(X86 i386) + set(X86_64 x86_64) + set(MIPS32 mips mipsel) +diff -ur compiler-rt-6.0.1.src/lib/builtins/CMakeLists.txt compiler-rt-6.0.1.src-patched/lib/builtins/CMakeLists.txt +--- compiler-rt-6.0.1.src/lib/builtins/CMakeLists.txt 2017-12-25 06:11:32.000000000 +0900 ++++ compiler-rt-6.0.1.src-patched/lib/builtins/CMakeLists.txt 2020-05-10 03:30:44.814964156 +0900 +@@ -452,6 +452,7 @@ + set(armv7_SOURCES ${arm_SOURCES}) + set(armv7s_SOURCES ${arm_SOURCES}) + set(armv7k_SOURCES ${arm_SOURCES}) ++set(armv7l_SOURCES ${arm_SOURCES}) + set(arm64_SOURCES ${aarch64_SOURCES}) + + # macho_embedded archs +@@ -521,7 +522,7 @@ + set(_arch ${arch}) + if("${arch}" STREQUAL "armv6m") + set(_arch "arm|armv6m") +- elseif("${arch}" MATCHES "^(armhf|armv7|armv7s|armv7k|armv7m|armv7em)$") ++ elseif("${arch}" MATCHES "^(armhf|armv7|armv7s|armv7k|armv7l|armv7m|armv7em)$") + set(_arch "arm") + endif() + diff --git a/pkgs/development/compilers/llvm/6/compiler-rt.nix b/pkgs/development/compilers/llvm/6/compiler-rt.nix index b3b6e86fc52..5ae8bb01f05 100644 --- a/pkgs/development/compilers/llvm/6/compiler-rt.nix +++ b/pkgs/development/compilers/llvm/6/compiler-rt.nix @@ -1,5 +1,13 @@ { stdenv, version, fetch, cmake, python3, llvm, libcxxabi }: -with stdenv.lib; + +let + + useLLVM = stdenv.hostPlatform.useLLVM or false; + bareMetal = stdenv.hostPlatform.parsed.kernel.name == "none"; + inherit (stdenv.hostPlatform) isMusl; + +in + stdenv.mkDerivation { pname = "compiler-rt"; inherit version; @@ -8,29 +16,68 @@ stdenv.mkDerivation { nativeBuildInputs = [ cmake python3 llvm ]; buildInputs = stdenv.lib.optional stdenv.hostPlatform.isDarwin libcxxabi; - configureFlags = [ + NIX_CFLAGS_COMPILE = [ + "-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0" + ]; + + cmakeFlags = [ "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" + "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}" + "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}" + ] ++ stdenv.lib.optionals (useLLVM || bareMetal || isMusl) [ + "-DCOMPILER_RT_BUILD_SANITIZERS=OFF" + "-DCOMPILER_RT_BUILD_XRAY=OFF" + "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF" + "-DCOMPILER_RT_BUILD_PROFILE=OFF" + ] ++ stdenv.lib.optionals (useLLVM || bareMetal) [ + "-DCMAKE_C_COMPILER_WORKS=ON" + "-DCMAKE_CXX_COMPILER_WORKS=ON" + "-DCOMPILER_RT_BAREMETAL_BUILD=ON" + "-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}" + ] ++ stdenv.lib.optionals (useLLVM) [ + "-DCOMPILER_RT_BUILD_BUILTINS=ON" + "-DCMAKE_C_FLAGS=-nodefaultlibs" + #https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program + "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY" + ] ++ stdenv.lib.optionals (bareMetal) [ + "-DCOMPILER_RT_OS_DIR=baremetal" ]; outputs = [ "out" "dev" ]; patches = [ ./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory - ] ++ optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch; + ] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch + ++ stdenv.lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch; # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra # can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd # get no binary cache for the entire platform. If you really find yourself wanting the TSAN, make this controllable by # a flag and turn the flag off during the stdenv build. - postPatch = stdenv.lib.optionalString stdenv.isDarwin '' + postPatch = '' + substituteInPlace cmake/builtin-config-ix.cmake \ + --replace 'set(X86 i386)' 'set(X86 i386 i486 i586 i686)' + '' + stdenv.lib.optionalString stdenv.isDarwin '' substituteInPlace cmake/config-ix.cmake \ --replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)' + '' + stdenv.lib.optionalString (useLLVM) '' + substituteInPlace lib/builtins/int_util.c \ + --replace "#include <stdlib.h>" "" + substituteInPlace lib/builtins/clear_cache.c \ + --replace "#include <assert.h>" "" + substituteInPlace lib/builtins/cpu_model.c \ + --replace "#include <assert.h>" "" ''; # Hack around weird upsream RPATH bug - postInstall = stdenv.lib.optionalString stdenv.isDarwin '' + postInstall = stdenv.lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) '' ln -s "$out/lib"/*/* "$out/lib" + '' + stdenv.lib.optionalString (useLLVM) '' + ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/linux/crtbegin.o + ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/linux/crtend.o + ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/linux/crtbeginS.o + ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/linux/crtendS.o ''; enableParallelBuilding = true; diff --git a/pkgs/development/compilers/llvm/6/default.nix b/pkgs/development/compilers/llvm/6/default.nix index ba704f972c3..b544a4f6ba6 100644 --- a/pkgs/development/compilers/llvm/6/default.nix +++ b/pkgs/development/compilers/llvm/6/default.nix @@ -1,4 +1,4 @@ -{ lowPrio, newScope, pkgs, stdenv, cmake, libstdcxxHook +{ lowPrio, newScope, pkgs, stdenv, cmake, gcc, libstdcxxHook , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith , buildLlvmTools # tools, but from the previous stage, for cross , targetLlvmLibraries # libraries, but from the next stage, for cross @@ -7,6 +7,7 @@ let release_version = "6.0.1"; version = release_version; # differentiating these is important for rc's + targetConfig = stdenv.targetPlatform.config; fetch = name: sha256: fetchurl { url = "https://releases.llvm.org/${release_version}/${name}-${version}.src.tar.xz"; @@ -56,7 +57,12 @@ let extraPackages = [ targetLlvmLibraries.compiler-rt ]; - extraBuildCommands = mkExtraBuildCommands cc; + extraBuildCommands = '' + echo "-target ${targetConfig}" >> $out/nix-support/cc-cflags + echo "-B${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-cflags + echo "-L${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-ldflags + echo "-L${gcc.cc.lib}/${targetConfig}/lib" >> $out/nix-support/cc-ldflags + '' + mkExtraBuildCommands cc; }; libcxxClang = wrapCCWith rec { diff --git a/pkgs/development/compilers/llvm/6/libc++/default.nix b/pkgs/development/compilers/llvm/6/libc++/default.nix index 40f91c4d6ae..57f1431f471 100644 --- a/pkgs/development/compilers/llvm/6/libc++/default.nix +++ b/pkgs/development/compilers/llvm/6/libc++/default.nix @@ -45,7 +45,7 @@ stdenv.mkDerivation { ]; meta = { - homepage = "http://libcxx.llvm.org/"; + homepage = "https://libcxx.llvm.org/"; description = "A new implementation of the C++ standard library, targeting C++11"; license = with stdenv.lib.licenses; [ ncsa mit ]; platforms = stdenv.lib.platforms.unix; diff --git a/pkgs/development/compilers/llvm/6/libc++abi.nix b/pkgs/development/compilers/llvm/6/libc++abi.nix index f8d0d2e0cee..246bc6153e5 100644 --- a/pkgs/development/compilers/llvm/6/libc++abi.nix +++ b/pkgs/development/compilers/llvm/6/libc++abi.nix @@ -25,7 +25,7 @@ stdenv.mkDerivation { # this should be done in CMake, but having trouble figuring out # the magic combination of necessary CMake variables # if you fancy a try, take a look at - # http://www.cmake.org/Wiki/CMake_RPATH_handling + # https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling install_name_tool -id $out/$file $file done make install @@ -42,7 +42,7 @@ stdenv.mkDerivation { ''; meta = { - homepage = "http://libcxxabi.llvm.org/"; + homepage = "https://libcxxabi.llvm.org/"; description = "A new implementation of low level support for a standard C++ library"; license = with stdenv.lib.licenses; [ ncsa mit ]; maintainers = with stdenv.lib.maintainers; [ vlstill ]; diff --git a/pkgs/development/compilers/llvm/6/lld.nix b/pkgs/development/compilers/llvm/6/lld.nix index e00b71bc33e..81b94df3119 100644 --- a/pkgs/development/compilers/llvm/6/lld.nix +++ b/pkgs/development/compilers/llvm/6/lld.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation { meta = { description = "The LLVM Linker"; - homepage = "http://lld.llvm.org/"; + homepage = "https://lld.llvm.org/"; license = stdenv.lib.licenses.ncsa; platforms = stdenv.lib.platforms.all; }; diff --git a/pkgs/development/compilers/llvm/6/lldb.nix b/pkgs/development/compilers/llvm/6/lldb.nix index 0445dfed47f..80e298eaf8c 100644 --- a/pkgs/development/compilers/llvm/6/lldb.nix +++ b/pkgs/development/compilers/llvm/6/lldb.nix @@ -50,7 +50,7 @@ stdenv.mkDerivation { meta = with stdenv.lib; { description = "A next-generation high-performance debugger"; - homepage = "http://llvm.org/"; + homepage = "https://llvm.org/"; license = licenses.ncsa; platforms = platforms.all; }; diff --git a/pkgs/development/compilers/llvm/6/llvm.nix b/pkgs/development/compilers/llvm/6/llvm.nix index e1e40c8456d..22dbb75d2d5 100644 --- a/pkgs/development/compilers/llvm/6/llvm.nix +++ b/pkgs/development/compilers/llvm/6/llvm.nix @@ -147,9 +147,10 @@ stdenv.mkDerivation ({ enableParallelBuilding = true; + requiredSystemFeatures = [ "big-parallel" ]; meta = { description = "Collection of modular and reusable compiler and toolchain technologies"; - homepage = "http://llvm.org/"; + homepage = "https://llvm.org/"; license = stdenv.lib.licenses.ncsa; maintainers = with stdenv.lib.maintainers; [ lovek323 raskin dtzWill ]; platforms = stdenv.lib.platforms.all; diff --git a/pkgs/development/compilers/llvm/6/openmp.nix b/pkgs/development/compilers/llvm/6/openmp.nix index efc5553b1d6..c1a4480a552 100644 --- a/pkgs/development/compilers/llvm/6/openmp.nix +++ b/pkgs/development/compilers/llvm/6/openmp.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation { meta = { description = "Components required to build an executable OpenMP program"; - homepage = "http://openmp.llvm.org/"; + homepage = "https://openmp.llvm.org/"; license = stdenv.lib.licenses.mit; platforms = stdenv.lib.platforms.all; }; diff --git a/pkgs/development/compilers/llvm/7/clang/default.nix b/pkgs/development/compilers/llvm/7/clang/default.nix index 3a43b6b8aee..18ea46ea39c 100644 --- a/pkgs/development/compilers/llvm/7/clang/default.nix +++ b/pkgs/development/compilers/llvm/7/clang/default.nix @@ -93,7 +93,7 @@ let meta = { description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler"; - homepage = "http://llvm.org/"; + homepage = "https://llvm.org/"; license = stdenv.lib.licenses.ncsa; platforms = stdenv.lib.platforms.all; }; diff --git a/pkgs/development/compilers/llvm/7/compiler-rt-armv7l.patch b/pkgs/development/compilers/llvm/7/compiler-rt-armv7l.patch new file mode 100644 index 00000000000..89d7f1aec91 --- /dev/null +++ b/pkgs/development/compilers/llvm/7/compiler-rt-armv7l.patch @@ -0,0 +1,38 @@ +diff -ur compiler-rt-7.1.0.src/cmake/builtin-config-ix.cmake compiler-rt-7.1.0.src-patched/cmake/builtin-config-ix.cmake +--- compiler-rt-7.1.0.src/cmake/builtin-config-ix.cmake 2018-05-25 06:36:27.000000000 +0900 ++++ compiler-rt-7.1.0.src-patched/cmake/builtin-config-ix.cmake 2020-05-09 20:26:33.030608692 +0900 +@@ -24,7 +24,7 @@ + + + set(ARM64 aarch64) +-set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k) ++set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k armv7l) + set(HEXAGON hexagon) + set(X86 i386) + set(X86_64 x86_64) +diff -ur compiler-rt-7.1.0.src/lib/builtins/CMakeLists.txt compiler-rt-7.1.0.src-patched/lib/builtins/CMakeLists.txt +--- compiler-rt-7.1.0.src/lib/builtins/CMakeLists.txt 2018-07-31 03:18:59.000000000 +0900 ++++ compiler-rt-7.1.0.src-patched/lib/builtins/CMakeLists.txt 2020-05-09 20:27:38.893409318 +0900 +@@ -453,6 +453,7 @@ + set(armv7_SOURCES ${arm_SOURCES}) + set(armv7s_SOURCES ${arm_SOURCES}) + set(armv7k_SOURCES ${arm_SOURCES}) ++set(armv7l_SOURCES ${arm_SOURCES}) + set(arm64_SOURCES ${aarch64_SOURCES}) + + # macho_embedded archs +@@ -563,12 +564,12 @@ + set(_arch ${arch}) + if("${arch}" STREQUAL "armv6m") + set(_arch "arm|armv6m") +- elseif("${arch}" MATCHES "^(armhf|armv7|armv7s|armv7k|armv7m|armv7em)$") ++ elseif("${arch}" MATCHES "^(armhf|armv7|armv7s|armv7k|armv7l|armv7m|armv7em)$") + set(_arch "arm") + endif() + + # For ARM archs, exclude any VFP builtins if VFP is not supported +- if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7m|armv7em)$") ++ if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7l|armv7m|armv7em)$") + string(REPLACE ";" " " _TARGET_${arch}_CFLAGS "${TARGET_${arch}_CFLAGS}") + check_compile_definition(__VFP_FP__ "${CMAKE_C_FLAGS} ${_TARGET_${arch}_CFLAGS}" COMPILER_RT_HAS_${arch}_VFP) + if(NOT COMPILER_RT_HAS_${arch}_VFP) diff --git a/pkgs/development/compilers/llvm/7/compiler-rt.nix b/pkgs/development/compilers/llvm/7/compiler-rt.nix index 7a5e3d4c8fc..e9853c58ca5 100644 --- a/pkgs/development/compilers/llvm/7/compiler-rt.nix +++ b/pkgs/development/compilers/llvm/7/compiler-rt.nix @@ -20,7 +20,7 @@ stdenv.mkDerivation { "-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0" ]; - cmakeFlags = stdenv.lib.optionals (useLLVM || stdenv.isDarwin) [ + cmakeFlags = [ "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}" "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}" @@ -48,14 +48,18 @@ stdenv.mkDerivation { patches = [ ./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory ] ++ stdenv.lib.optional (useLLVM) ./crtbegin-and-end.patch - ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch; + ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch + ++ stdenv.lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch; # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra # can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd # get no binary cache for the entire platform. If you really find yourself wanting the TSAN, make this controllable by # a flag and turn the flag off during the stdenv build. - postPatch = stdenv.lib.optionalString stdenv.isDarwin '' + postPatch = '' + substituteInPlace cmake/builtin-config-ix.cmake \ + --replace 'set(X86 i386)' 'set(X86 i386 i486 i586 i686)' + '' + stdenv.lib.optionalString stdenv.isDarwin '' substituteInPlace cmake/config-ix.cmake \ --replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)' '' + stdenv.lib.optionalString (useLLVM) '' @@ -68,7 +72,7 @@ stdenv.mkDerivation { ''; # Hack around weird upsream RPATH bug - postInstall = stdenv.lib.optionalString stdenv.isDarwin '' + postInstall = stdenv.lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) '' ln -s "$out/lib"/*/* "$out/lib" '' + stdenv.lib.optionalString (useLLVM) '' ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/linux/crtbegin.o diff --git a/pkgs/development/compilers/llvm/7/default.nix b/pkgs/development/compilers/llvm/7/default.nix index 5124a5df00b..0b71c3a28d2 100644 --- a/pkgs/development/compilers/llvm/7/default.nix +++ b/pkgs/development/compilers/llvm/7/default.nix @@ -1,4 +1,4 @@ -{ lowPrio, newScope, pkgs, stdenv, cmake, libstdcxxHook +{ lowPrio, newScope, pkgs, stdenv, cmake, gcc, libstdcxxHook , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith , buildLlvmTools # tools, but from the previous stage, for cross , targetLlvmLibraries # libraries, but from the next stage, for cross @@ -7,6 +7,7 @@ let release_version = "7.1.0"; version = release_version; # differentiating these is important for rc's + targetConfig = stdenv.targetPlatform.config; fetch = name: sha256: fetchurl { url = "https://releases.llvm.org/${release_version}/${name}-${version}.src.tar.xz"; @@ -63,7 +64,12 @@ let extraPackages = [ targetLlvmLibraries.compiler-rt ]; - extraBuildCommands = mkExtraBuildCommands cc; + extraBuildCommands = '' + echo "-target ${targetConfig}" >> $out/nix-support/cc-cflags + echo "-B${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-cflags + echo "-L${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-ldflags + echo "-L${gcc.cc.lib}/${targetConfig}/lib" >> $out/nix-support/cc-ldflags + '' + mkExtraBuildCommands cc; }; libcxxClang = wrapCCWith rec { diff --git a/pkgs/development/compilers/llvm/7/libc++/default.nix b/pkgs/development/compilers/llvm/7/libc++/default.nix index 7c2f1e238ba..96cb671fa43 100644 --- a/pkgs/development/compilers/llvm/7/libc++/default.nix +++ b/pkgs/development/compilers/llvm/7/libc++/default.nix @@ -45,7 +45,7 @@ stdenv.mkDerivation { ]; meta = { - homepage = "http://libcxx.llvm.org/"; + homepage = "https://libcxx.llvm.org/"; description = "A new implementation of the C++ standard library, targeting C++11"; license = with stdenv.lib.licenses; [ ncsa mit ]; platforms = stdenv.lib.platforms.unix; diff --git a/pkgs/development/compilers/llvm/7/libc++abi.nix b/pkgs/development/compilers/llvm/7/libc++abi.nix index 608351e0eb9..97141a0bd40 100644 --- a/pkgs/development/compilers/llvm/7/libc++abi.nix +++ b/pkgs/development/compilers/llvm/7/libc++abi.nix @@ -28,7 +28,7 @@ stdenv.mkDerivation { # this should be done in CMake, but having trouble figuring out # the magic combination of necessary CMake variables # if you fancy a try, take a look at - # http://www.cmake.org/Wiki/CMake_RPATH_handling + # https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling install_name_tool -id $out/$file $file done make install @@ -45,7 +45,7 @@ stdenv.mkDerivation { ''; meta = { - homepage = "http://libcxxabi.llvm.org/"; + homepage = "https://libcxxabi.llvm.org/"; description = "A new implementation of low level support for a standard C++ library"; license = with stdenv.lib.licenses; [ ncsa mit ]; maintainers = with stdenv.lib.maintainers; [ vlstill ]; diff --git a/pkgs/development/compilers/llvm/7/lld.nix b/pkgs/development/compilers/llvm/7/lld.nix index 3921e70b3e3..bee9202ed6c 100644 --- a/pkgs/development/compilers/llvm/7/lld.nix +++ b/pkgs/development/compilers/llvm/7/lld.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation { meta = { description = "The LLVM Linker"; - homepage = "http://lld.llvm.org/"; + homepage = "https://lld.llvm.org/"; license = stdenv.lib.licenses.ncsa; platforms = stdenv.lib.platforms.all; }; diff --git a/pkgs/development/compilers/llvm/7/lldb.nix b/pkgs/development/compilers/llvm/7/lldb.nix index 81ad0675839..8fadd3cf784 100644 --- a/pkgs/development/compilers/llvm/7/lldb.nix +++ b/pkgs/development/compilers/llvm/7/lldb.nix @@ -61,7 +61,7 @@ stdenv.mkDerivation { meta = with stdenv.lib; { description = "A next-generation high-performance debugger"; - homepage = "http://llvm.org/"; + homepage = "https://llvm.org/"; license = licenses.ncsa; platforms = platforms.all; }; diff --git a/pkgs/development/compilers/llvm/7/llvm.nix b/pkgs/development/compilers/llvm/7/llvm.nix index 0ea517e81f4..dc57d0d6bd5 100644 --- a/pkgs/development/compilers/llvm/7/llvm.nix +++ b/pkgs/development/compilers/llvm/7/llvm.nix @@ -17,6 +17,7 @@ , enableSharedLibraries ? true , enablePFM ? !(stdenv.isDarwin || stdenv.isAarch64 # broken for Ampere eMAG 8180 (c2.large.arm on Packet) #56245 + || stdenv.isAarch32 # broken for the armv7l builder ) , enablePolly ? false }: @@ -168,9 +169,10 @@ in stdenv.mkDerivation ({ enableParallelBuilding = true; + requiredSystemFeatures = [ "big-parallel" ]; meta = { description = "Collection of modular and reusable compiler and toolchain technologies"; - homepage = "http://llvm.org/"; + homepage = "https://llvm.org/"; license = stdenv.lib.licenses.ncsa; maintainers = with stdenv.lib.maintainers; [ lovek323 raskin dtzWill ]; platforms = stdenv.lib.platforms.all; diff --git a/pkgs/development/compilers/llvm/7/openmp.nix b/pkgs/development/compilers/llvm/7/openmp.nix index 69ee58679c4..898d49dce83 100644 --- a/pkgs/development/compilers/llvm/7/openmp.nix +++ b/pkgs/development/compilers/llvm/7/openmp.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation { meta = { description = "Components required to build an executable OpenMP program"; - homepage = "http://openmp.llvm.org/"; + homepage = "https://openmp.llvm.org/"; license = stdenv.lib.licenses.mit; platforms = stdenv.lib.platforms.all; }; diff --git a/pkgs/development/compilers/llvm/8/clang/default.nix b/pkgs/development/compilers/llvm/8/clang/default.nix index e549713ceca..3b398628e56 100644 --- a/pkgs/development/compilers/llvm/8/clang/default.nix +++ b/pkgs/development/compilers/llvm/8/clang/default.nix @@ -103,7 +103,7 @@ let meta = { description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler"; - homepage = "http://llvm.org/"; + homepage = "https://llvm.org/"; license = stdenv.lib.licenses.ncsa; platforms = stdenv.lib.platforms.all; }; diff --git a/pkgs/development/compilers/llvm/8/compiler-rt-armv7l.patch b/pkgs/development/compilers/llvm/8/compiler-rt-armv7l.patch new file mode 100644 index 00000000000..89d7f1aec91 --- /dev/null +++ b/pkgs/development/compilers/llvm/8/compiler-rt-armv7l.patch @@ -0,0 +1,38 @@ +diff -ur compiler-rt-7.1.0.src/cmake/builtin-config-ix.cmake compiler-rt-7.1.0.src-patched/cmake/builtin-config-ix.cmake +--- compiler-rt-7.1.0.src/cmake/builtin-config-ix.cmake 2018-05-25 06:36:27.000000000 +0900 ++++ compiler-rt-7.1.0.src-patched/cmake/builtin-config-ix.cmake 2020-05-09 20:26:33.030608692 +0900 +@@ -24,7 +24,7 @@ + + + set(ARM64 aarch64) +-set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k) ++set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k armv7l) + set(HEXAGON hexagon) + set(X86 i386) + set(X86_64 x86_64) +diff -ur compiler-rt-7.1.0.src/lib/builtins/CMakeLists.txt compiler-rt-7.1.0.src-patched/lib/builtins/CMakeLists.txt +--- compiler-rt-7.1.0.src/lib/builtins/CMakeLists.txt 2018-07-31 03:18:59.000000000 +0900 ++++ compiler-rt-7.1.0.src-patched/lib/builtins/CMakeLists.txt 2020-05-09 20:27:38.893409318 +0900 +@@ -453,6 +453,7 @@ + set(armv7_SOURCES ${arm_SOURCES}) + set(armv7s_SOURCES ${arm_SOURCES}) + set(armv7k_SOURCES ${arm_SOURCES}) ++set(armv7l_SOURCES ${arm_SOURCES}) + set(arm64_SOURCES ${aarch64_SOURCES}) + + # macho_embedded archs +@@ -563,12 +564,12 @@ + set(_arch ${arch}) + if("${arch}" STREQUAL "armv6m") + set(_arch "arm|armv6m") +- elseif("${arch}" MATCHES "^(armhf|armv7|armv7s|armv7k|armv7m|armv7em)$") ++ elseif("${arch}" MATCHES "^(armhf|armv7|armv7s|armv7k|armv7l|armv7m|armv7em)$") + set(_arch "arm") + endif() + + # For ARM archs, exclude any VFP builtins if VFP is not supported +- if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7m|armv7em)$") ++ if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7l|armv7m|armv7em)$") + string(REPLACE ";" " " _TARGET_${arch}_CFLAGS "${TARGET_${arch}_CFLAGS}") + check_compile_definition(__VFP_FP__ "${CMAKE_C_FLAGS} ${_TARGET_${arch}_CFLAGS}" COMPILER_RT_HAS_${arch}_VFP) + if(NOT COMPILER_RT_HAS_${arch}_VFP) diff --git a/pkgs/development/compilers/llvm/8/compiler-rt.nix b/pkgs/development/compilers/llvm/8/compiler-rt.nix index 795c81f4219..1f58cb98e3d 100644 --- a/pkgs/development/compilers/llvm/8/compiler-rt.nix +++ b/pkgs/development/compilers/llvm/8/compiler-rt.nix @@ -20,7 +20,7 @@ stdenv.mkDerivation { "-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0" ]; - cmakeFlags = stdenv.lib.optionals (useLLVM || stdenv.isDarwin) [ + cmakeFlags = [ "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}" "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}" @@ -48,14 +48,18 @@ stdenv.mkDerivation { patches = [ ./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory ]# ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch - ++ stdenv.lib.optional (useLLVM) ./crtbegin-and-end.patch; + ++ stdenv.lib.optional (useLLVM) ./crtbegin-and-end.patch + ++ stdenv.lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch; # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra # can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd # get no binary cache for the entire platform. If you really find yourself wanting the TSAN, make this controllable by # a flag and turn the flag off during the stdenv build. - postPatch = stdenv.lib.optionalString stdenv.isDarwin '' + postPatch = '' + substituteInPlace cmake/builtin-config-ix.cmake \ + --replace 'set(X86 i386)' 'set(X86 i386 i486 i586 i686)' + '' + stdenv.lib.optionalString stdenv.isDarwin '' substituteInPlace cmake/config-ix.cmake \ --replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)' '' + stdenv.lib.optionalString (useLLVM) '' diff --git a/pkgs/development/compilers/llvm/8/default.nix b/pkgs/development/compilers/llvm/8/default.nix index 105011595c8..d9383d042bb 100644 --- a/pkgs/development/compilers/llvm/8/default.nix +++ b/pkgs/development/compilers/llvm/8/default.nix @@ -1,4 +1,4 @@ -{ lowPrio, newScope, pkgs, stdenv, cmake, libstdcxxHook +{ lowPrio, newScope, pkgs, stdenv, cmake, gcc, libstdcxxHook , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith , buildLlvmTools # tools, but from the previous stage, for cross , targetLlvmLibraries # libraries, but from the next stage, for cross @@ -7,6 +7,7 @@ let release_version = "8.0.1"; version = release_version; # differentiating these is important for rc's + targetConfig = stdenv.targetPlatform.config; fetch = name: sha256: fetchurl { url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-${release_version}/${name}-${version}.src.tar.xz"; @@ -63,7 +64,12 @@ let extraPackages = [ targetLlvmLibraries.compiler-rt ]; - extraBuildCommands = mkExtraBuildCommands cc; + extraBuildCommands = '' + echo "-target ${targetConfig}" >> $out/nix-support/cc-cflags + echo "-B${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-cflags + echo "-L${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-ldflags + echo "-L${gcc.cc.lib}/${targetConfig}/lib" >> $out/nix-support/cc-ldflags + '' + mkExtraBuildCommands cc; }; libcxxClang = wrapCCWith rec { diff --git a/pkgs/development/compilers/llvm/8/libc++/default.nix b/pkgs/development/compilers/llvm/8/libc++/default.nix index 97293464645..24bca6aafcd 100644 --- a/pkgs/development/compilers/llvm/8/libc++/default.nix +++ b/pkgs/development/compilers/llvm/8/libc++/default.nix @@ -51,7 +51,7 @@ stdenv.mkDerivation { ]; meta = { - homepage = "http://libcxx.llvm.org/"; + homepage = "https://libcxx.llvm.org/"; description = "A new implementation of the C++ standard library, targeting C++11"; license = with stdenv.lib.licenses; [ ncsa mit ]; platforms = stdenv.lib.platforms.all; diff --git a/pkgs/development/compilers/llvm/8/libc++abi.nix b/pkgs/development/compilers/llvm/8/libc++abi.nix index d8c64f51ee0..590872aaab6 100644 --- a/pkgs/development/compilers/llvm/8/libc++abi.nix +++ b/pkgs/development/compilers/llvm/8/libc++abi.nix @@ -40,7 +40,7 @@ stdenv.mkDerivation { # this should be done in CMake, but having trouble figuring out # the magic combination of necessary CMake variables # if you fancy a try, take a look at - # http://www.cmake.org/Wiki/CMake_RPATH_handling + # https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling install_name_tool -id $out/$file $file done make install @@ -58,7 +58,7 @@ stdenv.mkDerivation { ''; meta = { - homepage = "http://libcxxabi.llvm.org/"; + homepage = "https://libcxxabi.llvm.org/"; description = "A new implementation of low level support for a standard C++ library"; license = with stdenv.lib.licenses; [ ncsa mit ]; maintainers = with stdenv.lib.maintainers; [ vlstill ]; diff --git a/pkgs/development/compilers/llvm/8/lld.nix b/pkgs/development/compilers/llvm/8/lld.nix index da5649ef5a2..ba9cf3c57d7 100644 --- a/pkgs/development/compilers/llvm/8/lld.nix +++ b/pkgs/development/compilers/llvm/8/lld.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation { meta = { description = "The LLVM Linker"; - homepage = "http://lld.llvm.org/"; + homepage = "https://lld.llvm.org/"; license = stdenv.lib.licenses.ncsa; platforms = stdenv.lib.platforms.all; }; diff --git a/pkgs/development/compilers/llvm/8/lldb.nix b/pkgs/development/compilers/llvm/8/lldb.nix index 5df6f760a07..298ce737fc7 100644 --- a/pkgs/development/compilers/llvm/8/lldb.nix +++ b/pkgs/development/compilers/llvm/8/lldb.nix @@ -54,7 +54,7 @@ stdenv.mkDerivation { meta = with stdenv.lib; { description = "A next-generation high-performance debugger"; - homepage = "http://llvm.org/"; + homepage = "https://llvm.org/"; license = licenses.ncsa; platforms = platforms.all; }; diff --git a/pkgs/development/compilers/llvm/8/llvm.nix b/pkgs/development/compilers/llvm/8/llvm.nix index 9bf835027ae..0f6179c2d31 100644 --- a/pkgs/development/compilers/llvm/8/llvm.nix +++ b/pkgs/development/compilers/llvm/8/llvm.nix @@ -16,6 +16,7 @@ , enableSharedLibraries ? true , enablePFM ? !(stdenv.isDarwin || stdenv.isAarch64 # broken for Ampere eMAG 8180 (c2.large.arm on Packet) #56245 + || stdenv.isAarch32 # broken for the armv7l builder ) , enablePolly ? false }: @@ -143,9 +144,10 @@ in stdenv.mkDerivation ({ enableParallelBuilding = true; + requiredSystemFeatures = [ "big-parallel" ]; meta = { description = "Collection of modular and reusable compiler and toolchain technologies"; - homepage = "http://llvm.org/"; + homepage = "https://llvm.org/"; license = stdenv.lib.licenses.ncsa; maintainers = with stdenv.lib.maintainers; [ lovek323 raskin dtzWill ]; platforms = stdenv.lib.platforms.all; diff --git a/pkgs/development/compilers/llvm/8/openmp.nix b/pkgs/development/compilers/llvm/8/openmp.nix index 74ec8076e43..42cc7adf4f0 100644 --- a/pkgs/development/compilers/llvm/8/openmp.nix +++ b/pkgs/development/compilers/llvm/8/openmp.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation { meta = { description = "Components required to build an executable OpenMP program"; - homepage = "http://openmp.llvm.org/"; + homepage = "https://openmp.llvm.org/"; license = stdenv.lib.licenses.mit; platforms = stdenv.lib.platforms.all; }; diff --git a/pkgs/development/compilers/llvm/9/clang/default.nix b/pkgs/development/compilers/llvm/9/clang/default.nix index 51399ea4598..c938a01f897 100644 --- a/pkgs/development/compilers/llvm/9/clang/default.nix +++ b/pkgs/development/compilers/llvm/9/clang/default.nix @@ -98,7 +98,7 @@ let meta = { description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler"; - homepage = "http://llvm.org/"; + homepage = "https://llvm.org/"; license = stdenv.lib.licenses.ncsa; platforms = stdenv.lib.platforms.all; }; diff --git a/pkgs/development/compilers/llvm/9/compiler-rt-armv7l.patch b/pkgs/development/compilers/llvm/9/compiler-rt-armv7l.patch new file mode 100644 index 00000000000..89d7f1aec91 --- /dev/null +++ b/pkgs/development/compilers/llvm/9/compiler-rt-armv7l.patch @@ -0,0 +1,38 @@ +diff -ur compiler-rt-7.1.0.src/cmake/builtin-config-ix.cmake compiler-rt-7.1.0.src-patched/cmake/builtin-config-ix.cmake +--- compiler-rt-7.1.0.src/cmake/builtin-config-ix.cmake 2018-05-25 06:36:27.000000000 +0900 ++++ compiler-rt-7.1.0.src-patched/cmake/builtin-config-ix.cmake 2020-05-09 20:26:33.030608692 +0900 +@@ -24,7 +24,7 @@ + + + set(ARM64 aarch64) +-set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k) ++set(ARM32 arm armhf armv6m armv7m armv7em armv7 armv7s armv7k armv7l) + set(HEXAGON hexagon) + set(X86 i386) + set(X86_64 x86_64) +diff -ur compiler-rt-7.1.0.src/lib/builtins/CMakeLists.txt compiler-rt-7.1.0.src-patched/lib/builtins/CMakeLists.txt +--- compiler-rt-7.1.0.src/lib/builtins/CMakeLists.txt 2018-07-31 03:18:59.000000000 +0900 ++++ compiler-rt-7.1.0.src-patched/lib/builtins/CMakeLists.txt 2020-05-09 20:27:38.893409318 +0900 +@@ -453,6 +453,7 @@ + set(armv7_SOURCES ${arm_SOURCES}) + set(armv7s_SOURCES ${arm_SOURCES}) + set(armv7k_SOURCES ${arm_SOURCES}) ++set(armv7l_SOURCES ${arm_SOURCES}) + set(arm64_SOURCES ${aarch64_SOURCES}) + + # macho_embedded archs +@@ -563,12 +564,12 @@ + set(_arch ${arch}) + if("${arch}" STREQUAL "armv6m") + set(_arch "arm|armv6m") +- elseif("${arch}" MATCHES "^(armhf|armv7|armv7s|armv7k|armv7m|armv7em)$") ++ elseif("${arch}" MATCHES "^(armhf|armv7|armv7s|armv7k|armv7l|armv7m|armv7em)$") + set(_arch "arm") + endif() + + # For ARM archs, exclude any VFP builtins if VFP is not supported +- if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7m|armv7em)$") ++ if (${arch} MATCHES "^(arm|armhf|armv7|armv7s|armv7k|armv7l|armv7m|armv7em)$") + string(REPLACE ";" " " _TARGET_${arch}_CFLAGS "${TARGET_${arch}_CFLAGS}") + check_compile_definition(__VFP_FP__ "${CMAKE_C_FLAGS} ${_TARGET_${arch}_CFLAGS}" COMPILER_RT_HAS_${arch}_VFP) + if(NOT COMPILER_RT_HAS_${arch}_VFP) diff --git a/pkgs/development/compilers/llvm/9/compiler-rt.nix b/pkgs/development/compilers/llvm/9/compiler-rt.nix index 0cfd8d7c9e7..3b92264ad69 100644 --- a/pkgs/development/compilers/llvm/9/compiler-rt.nix +++ b/pkgs/development/compilers/llvm/9/compiler-rt.nix @@ -20,7 +20,7 @@ stdenv.mkDerivation rec { "-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0" ]; - cmakeFlags = stdenv.lib.optionals (useLLVM || stdenv.isDarwin) [ + cmakeFlags = [ "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}" "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}" @@ -47,14 +47,18 @@ stdenv.mkDerivation rec { patches = [ ./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory - ];# ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch + ]# ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch + ++ stdenv.lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch; # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra # can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd # get no binary cache for the entire platform. If you really find yourself wanting the TSAN, make this controllable by # a flag and turn the flag off during the stdenv build. - postPatch = stdenv.lib.optionalString stdenv.isDarwin '' + postPatch = '' + substituteInPlace cmake/builtin-config-ix.cmake \ + --replace 'set(X86 i386)' 'set(X86 i386 i486 i586 i686)' + '' + stdenv.lib.optionalString stdenv.isDarwin '' substituteInPlace cmake/config-ix.cmake \ --replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)' '' + stdenv.lib.optionalString (useLLVM) '' diff --git a/pkgs/development/compilers/llvm/9/default.nix b/pkgs/development/compilers/llvm/9/default.nix index d42e5187c3c..3b6db967b6a 100644 --- a/pkgs/development/compilers/llvm/9/default.nix +++ b/pkgs/development/compilers/llvm/9/default.nix @@ -1,4 +1,4 @@ -{ lowPrio, newScope, pkgs, stdenv, cmake, libstdcxxHook +{ lowPrio, newScope, pkgs, stdenv, cmake, gcc, libstdcxxHook , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith , buildLlvmTools # tools, but from the previous stage, for cross , targetLlvmLibraries # libraries, but from the next stage, for cross @@ -7,6 +7,7 @@ let release_version = "9.0.1"; version = release_version; # differentiating these is important for rc's + targetConfig = stdenv.targetPlatform.config; fetch = name: sha256: fetchurl { url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-${release_version}/${name}-${version}.src.tar.xz"; @@ -63,7 +64,12 @@ let extraPackages = [ targetLlvmLibraries.compiler-rt ]; - extraBuildCommands = mkExtraBuildCommands cc; + extraBuildCommands = '' + echo "-target ${targetConfig}" >> $out/nix-support/cc-cflags + echo "-B${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-cflags + echo "-L${gcc.cc}/lib/gcc/${targetConfig}/${gcc.version}" >> $out/nix-support/cc-ldflags + echo "-L${gcc.cc.lib}/${targetConfig}/lib" >> $out/nix-support/cc-ldflags + '' + mkExtraBuildCommands cc; }; libcxxClang = wrapCCWith rec { diff --git a/pkgs/development/compilers/llvm/9/libc++/default.nix b/pkgs/development/compilers/llvm/9/libc++/default.nix index 05aaa9fc8e5..f3081d1f269 100644 --- a/pkgs/development/compilers/llvm/9/libc++/default.nix +++ b/pkgs/development/compilers/llvm/9/libc++/default.nix @@ -47,7 +47,7 @@ stdenv.mkDerivation { ]; meta = { - homepage = "http://libcxx.llvm.org/"; + homepage = "https://libcxx.llvm.org/"; description = "A new implementation of the C++ standard library, targeting C++11"; license = with stdenv.lib.licenses; [ ncsa mit ]; platforms = stdenv.lib.platforms.all; diff --git a/pkgs/development/compilers/llvm/9/libc++abi.nix b/pkgs/development/compilers/llvm/9/libc++abi.nix index 583a47da3ff..5b63560282c 100644 --- a/pkgs/development/compilers/llvm/9/libc++abi.nix +++ b/pkgs/development/compilers/llvm/9/libc++abi.nix @@ -40,7 +40,7 @@ stdenv.mkDerivation { # this should be done in CMake, but having trouble figuring out # the magic combination of necessary CMake variables # if you fancy a try, take a look at - # http://www.cmake.org/Wiki/CMake_RPATH_handling + # https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/RPATH-handling install_name_tool -id $out/$file $file done make install @@ -58,7 +58,7 @@ stdenv.mkDerivation { ''; meta = { - homepage = "http://libcxxabi.llvm.org/"; + homepage = "https://libcxxabi.llvm.org/"; description = "A new implementation of low level support for a standard C++ library"; license = with stdenv.lib.licenses; [ ncsa mit ]; maintainers = with stdenv.lib.maintainers; [ vlstill ]; diff --git a/pkgs/development/compilers/llvm/9/lld.nix b/pkgs/development/compilers/llvm/9/lld.nix index a746b96f30d..488870e729a 100644 --- a/pkgs/development/compilers/llvm/9/lld.nix +++ b/pkgs/development/compilers/llvm/9/lld.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation rec { meta = { description = "The LLVM Linker"; - homepage = "http://lld.llvm.org/"; + homepage = "https://lld.llvm.org/"; license = stdenv.lib.licenses.ncsa; platforms = stdenv.lib.platforms.all; }; diff --git a/pkgs/development/compilers/llvm/9/lldb.nix b/pkgs/development/compilers/llvm/9/lldb.nix index 1ba0339d639..a8e193c27b1 100644 --- a/pkgs/development/compilers/llvm/9/lldb.nix +++ b/pkgs/development/compilers/llvm/9/lldb.nix @@ -65,7 +65,7 @@ stdenv.mkDerivation rec { meta = with stdenv.lib; { description = "A next-generation high-performance debugger"; - homepage = "http://llvm.org/"; + homepage = "https://llvm.org/"; license = licenses.ncsa; platforms = platforms.all; }; diff --git a/pkgs/development/compilers/llvm/9/llvm.nix b/pkgs/development/compilers/llvm/9/llvm.nix index 49ea3be34da..013e5bb36b9 100644 --- a/pkgs/development/compilers/llvm/9/llvm.nix +++ b/pkgs/development/compilers/llvm/9/llvm.nix @@ -16,6 +16,7 @@ , enableSharedLibraries ? true , enablePFM ? !(stdenv.isDarwin || stdenv.isAarch64 # broken for Ampere eMAG 8180 (c2.large.arm on Packet) #56245 + || stdenv.isAarch32 # broken for the armv7l builder ) , enablePolly ? false }: @@ -160,9 +161,10 @@ in stdenv.mkDerivation (rec { enableParallelBuilding = true; + requiredSystemFeatures = [ "big-parallel" ]; meta = { description = "Collection of modular and reusable compiler and toolchain technologies"; - homepage = "http://llvm.org/"; + homepage = "https://llvm.org/"; license = stdenv.lib.licenses.ncsa; maintainers = with stdenv.lib.maintainers; [ lovek323 raskin dtzWill ]; platforms = stdenv.lib.platforms.all; diff --git a/pkgs/development/compilers/llvm/9/openmp.nix b/pkgs/development/compilers/llvm/9/openmp.nix index b5699cd1af0..84f898ec06a 100644 --- a/pkgs/development/compilers/llvm/9/openmp.nix +++ b/pkgs/development/compilers/llvm/9/openmp.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation rec { meta = { description = "Components required to build an executable OpenMP program"; - homepage = "http://openmp.llvm.org/"; + homepage = "https://openmp.llvm.org/"; license = stdenv.lib.licenses.mit; platforms = stdenv.lib.platforms.all; }; |