diff options
Diffstat (limited to 'pkgs/development/compilers')
28 files changed, 161 insertions, 116 deletions
diff --git a/pkgs/development/compilers/binaryen/default.nix b/pkgs/development/compilers/binaryen/default.nix index bb933eac9af00..bd59b66f51fac 100644 --- a/pkgs/development/compilers/binaryen/default.nix +++ b/pkgs/development/compilers/binaryen/default.nix @@ -13,13 +13,20 @@ stdenv.mkDerivation rec { hash = "sha256-gMwbWiP+YDCVafQMBWhTuJGWmkYtnhEdn/oofKaUT08="; }; - # Fix build with Node 20 # FIXME: remove for next release patches = [ (fetchpatch { + name = "nodejs-20.patch"; url = "https://github.com/WebAssembly/binaryen/commit/889422e0c92552ff484659f9b41e777ba7ab35c1.patch"; hash = "sha256-acM8mytL9nhm4np9tpUbd1X0wJ7y308HV2fvgcAW1lY="; }) + + # Fix fmin tests on gcc-13: https://github.com/WebAssembly/binaryen/pull/5994 + (fetchpatch { + name = "gcc-13.patch"; + url = "https://github.com/WebAssembly/binaryen/commit/1e17dfb695a19d5d41f1f88411fbcbc5f2408c8f.patch"; + hash = "sha256-5JZh15CXkg5XdTG8eRJXPwO+zmymYeFjKbHutRPTmlU="; + }) ]; nativeBuildInputs = [ cmake python3 ]; diff --git a/pkgs/development/compilers/blueprint/default.nix b/pkgs/development/compilers/blueprint/default.nix index 99b275db2aa6a..f52b43f49a82a 100644 --- a/pkgs/development/compilers/blueprint/default.nix +++ b/pkgs/development/compilers/blueprint/default.nix @@ -45,7 +45,8 @@ stdenv.mkDerivation (finalAttrs: { ]; # requires xvfb-run - doCheck = !stdenv.isDarwin; + doCheck = !stdenv.isDarwin + && false; # tests time out checkPhase = '' runHook preCheck diff --git a/pkgs/development/compilers/dtc/default.nix b/pkgs/development/compilers/dtc/default.nix index d9013895becc2..adc3ed7aaac89 100644 --- a/pkgs/development/compilers/dtc/default.nix +++ b/pkgs/development/compilers/dtc/default.nix @@ -1,6 +1,6 @@ { stdenv , lib -, fetchgit +, fetchzip , fetchpatch , meson , ninja @@ -18,9 +18,8 @@ stdenv.mkDerivation (finalAttrs: { pname = "dtc"; version = "1.7.0"; - src = fetchgit { - url = "https://git.kernel.org/pub/scm/utils/dtc/dtc.git"; - rev = "refs/tags/v${finalAttrs.version}"; + src = fetchzip { + url = "https://git.kernel.org/pub/scm/utils/dtc/dtc.git/snapshot/dtc-v${finalAttrs.version}.tar.gz"; sha256 = "sha256-FMh3VvlY3fUK8fbd0M+aCmlUrmG9YegiOOQ7MOByffc="; }; diff --git a/pkgs/development/compilers/gcc/default.nix b/pkgs/development/compilers/gcc/default.nix index eef6faf26424e..e0ca04a138787 100644 --- a/pkgs/development/compilers/gcc/default.nix +++ b/pkgs/development/compilers/gcc/default.nix @@ -406,8 +406,9 @@ lib.pipe ((callFile ./common/builder.nix {}) ({ passthru = { inherit langC langCC langObjC langObjCpp langAda langFortran langGo langD langJava version; isGNU = true; - } // lib.optionalAttrs (!atLeast12) { - hardeningUnsupportedFlags = lib.optionals is48 [ "stackprotector" ] ++ [ "fortify3" ]; + hardeningUnsupportedFlags = lib.optional is48 "stackprotector" + ++ lib.optional (!atLeast12) "fortify3" + ++ lib.optionals (langFortran) [ "fortify" "format" ]; }; enableParallelBuilding = true; diff --git a/pkgs/development/compilers/ghc/8.10.2-binary.nix b/pkgs/development/compilers/ghc/8.10.2-binary.nix index d04e85777775e..c8d645cfa361a 100644 --- a/pkgs/development/compilers/ghc/8.10.2-binary.nix +++ b/pkgs/development/compilers/ghc/8.10.2-binary.nix @@ -252,6 +252,8 @@ stdenv.mkDerivation rec { '' patchShebangs ghc-${version}/utils/ patchShebangs ghc-${version}/configure + test -d ghc-${version}/inplace/bin && \ + patchShebangs ghc-${version}/inplace/bin '' + # We have to patch the GMP paths for the integer-gmp package. # Note [musl bindists have no .buildinfo] diff --git a/pkgs/development/compilers/ghc/8.10.7-binary.nix b/pkgs/development/compilers/ghc/8.10.7-binary.nix index f373d963ed285..3376671d65b41 100644 --- a/pkgs/development/compilers/ghc/8.10.7-binary.nix +++ b/pkgs/development/compilers/ghc/8.10.7-binary.nix @@ -250,6 +250,8 @@ stdenv.mkDerivation rec { '' patchShebangs ghc-${version}/utils/ patchShebangs ghc-${version}/configure + test -d ghc-${version}/inplace/bin && \ + patchShebangs ghc-${version}/inplace/bin '' + # We have to patch the GMP paths for the integer-gmp package. # Note that musl bindists do not contain them, diff --git a/pkgs/development/compilers/ghc/8.6.5-binary.nix b/pkgs/development/compilers/ghc/8.6.5-binary.nix index 58e61604cd61a..5f9d6c824d428 100644 --- a/pkgs/development/compilers/ghc/8.6.5-binary.nix +++ b/pkgs/development/compilers/ghc/8.6.5-binary.nix @@ -102,6 +102,8 @@ stdenv.mkDerivation rec { '' patchShebangs ghc-${version}/utils/ patchShebangs ghc-${version}/configure + test -d ghc-${version}/inplace/bin && \ + patchShebangs ghc-${version}/inplace/bin '' + # We have to patch the GMP paths for the integer-gmp package. diff --git a/pkgs/development/compilers/ghc/9.2.4-binary.nix b/pkgs/development/compilers/ghc/9.2.4-binary.nix index 909d090c17040..77d70d2950707 100644 --- a/pkgs/development/compilers/ghc/9.2.4-binary.nix +++ b/pkgs/development/compilers/ghc/9.2.4-binary.nix @@ -236,6 +236,8 @@ stdenv.mkDerivation rec { '' patchShebangs ghc-${version}/utils/ patchShebangs ghc-${version}/configure + test -d ghc-${version}/inplace/bin && \ + patchShebangs ghc-${version}/inplace/bin '' + # We have to patch the GMP paths for the integer-gmp package. '' diff --git a/pkgs/development/compilers/glslang/default.nix b/pkgs/development/compilers/glslang/default.nix index 0f75d09098be7..ff55201ebd03f 100644 --- a/pkgs/development/compilers/glslang/default.nix +++ b/pkgs/development/compilers/glslang/default.nix @@ -26,9 +26,6 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake python3 bison jq ]; - # Workaround missing atomic ops with gcc <13 - env.LDFLAGS = lib.optionalString stdenv.hostPlatform.isRiscV "-latomic"; - postPatch = '' cp --no-preserve=mode -r "${spirv-tools.src}" External/spirv-tools ln -s "${spirv-headers.src}" External/spirv-tools/external/spirv-headers diff --git a/pkgs/development/compilers/llvm/11/clang/default.nix b/pkgs/development/compilers/llvm/11/clang/default.nix index a4fe7199e080d..0e61930f1c0e7 100644 --- a/pkgs/development/compilers/llvm/11/clang/default.nix +++ b/pkgs/development/compilers/llvm/11/clang/default.nix @@ -50,7 +50,7 @@ let # https://reviews.llvm.org/D51899 ./gnu-install-dirs.patch (substituteAll { - src = ../../clang-11-12-LLVMgold-path.patch; + src = ../../clang-11-15-LLVMgold-path.patch; libllvmLibdir = "${libllvm.lib}/lib"; }) ]; diff --git a/pkgs/development/compilers/llvm/12/clang/default.nix b/pkgs/development/compilers/llvm/12/clang/default.nix index 7ecd4efc08378..c46776d38ac3d 100644 --- a/pkgs/development/compilers/llvm/12/clang/default.nix +++ b/pkgs/development/compilers/llvm/12/clang/default.nix @@ -47,7 +47,7 @@ let # https://reviews.llvm.org/D51899 ./gnu-install-dirs.patch (substituteAll { - src = ../../clang-11-12-LLVMgold-path.patch; + src = ../../clang-11-15-LLVMgold-path.patch; libllvmLibdir = "${libllvm.lib}/lib"; }) ]; diff --git a/pkgs/development/compilers/llvm/13/clang/default.nix b/pkgs/development/compilers/llvm/13/clang/default.nix index a070e64c7ddd9..6604ae0efc3f1 100644 --- a/pkgs/development/compilers/llvm/13/clang/default.nix +++ b/pkgs/development/compilers/llvm/13/clang/default.nix @@ -43,7 +43,7 @@ let ./revert-malloc-alignment-assumption.patch ../../common/clang/add-nostdlibinc-flag.patch (substituteAll { - src = ../../clang-11-12-LLVMgold-path.patch; + src = ../../clang-11-15-LLVMgold-path.patch; libllvmLibdir = "${libllvm.lib}/lib"; }) ]; diff --git a/pkgs/development/compilers/llvm/14/clang/default.nix b/pkgs/development/compilers/llvm/14/clang/default.nix index 976ff7580ac31..9f0da7a9f46cb 100644 --- a/pkgs/development/compilers/llvm/14/clang/default.nix +++ b/pkgs/development/compilers/llvm/14/clang/default.nix @@ -46,7 +46,7 @@ let ./gnu-install-dirs.patch ../../common/clang/add-nostdlibinc-flag.patch (substituteAll { - src = ../../clang-11-12-LLVMgold-path.patch; + src = ../../clang-11-15-LLVMgold-path.patch; libllvmLibdir = "${libllvm.lib}/lib"; }) ]; diff --git a/pkgs/development/compilers/llvm/15/clang/default.nix b/pkgs/development/compilers/llvm/15/clang/default.nix index 894db1a4975f6..c49d6368cb97c 100644 --- a/pkgs/development/compilers/llvm/15/clang/default.nix +++ b/pkgs/development/compilers/llvm/15/clang/default.nix @@ -52,7 +52,7 @@ let ./gnu-install-dirs.patch ../../common/clang/add-nostdlibinc-flag.patch (substituteAll { - src = ../../clang-11-12-LLVMgold-path.patch; + src = ../../clang-11-15-LLVMgold-path.patch; libllvmLibdir = "${libllvm.lib}/lib"; }) ]; diff --git a/pkgs/development/compilers/llvm/16/clang/default.nix b/pkgs/development/compilers/llvm/16/clang/default.nix index b801bdda52923..5f28e810f603f 100644 --- a/pkgs/development/compilers/llvm/16/clang/default.nix +++ b/pkgs/development/compilers/llvm/16/clang/default.nix @@ -1,6 +1,6 @@ { lib, stdenv, llvm_meta , monorepoSrc, runCommand -, cmake, ninja, libxml2, libllvm, version, python3 +, substituteAll, cmake, ninja, libxml2, libllvm, version, python3 , buildLlvmTools , fixDarwinDylibNames , enableManpages ? false @@ -51,11 +51,10 @@ let # https://reviews.llvm.org/D51899 ./gnu-install-dirs.patch ../../common/clang/add-nostdlibinc-flag.patch - # FIMXE: do we need this patch? - # (substituteAll { - # src = ../../clang-11-12-LLVMgold-path.patch; - # libllvmLibdir = "${libllvm.lib}/lib"; - # }) + (substituteAll { + src = ../../clang-at-least-16-LLVMgold-path.patch; + libllvmLibdir = "${libllvm.lib}/lib"; + }) ]; postPatch = '' diff --git a/pkgs/development/compilers/llvm/16/llvm/default.nix b/pkgs/development/compilers/llvm/16/llvm/default.nix index 9994076bbdab7..a6faf9fd635d4 100644 --- a/pkgs/development/compilers/llvm/16/llvm/default.nix +++ b/pkgs/development/compilers/llvm/16/llvm/default.nix @@ -325,7 +325,8 @@ in "-DSPHINX_OUTPUT_MAN=ON" "-DSPHINX_OUTPUT_HTML=OFF" "-DSPHINX_WARNINGS_AS_ERRORS=OFF" - ] ++ optionals (false) [ + ] ++ optionals enableGoldPlugin [ + # For LLVMgold plugin "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include" ] ++ optionals isDarwin [ "-DLLVM_ENABLE_LIBCXX=ON" diff --git a/pkgs/development/compilers/llvm/17/clang/default.nix b/pkgs/development/compilers/llvm/17/clang/default.nix index a576c07d36617..3184437830a20 100644 --- a/pkgs/development/compilers/llvm/17/clang/default.nix +++ b/pkgs/development/compilers/llvm/17/clang/default.nix @@ -1,6 +1,6 @@ { lib, stdenv, llvm_meta , monorepoSrc, runCommand -, cmake, ninja, libxml2, libllvm, version, python3 +, substituteAll, cmake, ninja, libxml2, libllvm, version, python3 , buildLlvmTools , fixDarwinDylibNames , enableManpages ? false @@ -52,11 +52,10 @@ let # https://reviews.llvm.org/D51899 ./gnu-install-dirs.patch ../../common/clang/add-nostdlibinc-flag.patch - # FIMXE: do we need this patch? - # (substituteAll { - # src = ../../clang-11-12-LLVMgold-path.patch; - # libllvmLibdir = "${libllvm.lib}/lib"; - # }) + (substituteAll { + src = ../../clang-at-least-16-LLVMgold-path.patch; + libllvmLibdir = "${libllvm.lib}/lib"; + }) ]; postPatch = '' diff --git a/pkgs/development/compilers/llvm/17/llvm/default.nix b/pkgs/development/compilers/llvm/17/llvm/default.nix index 3d05837d45da5..b38fef333135e 100644 --- a/pkgs/development/compilers/llvm/17/llvm/default.nix +++ b/pkgs/development/compilers/llvm/17/llvm/default.nix @@ -8,8 +8,7 @@ , python3 , python3Packages , libffi -# TODO: Gold plugin on LLVM16 has a severe memory corruption bug: https://github.com/llvm/llvm-project/issues/61350. -, enableGoldPlugin ? false +, enableGoldPlugin ? true , libbfd , libpfm , libxml2 @@ -66,8 +65,8 @@ let else python3; in - assert (lib.assertMsg (!enableGoldPlugin) "Gold plugin cannot be enabled on LLVM16 due to a upstream issue: https://github.com/llvm/llvm-project/issues/61350"); - stdenv.mkDerivation (rec { + +stdenv.mkDerivation (rec { pname = "llvm"; inherit version; @@ -325,7 +324,8 @@ in "-DSPHINX_OUTPUT_MAN=ON" "-DSPHINX_OUTPUT_HTML=OFF" "-DSPHINX_WARNINGS_AS_ERRORS=OFF" - ] ++ optionals (false) [ + ] ++ optionals enableGoldPlugin [ + # For LLVMgold plugin "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include" ] ++ optionals isDarwin [ "-DLLVM_ENABLE_LIBCXX=ON" diff --git a/pkgs/development/compilers/llvm/clang-11-12-LLVMgold-path.patch b/pkgs/development/compilers/llvm/clang-11-15-LLVMgold-path.patch index 8f8991976f33c..8f8991976f33c 100644 --- a/pkgs/development/compilers/llvm/clang-11-12-LLVMgold-path.patch +++ b/pkgs/development/compilers/llvm/clang-11-15-LLVMgold-path.patch diff --git a/pkgs/development/compilers/llvm/clang-at-least-16-LLVMgold-path.patch b/pkgs/development/compilers/llvm/clang-at-least-16-LLVMgold-path.patch new file mode 100644 index 0000000000000..74cdbacc8a717 --- /dev/null +++ b/pkgs/development/compilers/llvm/clang-at-least-16-LLVMgold-path.patch @@ -0,0 +1,14 @@ +diff --git a/lib/Driver/ToolChains/CommonArgs.cpp b/lib/Driver/ToolChains/CommonArgs.cpp +index 34640b3c450d..93c4a4f4ec5c 100644 +--- a/lib/Driver/ToolChains/CommonArgs.cpp ++++ b/lib/Driver/ToolChains/CommonArgs.cpp +@@ -589,8 +589,7 @@ void tools::addLTOOptions(const ToolChain &ToolChain, const ArgList &Args, + #endif + + SmallString<1024> Plugin; +- llvm::sys::path::native(Twine(D.Dir) + +- "/../" CLANG_INSTALL_LIBDIR_BASENAME + ++ llvm::sys::path::native(Twine("@libllvmLibdir@") + + PluginName + Suffix, + Plugin); + CmdArgs.push_back(Args.MakeArgString(Twine(PluginPrefix) + Plugin)); diff --git a/pkgs/development/compilers/llvm/git/clang/default.nix b/pkgs/development/compilers/llvm/git/clang/default.nix index b193ebba3d6d1..d8fe08569f3f7 100644 --- a/pkgs/development/compilers/llvm/git/clang/default.nix +++ b/pkgs/development/compilers/llvm/git/clang/default.nix @@ -1,6 +1,6 @@ { lib, stdenv, llvm_meta , monorepoSrc, runCommand -, cmake, ninja, libxml2, libllvm, version, python3 +, substituteAll, cmake, ninja, libxml2, libllvm, version, python3 , buildLlvmTools , fixDarwinDylibNames , enableManpages ? false @@ -52,11 +52,10 @@ let # https://reviews.llvm.org/D51899 ./gnu-install-dirs.patch ../../common/clang/add-nostdlibinc-flag.patch - # FIMXE: do we need this patch? - # (substituteAll { - # src = ../../clang-11-12-LLVMgold-path.patch; - # libllvmLibdir = "${libllvm.lib}/lib"; - # }) + (substituteAll { + src = ../../clang-at-least-16-LLVMgold-path.patch; + libllvmLibdir = "${libllvm.lib}/lib"; + }) ]; postPatch = '' diff --git a/pkgs/development/compilers/llvm/git/llvm/default.nix b/pkgs/development/compilers/llvm/git/llvm/default.nix index 3d05837d45da5..36edfee8a091a 100644 --- a/pkgs/development/compilers/llvm/git/llvm/default.nix +++ b/pkgs/development/compilers/llvm/git/llvm/default.nix @@ -8,8 +8,7 @@ , python3 , python3Packages , libffi -# TODO: Gold plugin on LLVM16 has a severe memory corruption bug: https://github.com/llvm/llvm-project/issues/61350. -, enableGoldPlugin ? false +, enableGoldPlugin ? true , libbfd , libpfm , libxml2 @@ -66,8 +65,8 @@ let else python3; in - assert (lib.assertMsg (!enableGoldPlugin) "Gold plugin cannot be enabled on LLVM16 due to a upstream issue: https://github.com/llvm/llvm-project/issues/61350"); - stdenv.mkDerivation (rec { + +stdenv.mkDerivation (rec { pname = "llvm"; inherit version; @@ -325,7 +324,7 @@ in "-DSPHINX_OUTPUT_MAN=ON" "-DSPHINX_OUTPUT_HTML=OFF" "-DSPHINX_WARNINGS_AS_ERRORS=OFF" - ] ++ optionals (false) [ + ] ++ optionals enableGoldPlugin [ "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include" ] ++ optionals isDarwin [ "-DLLVM_ENABLE_LIBCXX=ON" diff --git a/pkgs/development/compilers/rust/1_74.nix b/pkgs/development/compilers/rust/1_74.nix deleted file mode 100644 index 163c64c249b7e..0000000000000 --- a/pkgs/development/compilers/rust/1_74.nix +++ /dev/null @@ -1,61 +0,0 @@ -# New rust versions should first go to staging. -# Things to check after updating: -# 1. Rustc should produce rust binaries on x86_64-linux, aarch64-linux and x86_64-darwin: -# i.e. nix-shell -p fd or @GrahamcOfBorg build fd on github -# This testing can be also done by other volunteers as part of the pull -# request review, in case platforms cannot be covered. -# 2. The LLVM version used for building should match with rust upstream. -# Check the version number in the src/llvm-project git submodule in: -# https://github.com/rust-lang/rust/blob/<version-tag>/.gitmodules -# 3. Firefox and Thunderbird should still build on x86_64-linux. - -{ stdenv, lib -, buildPackages -, targetPackages -, newScope, callPackage -, CoreFoundation, Security, SystemConfiguration -, pkgsBuildTarget, pkgsBuildBuild, pkgsBuildHost -, makeRustPlatform -, wrapRustcWith -, llvmPackages_16, llvm_16 -} @ args: - -import ./default.nix { - rustcVersion = "1.74.0"; - rustcSha256 = "sha256-iCtYS8Mhxdz+d82qafJ3kGuTYlXveAj81cdJKSXPEEk="; - - llvmSharedForBuild = pkgsBuildBuild.llvmPackages_16.libllvm.override { enableSharedLibraries = true; }; - llvmSharedForHost = pkgsBuildHost.llvmPackages_16.libllvm.override { enableSharedLibraries = true; }; - llvmSharedForTarget = pkgsBuildTarget.llvmPackages_16.libllvm.override { enableSharedLibraries = true; }; - - # For use at runtime - llvmShared = llvm_16.override { enableSharedLibraries = true; }; - - # Expose llvmPackages used for rustc from rustc via passthru for LTO in Firefox - llvmPackages = llvmPackages_16; - - # Note: the version MUST be one version prior to the version we're - # building - bootstrapVersion = "1.73.0"; - - # fetch hashes by running `print-hashes.sh ${bootstrapVersion}` - bootstrapHashes = { - i686-unknown-linux-gnu = "6a088acbbda734d27e8b431499f1d746de7781673b88fead3aeae072be1d1a5a"; - x86_64-unknown-linux-gnu = "aa4cf0b7e66a9f5b7c623d4b340bb1ac2864a5f2c2b981f39f796245dc84f2cb"; - x86_64-unknown-linux-musl = "c888457d106ccd40288ca8db1cb966b23d719c9a128daca701ecc574c53773d4"; - arm-unknown-linux-gnueabihf = "9c29bb42786aedbb16ea71564eb06068a8b01cca6c6b8857f0c37f91dfba7134"; - armv7-unknown-linux-gnueabihf = "092b32b82c602c18279d76d9a96763e85030aa62cda64c1bc73fc1f6355bb99c"; - aarch64-unknown-linux-gnu = "e54d7d886ba413ae573151f668e76ea537f9a44406d3d29598269a4a536d12f6"; - aarch64-unknown-linux-musl = "f4e9ff895aa55558777585ad4debe2ccf3c0298cb5d65db67814f62428de4a5b"; - x86_64-apple-darwin = "ece9646bb153d4bc0f7f1443989de0cbcd8989a7d0bf3b7fb9956e1223954f0c"; - aarch64-apple-darwin = "9c96e4c57328fb438ee2d87aa75970ce89b4426b49780ccb3c16af0d7c617cc6"; - powerpc64le-unknown-linux-gnu = "8fa215ee3e274fb64364e7084613bc570369488fa22cf5bc8e0fe6dc810fe2b9"; - riscv64gc-unknown-linux-gnu = "381379a2381835428b2e7a396b3046581517356b7cc851e39e385aebd5700623"; - }; - - selectRustPackage = pkgs: pkgs.rust_1_74; - - rustcPatches = [ ]; -} - -(builtins.removeAttrs args [ "pkgsBuildTarget" "pkgsBuildHost" "llvmPackages_16" "llvm_16"]) diff --git a/pkgs/development/compilers/rust/1_75.nix b/pkgs/development/compilers/rust/1_75.nix new file mode 100644 index 0000000000000..829b26cac3674 --- /dev/null +++ b/pkgs/development/compilers/rust/1_75.nix @@ -0,0 +1,61 @@ +# New rust versions should first go to staging. +# Things to check after updating: +# 1. Rustc should produce rust binaries on x86_64-linux, aarch64-linux and x86_64-darwin: +# i.e. nix-shell -p fd or @GrahamcOfBorg build fd on github +# This testing can be also done by other volunteers as part of the pull +# request review, in case platforms cannot be covered. +# 2. The LLVM version used for building should match with rust upstream. +# Check the version number in the src/llvm-project git submodule in: +# https://github.com/rust-lang/rust/blob/<version-tag>/.gitmodules +# 3. Firefox and Thunderbird should still build on x86_64-linux. + +{ stdenv, lib +, buildPackages +, targetPackages +, newScope, callPackage +, CoreFoundation, Security, SystemConfiguration +, pkgsBuildTarget, pkgsBuildBuild, pkgsBuildHost +, makeRustPlatform +, wrapRustcWith +, llvmPackages_17, llvm_17 +} @ args: + +import ./default.nix { + rustcVersion = "1.75.0"; + rustcSha256 = "sha256-W3OfRbydNB4tHFcNZdI3VZHiLC0j71uKN3EaA4arwIg="; + + llvmSharedForBuild = pkgsBuildBuild.llvmPackages_17.libllvm.override { enableSharedLibraries = true; }; + llvmSharedForHost = pkgsBuildHost.llvmPackages_17.libllvm.override { enableSharedLibraries = true; }; + llvmSharedForTarget = pkgsBuildTarget.llvmPackages_17.libllvm.override { enableSharedLibraries = true; }; + + # For use at runtime + llvmShared = llvm_17.override { enableSharedLibraries = true; }; + + # Expose llvmPackages used for rustc from rustc via passthru for LTO in Firefox + llvmPackages = llvmPackages_17; + + # Note: the version MUST be one version prior to the version we're + # building + bootstrapVersion = "1.74.1"; + + # fetch hashes by running `print-hashes.sh ${bootstrapVersion}` + bootstrapHashes = { + i686-unknown-linux-gnu = "b883b98372c91bc6aa9dc6ebb2b4e02e7dacbbc2ac1ebe55923dc37134df70a4"; + x86_64-unknown-linux-gnu = "d206888a2a9d55113940151ba16117ce2456d7de021bab18cfcb06dc48d3157c"; + x86_64-unknown-linux-musl = "5af3115a1f16431630f288821bd7f3be8cf7e08a7611b3c3bce3976774aa6cd2"; + arm-unknown-linux-gnueabihf = "1dd7d835af4afe9adb7f785046c907090ace66f1c975cfe9e8886847310d8ec9"; + armv7-unknown-linux-gnueabihf = "a5038ae004bf86eed64ef67329f7ba047bb4d188663bfd260320d53a2fed33c4"; + aarch64-unknown-linux-gnu = "0dbdfce647f3c7d9ff00a7aa5d6dbbd7010486f803a9749cff46189f5ecb438c"; + aarch64-unknown-linux-musl = "02674b8e4311780464313c5773d43606fbf6880d5c4512930d59b6d5d369f0de"; + x86_64-apple-darwin = "54e1ef01d73f6031fbee36bbecd9af4209eb682dea478696e8282ca64d5792e5"; + aarch64-apple-darwin = "af6a982cbed85807fb8e5c4ba85b8a76162b58945f4787e0a7dec32e901e8b3b"; + powerpc64le-unknown-linux-gnu = "bb1c9f0ab1016a2817afe8f72c03f8f1787fe44d0f9999669e0c1957a08e6213"; + riscv64gc-unknown-linux-gnu = "86561a8d630f634fdd7cb5899d40027103c907d9763a32770b7e2fd57dbd8473"; + }; + + selectRustPackage = pkgs: pkgs.rust_1_75; + + rustcPatches = [ ]; +} + +(builtins.removeAttrs args [ "pkgsBuildTarget" "pkgsBuildHost" "llvmPackages_17" "llvm_17"]) diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix index 7fe33a4011e56..6e0afa1b8f571 100644 --- a/pkgs/development/compilers/rust/rustc.nix +++ b/pkgs/development/compilers/rust/rustc.nix @@ -65,6 +65,8 @@ in stdenv.mkDerivation (finalAttrs: { # Increase codegen units to introduce parallelism within the compiler. RUSTFLAGS = "-Ccodegen-units=10"; + RUSTDOCFLAGS = "-A rustdoc::broken-intra-doc-links"; + # We need rust to build rust. If we don't provide it, configure will try to download it. # Reference: https://github.com/rust-lang/rust/blob/master/src/bootstrap/configure.py configureFlags = let @@ -100,6 +102,10 @@ in stdenv.mkDerivation (finalAttrs: { "--target=${concatStringsSep "," ([ stdenv.targetPlatform.rust.rustcTargetSpec + # Other targets that don't need any extra dependencies to build. + ] ++ optionals (!fastCross) [ + "wasm32-unknown-unknown" + # (build!=target): When cross-building a compiler we need to add # the build platform as well so rustc can compile build.rs # scripts. @@ -201,7 +207,7 @@ in stdenv.mkDerivation (finalAttrs: { # to do this when rustc's target platform is dynamically linked musl. # # [1]: https://github.com/rust-lang/compiler-team/issues/422 - substituteInPlace compiler/rustc_target/src/spec/linux_musl_base.rs \ + substituteInPlace compiler/rustc_target/src/spec/base/linux_musl.rs \ --replace "base.crt_static_default = true" "base.crt_static_default = false" '' + lib.optionalString (stdenv.isDarwin && stdenv.isx86_64) '' # See https://github.com/jemalloc/jemalloc/issues/1997 diff --git a/pkgs/development/compilers/spirv-llvm-translator/default.nix b/pkgs/development/compilers/spirv-llvm-translator/default.nix index f19501a6d7d82..4db3b93217d7f 100644 --- a/pkgs/development/compilers/spirv-llvm-translator/default.nix +++ b/pkgs/development/compilers/spirv-llvm-translator/default.nix @@ -7,6 +7,7 @@ , llvm , spirv-headers , spirv-tools +, disable-warnings-if-gcc13 }: let @@ -28,16 +29,16 @@ let rev = "v${version}"; hash = "sha256-OsDohXRxovtEXaWiRGp8gJ0dXmoALyO+ZimeSO8aPVI="; } else if llvmMajor == "14" then rec{ - version = "14.0.0"; - rev = "v${version}"; - hash = "sha256-BhNAApgZ/w/92XjpoDY6ZEIhSTwgJ4D3/EfNvPmNM2o="; + version = "14.0.0+unstable-2023-06-22"; + rev = "23f398bf369093b1fd67459db8071ffcc6b92658"; + hash = "sha256-o7cVj5/ZMER2CvfxL4pRb2qCIxC/HFUPiitf2fKtCyk="; } else if llvmMajor == "11" then { - version = "unstable-2022-05-04"; + version = "11.0.0+unstable-2022-05-04"; rev = "4ef524240833abfeee1c5b9fff6b1bd53f4806b3"; # 267 commits ahead of v11.0.0 hash = "sha256-NoIoa20+2sH41rEnr8lsMhtfesrtdPINiXtUnxYVm8s="; } else throw "Incompatible LLVM version."; in -stdenv.mkDerivation { +disable-warnings-if-gcc13 (stdenv.mkDerivation { pname = "SPIRV-LLVM-Translator"; inherit (branch) version; @@ -47,12 +48,19 @@ stdenv.mkDerivation { inherit (branch) rev hash; }; - patches = lib.optionals (llvmMajor == "16")[ + patches = lib.optionals (llvmMajor == "16") [ # Fixes builds that link against external LLVM dynamic library (fetchpatch { url = "https://github.com/KhronosGroup/SPIRV-LLVM-Translator/commit/f3b9b604d7eda18d0d1029d94a6eebd33aa3a3fe.patch"; hash = "sha256-opDjyZcy7O4wcSfm/A51NCIiDyIvbcmbv9ns1njdJbc="; }) + ] ++ lib.optionals (llvmMajor == "14") [ + (fetchpatch { + # tries to install llvm-spirv into llvm nix store path + url = "https://github.com/KhronosGroup/SPIRV-LLVM-Translator/commit/cce9a2f130070d799000cac42fe24789d2b777ab.patch"; + revert = true; + hash = "sha256-GbFacttZRDCgA0jkUoFA4/B3EDn3etweKvM09OwICJ8="; + }) ]; nativeBuildInputs = [ pkg-config cmake ] @@ -70,7 +78,7 @@ stdenv.mkDerivation { "-DLLVM_SPIRV_BUILD_EXTERNAL=YES" # RPATH of binary /nix/store/.../bin/llvm-spirv contains a forbidden reference to /build/ "-DCMAKE_SKIP_BUILD_RPATH=ON" - ] ++ lib.optionals (llvmMajor != "11") [ "-DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=${spirv-headers.src}" ]; + ] ++ lib.optional (llvmMajor != "11") "-DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=${spirv-headers.src}"; # FIXME: CMake tries to run "/llvm-lit" which of course doesn't exist doCheck = false; @@ -91,4 +99,4 @@ stdenv.mkDerivation { platforms = platforms.unix; maintainers = with maintainers; [ gloaming ]; }; -} +}) diff --git a/pkgs/development/compilers/swift/compiler/default.nix b/pkgs/development/compilers/swift/compiler/default.nix index 30fb18db8fd22..76c2da0a656af 100644 --- a/pkgs/development/compilers/swift/compiler/default.nix +++ b/pkgs/development/compilers/swift/compiler/default.nix @@ -311,6 +311,13 @@ in stdenv.mkDerivation { sha256 = "1rma1al0rbm3s3ql6bnvbcighp74lri1lcrwbyacgdqp80fgw1b6"; }} + # gcc-13 build fixes + patch -p2 -d llvm-project/llvm -i ${fetchpatch { + name = "gcc-13.patch"; + url = "https://github.com/llvm/llvm-project/commit/ff1681ddb303223973653f7f5f3f3435b48a1983.patch"; + hash = "sha256-nkRPWx8gNvYr7mlvEUiOAb1rTrf+skCZjAydJVUHrcI="; + }} + ${lib.optionalString stdenv.isLinux '' substituteInPlace llvm-project/clang/lib/Driver/ToolChains/Linux.cpp \ --replace 'SysRoot + "/lib' '"${glibc}/lib" "' \ diff --git a/pkgs/development/compilers/vala/setup-hook.sh b/pkgs/development/compilers/vala/setup-hook.sh index 33acdf1daee02..53976e5cd0db4 100644 --- a/pkgs/development/compilers/vala/setup-hook.sh +++ b/pkgs/development/compilers/vala/setup-hook.sh @@ -5,7 +5,7 @@ make_vala_find_vapi_files() { fi } -addEnvHooks "$hostOffset" make_vala_find_vapi_files +addEnvHooks "$targetOffset" make_vala_find_vapi_files disable_incompabile_pointer_conversion_warning() { # Work around incompatible function pointer conversion errors with clang 16 |