diff options
-rw-r--r-- | pkgs/build-support/cc-wrapper/default.nix | 4 | ||||
-rw-r--r-- | pkgs/development/compilers/llvm/6/clang/default.nix | 10 | ||||
-rw-r--r-- | pkgs/development/compilers/llvm/6/compiler-rt.nix | 31 | ||||
-rw-r--r-- | pkgs/development/compilers/llvm/6/default.nix | 25 | ||||
-rw-r--r-- | pkgs/development/compilers/llvm/6/llvm.nix | 16 | ||||
-rw-r--r-- | pkgs/development/interpreters/php/default.nix | 4 | ||||
-rw-r--r-- | pkgs/os-specific/linux/kernel/linux-4.14.nix | 4 | ||||
-rw-r--r-- | pkgs/os-specific/linux/kernel/linux-4.16.nix | 4 | ||||
-rw-r--r-- | pkgs/os-specific/linux/kernel/linux-4.4.nix | 4 | ||||
-rw-r--r-- | pkgs/os-specific/linux/kernel/linux-4.9.nix | 4 | ||||
-rw-r--r-- | pkgs/test/cc-wrapper/default.nix | 5 | ||||
-rw-r--r-- | pkgs/test/cc-wrapper/sanitizers.c | 8 |
12 files changed, 80 insertions, 39 deletions
diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index 43cd87fb45976..8f99da805ec19 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -9,7 +9,7 @@ , stdenvNoCC, nativeTools, propagateDoc ? !nativeTools, noLibc ? false, nativeLibc, nativePrefix ? "" , cc ? null, libc ? null, bintools, coreutils ? null, shell ? stdenvNoCC.shell , extraPackages ? [], extraBuildCommands ? "" -, isGNU ? false, isClang ? cc.isClang or false, gnugrep ? null +, isGNU ? false, isClang ? cc.isClang or false, isCompilerRT ? false, gnugrep ? null , buildPackages ? {} }: @@ -90,7 +90,7 @@ stdenv.mkDerivation { # Binutils, and Apple's "cctools"; "bintools" as an attempt to find an # unused middle-ground name that evokes both. inherit bintools; - inherit libc nativeTools nativeLibc nativePrefix isGNU isClang default_cxx_stdlib_compile; + inherit libc nativeTools nativeLibc nativePrefix isGNU isClang isCompilerRT default_cxx_stdlib_compile; emacsBufferSetup = pkgs: '' ; We should handle propagation here too diff --git a/pkgs/development/compilers/llvm/6/clang/default.nix b/pkgs/development/compilers/llvm/6/clang/default.nix index 919efdc8ef971..eefac7d6e6936 100644 --- a/pkgs/development/compilers/llvm/6/clang/default.nix +++ b/pkgs/development/compilers/llvm/6/clang/default.nix @@ -30,10 +30,7 @@ let "-DSPHINX_OUTPUT_MAN=ON" "-DSPHINX_OUTPUT_HTML=OFF" "-DSPHINX_WARNINGS_AS_ERRORS=OFF" - ] - # Maybe with compiler-rt this won't be needed? - ++ stdenv.lib.optional stdenv.isLinux "-DGCC_INSTALL_PREFIX=${gcc}" - ++ stdenv.lib.optional (stdenv.cc.libc != null) "-DC_INCLUDE_DIRS=${stdenv.cc.libc}/include"; + ]; patches = [ ./purity.patch ]; @@ -51,10 +48,9 @@ let outputs = [ "out" "lib" "python" ]; # Clang expects to find LLVMgold in its own prefix - # Clang expects to find sanitizer libraries in its own prefix postInstall = '' ln -sv ${llvm}/lib/LLVMgold.so $out/lib - ln -sv ${llvm}/lib/clang/${release_version}/lib $out/lib/clang/${release_version}/ + ln -sv $out/bin/clang $out/bin/cpp # Move libclang to 'lib' output @@ -76,7 +72,7 @@ let passthru = { isClang = true; inherit llvm; - } // stdenv.lib.optionalAttrs stdenv.isLinux { + } // stdenv.lib.optionalAttrs stdenv.targetPlatform.isLinux { inherit gcc; }; diff --git a/pkgs/development/compilers/llvm/6/compiler-rt.nix b/pkgs/development/compilers/llvm/6/compiler-rt.nix new file mode 100644 index 0000000000000..333818f7dbdef --- /dev/null +++ b/pkgs/development/compilers/llvm/6/compiler-rt.nix @@ -0,0 +1,31 @@ +{ stdenv, version, fetch, cmake, python, llvm }: +with stdenv.lib; +stdenv.mkDerivation rec { + name = "compiler-rt-${version}"; + inherit version; + src = fetch "compiler-rt" "16m7rvh3w6vq10iwkjrr1nn293djld3xm62l5zasisaprx117k6h"; + + nativeBuildInputs = [ cmake python llvm ]; + + configureFlags = [ + "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" + ]; + + outputs = [ "dev" "out" ]; + + patches = [ + ./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory + ] ++ optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.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 '' + substituteInPlace cmake/config-ix.cmake \ + --replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)' + ''; + + enableParallelBuilding = true; +} diff --git a/pkgs/development/compilers/llvm/6/default.nix b/pkgs/development/compilers/llvm/6/default.nix index 3a7b66f1ed0ef..da5a97a9bbaac 100644 --- a/pkgs/development/compilers/llvm/6/default.nix +++ b/pkgs/development/compilers/llvm/6/default.nix @@ -14,7 +14,6 @@ let inherit sha256; }; - compiler-rt_src = fetch "compiler-rt" "16m7rvh3w6vq10iwkjrr1nn293djld3xm62l5zasisaprx117k6h"; clang-tools-extra_src = fetch "clang-tools-extra" "1ll9v6r29xfdiywbn9iss49ad39ah3fk91wiv0sr6k6k9i544fq5"; # Add man output without introducing extra dependencies. @@ -27,7 +26,6 @@ let in { llvm = overrideManOutput (callPackage ./llvm.nix { - inherit compiler-rt_src; inherit (targetLlvmLibraries) libcxxabi; }); clang-unwrapped = overrideManOutput (callPackage ./clang { @@ -43,11 +41,28 @@ let libstdcxxClang = wrapCCWith { cc = tools.clang-unwrapped; extraPackages = [ libstdcxxHook ]; + extraBuildCommands = stdenv.lib.optionalString stdenv.targetPlatform.isLinux '' + echo "--gcc-toolchain=${tools.clang-unwrapped.gcc}" >> $out/nix-support/cc-cflags + ''; }; - libcxxClang = wrapCCWith { + libcxxClang = wrapCCWith rec { cc = tools.clang-unwrapped; - extraPackages = [ targetLlvmLibraries.libcxx targetLlvmLibraries.libcxxabi ]; + extraPackages = [ + targetLlvmLibraries.libcxx + targetLlvmLibraries.libcxxabi + targetLlvmLibraries.compiler-rt + ]; + isCompilerRT = true; + extraBuildCommands = '' + rsrc="$out/resource-root" + mkdir "$rsrc" + ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc" + ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib" + echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags + '' + stdenv.lib.optionalString stdenv.targetPlatform.isLinux '' + echo "--gcc-toolchain=${tools.clang-unwrapped.gcc}" >> $out/nix-support/cc-cflags + ''; }; lld = callPackage ./lld.nix {}; @@ -59,6 +74,8 @@ let callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python2 isl release_version version fetch; }); in { + compiler-rt = callPackage ./compiler-rt.nix {}; + stdenv = overrideCC stdenv buildLlvmTools.clang; libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang; diff --git a/pkgs/development/compilers/llvm/6/llvm.nix b/pkgs/development/compilers/llvm/6/llvm.nix index 7cb3e88c2f85d..8877ccd116211 100644 --- a/pkgs/development/compilers/llvm/6/llvm.nix +++ b/pkgs/development/compilers/llvm/6/llvm.nix @@ -11,7 +11,6 @@ , version , release_version , zlib -, compiler-rt_src , libcxxabi , debugVersion ? false , enableManpages ? false @@ -33,8 +32,6 @@ in stdenv.mkDerivation (rec { unpackFile ${src} mv llvm-${version}* llvm sourceRoot=$PWD/llvm - unpackFile ${compiler-rt_src} - mv compiler-rt-* $sourceRoot/projects/compiler-rt ''; outputs = [ "out" "python" ] @@ -48,15 +45,7 @@ in stdenv.mkDerivation (rec { propagatedBuildInputs = [ ncurses zlib ]; - # 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 '' - substituteInPlace ./projects/compiler-rt/cmake/config-ix.cmake \ - --replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)' - substituteInPlace cmake/modules/AddLLVM.cmake \ --replace 'set(_install_name_dir INSTALL_NAME_DIR "@rpath")' "set(_install_name_dir INSTALL_NAME_DIR "$lib/lib")" \ --replace 'set(_install_rpath "@loader_path/../lib" ''${extra_libdir})' "" @@ -70,15 +59,11 @@ in stdenv.mkDerivation (rec { substituteInPlace unittests/Support/CMakeLists.txt \ --replace "Path.cpp" "" rm unittests/Support/Path.cpp - - # Revert compiler-rt commit that makes codesign mandatory - patch -p1 -i ${./compiler-rt-codesign.patch} -d projects/compiler-rt '' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl '' patch -p1 -i ${../TLI-musl.patch} substituteInPlace unittests/Support/CMakeLists.txt \ --replace "add_subdirectory(DynamicLibrary)" "" rm unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp - patch -p1 -i ${./sanitizers-nongnu.patch} -d projects/compiler-rt ''; # hacky fix: created binaries need to be run before installation @@ -93,7 +78,6 @@ in stdenv.mkDerivation (rec { "-DLLVM_BUILD_TESTS=ON" "-DLLVM_ENABLE_FFI=ON" "-DLLVM_ENABLE_RTTI=ON" - "-DCOMPILER_RT_INCLUDE_TESTS=OFF" # FIXME: requires clang source code ] ++ stdenv.lib.optional enableSharedLibraries "-DLLVM_LINK_LLVM_DYLIB=ON" diff --git a/pkgs/development/interpreters/php/default.nix b/pkgs/development/interpreters/php/default.nix index 94e1e5f1b6923..0e161b0e3f715 100644 --- a/pkgs/development/interpreters/php/default.nix +++ b/pkgs/development/interpreters/php/default.nix @@ -353,7 +353,7 @@ in { }; php72 = generic { - version = "7.2.5"; - sha256 = "0cb0g64mzkir81js27vjwqr8vh043f62ynqvds5n4ygsivx0x0pk"; + version = "7.2.6"; + sha256 = "1hzj1z6v1ij4f4zjl1giix9qinf20wyn9gf8s29x5fc0va53wpdf"; }; } diff --git a/pkgs/os-specific/linux/kernel/linux-4.14.nix b/pkgs/os-specific/linux/kernel/linux-4.14.nix index a9e2cd7c5c1e6..c1246e56dea13 100644 --- a/pkgs/os-specific/linux/kernel/linux-4.14.nix +++ b/pkgs/os-specific/linux/kernel/linux-4.14.nix @@ -3,13 +3,13 @@ with stdenv.lib; buildLinux (args // rec { - version = "4.14.43"; + version = "4.14.44"; # branchVersion needs to be x.y extraMeta.branch = concatStrings (intersperse "." (take 2 (splitString "." version))); src = fetchurl { url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz"; - sha256 = "0jkikvjsrz7wk1zx57brzhhs15gbx022f1as4mn0017az7wc0gqk"; + sha256 = "1r68dvcyidnmr4d49rq58lidy32fijz08xzymxjwmxi5mzk5dcrf"; }; } // (args.argsOverride or {})) diff --git a/pkgs/os-specific/linux/kernel/linux-4.16.nix b/pkgs/os-specific/linux/kernel/linux-4.16.nix index 5aebbd6c1e1b6..c2bebb361342b 100644 --- a/pkgs/os-specific/linux/kernel/linux-4.16.nix +++ b/pkgs/os-specific/linux/kernel/linux-4.16.nix @@ -3,7 +3,7 @@ with stdenv.lib; buildLinux (args // rec { - version = "4.16.11"; + version = "4.16.12"; # modDirVersion needs to be x.y.z, will automatically add .0 if needed modDirVersion = concatStrings (intersperse "." (take 3 (splitString "." "${version}.0"))); @@ -13,6 +13,6 @@ buildLinux (args // rec { src = fetchurl { url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz"; - sha256 = "088931hgi5acm8nz19nd09skmamr3hhfb958374j30br6f94pfkd"; + sha256 = "078if7mmlq4csv0d7x7rpsc8zs7m6rpz75h6878r0d2silsphw2n"; }; } // (args.argsOverride or {})) diff --git a/pkgs/os-specific/linux/kernel/linux-4.4.nix b/pkgs/os-specific/linux/kernel/linux-4.4.nix index dd946c2813165..409bc590ac06f 100644 --- a/pkgs/os-specific/linux/kernel/linux-4.4.nix +++ b/pkgs/os-specific/linux/kernel/linux-4.4.nix @@ -1,11 +1,11 @@ { stdenv, buildPackages, hostPlatform, fetchurl, perl, buildLinux, ... } @ args: buildLinux (args // rec { - version = "4.4.132"; + version = "4.4.133"; extraMeta.branch = "4.4"; src = fetchurl { url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz"; - sha256 = "0d06dv7maspgv33dlc6r8cb8pkpg4q2vxbpzz6285n0ah4fb05f4"; + sha256 = "0vhg23i49s4k8lbsrs8y6rvqjld84qgifmim5qcrndr6yj68fmk0"; }; } // (args.argsOverride or {})) diff --git a/pkgs/os-specific/linux/kernel/linux-4.9.nix b/pkgs/os-specific/linux/kernel/linux-4.9.nix index e550f4d44f8f3..bf74d91a7d7b3 100644 --- a/pkgs/os-specific/linux/kernel/linux-4.9.nix +++ b/pkgs/os-specific/linux/kernel/linux-4.9.nix @@ -1,11 +1,11 @@ { stdenv, buildPackages, hostPlatform, fetchurl, perl, buildLinux, ... } @ args: buildLinux (args // rec { - version = "4.9.102"; + version = "4.9.103"; extraMeta.branch = "4.9"; src = fetchurl { url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz"; - sha256 = "1icx253l8s158d1ccn594ddkqdxch8jr0w6kbj00jn1dlmms6mfi"; + sha256 = "1n4kqa0yf5svg8jk647h4awz3ygq696yi0agnmbz0alxnynffsij"; }; } // (args.argsOverride or {})) diff --git a/pkgs/test/cc-wrapper/default.nix b/pkgs/test/cc-wrapper/default.nix index 41a7685ed2e01..06113e40561bb 100644 --- a/pkgs/test/cc-wrapper/default.nix +++ b/pkgs/test/cc-wrapper/default.nix @@ -38,6 +38,11 @@ stdenv.mkDerivation { NIX_LDFLAGS="-L$NIX_BUILD_TOP/foo/lib -rpath $NIX_BUILD_TOP/foo/lib" $CC -lfoo -o ldflags-check ${./ldflags-main.c} ./ldflags-check + '' + stdenv.lib.optionalString (stdenv.cc.isCompilerRT or false) '' + + $CC -o sanitizers -fsanitize=address,undefined ${./sanitizers.c} + ./sanitizers + '' + '' touch $out ''; diff --git a/pkgs/test/cc-wrapper/sanitizers.c b/pkgs/test/cc-wrapper/sanitizers.c new file mode 100644 index 0000000000000..93dd78a903ce0 --- /dev/null +++ b/pkgs/test/cc-wrapper/sanitizers.c @@ -0,0 +1,8 @@ +#include <sanitizer/asan_interface.h> +#include <stdio.h> + +int main(int argc, char **argv) +{ + fprintf(stderr, "ok\n"); + return 0; +} |