From 61c8348d804e98e535127742cec9d6bad8fccf34 Mon Sep 17 00:00:00 2001 From: ajs124 Date: Tue, 12 Apr 2022 21:03:23 +0100 Subject: [PATCH 1/2] gcc: upgrade aarch64-linux default from 9 to 11 --- pkgs/development/compilers/gcc/builder.sh | 9 +++++++++ pkgs/top-level/all-packages.nix | 1 - 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/development/compilers/gcc/builder.sh b/pkgs/development/compilers/gcc/builder.sh index c73e9e0c10759..4a17cf7ae56ff 100644 --- a/pkgs/development/compilers/gcc/builder.sh +++ b/pkgs/development/compilers/gcc/builder.sh @@ -213,6 +213,15 @@ postInstall() { moveToOutput "${targetConfig+$targetConfig/}lib/lib*.dll.a" "${!outputLib}" moveToOutput "share/gcc-*/python" "${!outputLib}" + # based on https://src.fedoraproject.org/rpms/gcc/blob/95507e8b681b5013b87bbbcb0514dd27941e648a/f/gcc.spec#_1293 + # if [ ! -z $REPLACE_LINKER_SCRIPT ]; then + rm -f "${!outputLib}/lib/libgcc_s.so" + echo '/* GNU ld script +Use the shared library, but some functions are only in +the static library, so try that secondarily. */ +GROUP ( libgcc_s.so.1 libgcc.a )' > "${!outputLib}/lib/libgcc_s.so" + # fi + if [ -z "$enableShared" ]; then moveToOutput "${targetConfig+$targetConfig/}lib/lib*.a" "${!outputLib}" fi diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0a21471af8a3c..4da61c4691fdb 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13632,7 +13632,6 @@ with pkgs; inherit (let num = if (with stdenv.targetPlatform; isVc4 || libc == "relibc") then 6 - else if (stdenv.targetPlatform.isAarch64 && stdenv.isLinux) then 9 else 11; numS = toString num; in { From f88a3020f12648a3380443065a930644749c9ba7 Mon Sep 17 00:00:00 2001 From: Gaelan Steele Date: Thu, 28 Apr 2022 15:26:02 +0100 Subject: [PATCH 2/2] glibc: stop using bootstrap libgcc_s Let's try this again. See https://github.com/NixOS/nixpkgs/issues/36947 and https://github.com/NixOS/nixpkgs/pull/36948 for history --- pkgs/development/libraries/glibc/default.nix | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/pkgs/development/libraries/glibc/default.nix b/pkgs/development/libraries/glibc/default.nix index 791ac47536f94..a35287c9f2e3d 100644 --- a/pkgs/development/libraries/glibc/default.nix +++ b/pkgs/development/libraries/glibc/default.nix @@ -63,26 +63,6 @@ callPackage ./common.nix { inherit stdenv; } { ]) ]); - # When building glibc from bootstrap-tools, we need libgcc_s at RPATH for - # any program we run, because the gcc will have been placed at a new - # store path than that determined when built (as a source for the - # bootstrap-tools tarball) - # Building from a proper gcc staying in the path where it was installed, - # libgcc_s will now be at {gcc}/lib, and gcc's libgcc will be found without - # any special hack. - # TODO: remove this hack. Things that rely on this hack today: - # - dejagnu: during linux bootstrap tcl SIGSEGVs - # - clang-wrapper in cross-compilation - # Last attempt: https://github.com/NixOS/nixpkgs/pull/36948 - preInstall = '' - if [ -f ${stdenv.cc.cc}/lib/libgcc_s.so.1 ]; then - mkdir -p $out/lib - cp ${stdenv.cc.cc}/lib/libgcc_s.so.1 $out/lib/libgcc_s.so.1 - # the .so It used to be a symlink, but now it is a script - cp -a ${stdenv.cc.cc}/lib/libgcc_s.so $out/lib/libgcc_s.so - fi - ''; - postInstall = (if stdenv.hostPlatform == stdenv.buildPlatform then '' echo SUPPORTED-LOCALES=C.UTF-8/UTF-8 > ../glibc-2*/localedata/SUPPORTED make -j''${NIX_BUILD_CORES:-1} localedata/install-locales