Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
From f81744bae4442345ff6f40d80fdb8adaba8b330f Mon Sep 17 00:00:00 2001
From: Maximilian Bosch <maximilian@mbosch.me>
Date: Fri, 27 Aug 2021 17:19:27 +0200
From faeeb0f353f5540da2015a41cb60fe43d199a1ac Mon Sep 17 00:00:00 2001
From: Bernardo Meurer <bernardo@meurer.org>
Date: Fri, 22 Jul 2022 22:11:07 -0700
Subject: [PATCH] Revert "Remove all usage of @BASH@ or ${BASH} in installed
files, and hardcode /bin/bash instead"

We need the ability to override to use `/bin/sh` here to avoid having
some bootstrap tools in a final build product.

This reverts commit 5188a9d0265cc6f7235a8af1d31ab02e4a24853d.

Co-authored-by: Maximilian Bosch <maximilian@mbosch.me>
---
debug/Makefile | 5 +++--
debug/xtrace.sh | 2 +-
Expand All @@ -20,10 +22,10 @@ This reverts commit 5188a9d0265cc6f7235a8af1d31ab02e4a24853d.
8 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/debug/Makefile b/debug/Makefile
index 6893111cbf..3f66666c6c 100644
index 96029f32ee..cbbdeda277 100644
--- a/debug/Makefile
+++ b/debug/Makefile
@@ -216,7 +216,8 @@ $(objpfx)pcprofiledump: $(objpfx)pcprofiledump.o
@@ -238,7 +238,8 @@ $(objpfx)pcprofiledump: $(objpfx)pcprofiledump.o

$(objpfx)xtrace: xtrace.sh
rm -f $@.new
Expand All @@ -35,20 +37,20 @@ index 6893111cbf..3f66666c6c 100644
-e 's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|' $^ > $@.new \
&& rm -f $@ && mv $@.new $@ && chmod +x $@
diff --git a/debug/xtrace.sh b/debug/xtrace.sh
index 9697fbe0b4..279fe59ac6 100755
index 8c56e01449..c760391a33 100755
--- a/debug/xtrace.sh
+++ b/debug/xtrace.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#! @BASH@
# Copyright (C) 1999-2021 Free Software Foundation, Inc.
# Copyright (C) 1999-2022 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# Contributed by Ulrich Drepper <drepper@gnu.org>, 1999.

diff --git a/elf/Makefile b/elf/Makefile
index d05f410592..9264409fdd 100644
index 3536b6af5e..83521d9dbc 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -144,7 +144,8 @@ $(objpfx)sotruss-lib.so: $(common-objpfx)libc.so $(objpfx)ld.so \
@@ -256,7 +256,8 @@ $(objpfx)sotruss-lib.so: $(common-objpfx)libc.so $(objpfx)ld.so \
$(common-objpfx)libc_nonshared.a

$(objpfx)sotruss: sotruss.sh $(common-objpfx)config.make
Expand All @@ -58,7 +60,7 @@ index d05f410592..9264409fdd 100644
-e 's%@TEXTDOMAINDIR@%$(localedir)%g' \
-e 's%@PREFIX@%$(prefix)%g' \
-e 's|@PKGVERSION@|$(PKGVERSION)|g' \
@@ -659,6 +660,7 @@ ldd-rewrite = -e 's%@RTLD@%$(rtlddir)/$(rtld-installed-name)%g' \
@@ -1363,6 +1364,7 @@ ldd-rewrite = -e 's%@RTLD@%$(rtlddir)/$(rtld-installed-name)%g' \
-e 's%@VERSION@%$(version)%g' \
-e 's|@PKGVERSION@|$(PKGVERSION)|g' \
-e 's|@REPORT_BUGS_TO@|$(REPORT_BUGS_TO)|g' \
Expand All @@ -67,30 +69,30 @@ index d05f410592..9264409fdd 100644

ifeq ($(ldd-rewrite-script),no)
diff --git a/elf/ldd.bash.in b/elf/ldd.bash.in
index ba736464ac..57442bc3f2 100644
index 3253b32ef8..127eb59206 100644
--- a/elf/ldd.bash.in
+++ b/elf/ldd.bash.in
@@ -1,4 +1,4 @@
-#!/bin/bash
+#! @BASH@
# Copyright (C) 1996-2021 Free Software Foundation, Inc.
# Copyright (C) 1996-2022 Free Software Foundation, Inc.
# This file is part of the GNU C Library.

diff --git a/elf/sotruss.sh b/elf/sotruss.sh
index 003cf4d825..fd4da80244 100755
index 22327eac5c..7d15bf4fc8 100755
--- a/elf/sotruss.sh
+++ b/elf/sotruss.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#! @BASH@
# Copyright (C) 2011-2021 Free Software Foundation, Inc.
# Copyright (C) 2011-2022 Free Software Foundation, Inc.
# This file is part of the GNU C Library.

diff --git a/malloc/Makefile b/malloc/Makefile
index 9b70831d38..90ecadff6c 100644
index 2329cf718a..5d7de4bee7 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -271,8 +271,9 @@ $(objpfx)mtrace: mtrace.pl
@@ -307,8 +307,9 @@ $(objpfx)mtrace: mtrace.pl

$(objpfx)memusage: memusage.sh
rm -f $@.new
Expand All @@ -103,21 +105,21 @@ index 9b70831d38..90ecadff6c 100644
&& rm -f $@ && mv $@.new $@ && chmod +x $@

diff --git a/malloc/memusage.sh b/malloc/memusage.sh
index 0645f09911..c1cd4e23b7 100755
index f447160b7d..faa4936639 100755
--- a/malloc/memusage.sh
+++ b/malloc/memusage.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#! @BASH@
# Copyright (C) 1999-2021 Free Software Foundation, Inc.
# Copyright (C) 1999-2022 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# Contributed by Ulrich Drepper <drepper@gnu.org>, 1999.

diff --git a/timezone/Makefile b/timezone/Makefile
index c624a189b3..395abfeebd 100644
index a789c22d26..d65bdf2391 100644
--- a/timezone/Makefile
+++ b/timezone/Makefile
@@ -123,7 +123,8 @@ $(testdata)/XT%: testdata/XT%
cp $< $@
@@ -130,7 +130,8 @@ $(testdata)/XT5: testdata/gen-XT5.sh
mv $@.tmp $@

$(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make
- sed -e 's|TZDIR=[^}]*|TZDIR=$(zonedir)|' \
Expand All @@ -127,5 +129,5 @@ index c624a189b3..395abfeebd 100644
-e '/PKGVERSION=/s|=.*|="$(PKGVERSION)"|' \
-e '/REPORT_BUGS_TO=/s|=.*|="$(REPORT_BUGS_TO)"|' \
--
2.31.1
2.37.0

Binary file not shown.
Binary file not shown.
37 changes: 8 additions & 29 deletions pkgs/development/libraries/glibc/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
} @ args:

let
version = "2.34";
patchSuffix = "-210";
sha256 = "sha256-RNJqH+ILiFOkj0cOrQHkJ56GmsFJsZXdpORKGV2YGrI=";
version = "2.35";
patchSuffix = "-163";
sha256 = "sha256-USNzL2tnzNMZMF79OZlx1YWSEivMKmUYob0lEN0M9S4=";
in

assert withLinuxHeaders -> linuxHeaders != null;
Expand All @@ -62,14 +62,14 @@ stdenv.mkDerivation ({
patches =
[
/* No tarballs for stable upstream branch, only https://sourceware.org/git/glibc.git and using git would complicate bootstrapping.
$ git fetch --all -p && git checkout origin/release/2.34/master && git describe
glibc-2.34-210-ge123f08ad5
$ git show --minimal --reverse glibc-2.34.. | gzip -9n --rsyncable - > 2.34-master.patch.gz
$ git fetch --all -p && git checkout origin/release/2.35/master && git describe
glibc-2.35-210-ge123f08ad5
$ git show --minimal --reverse glibc-2.35.. | gzip -9n --rsyncable - > 2.35-master.patch.gz

To compare the archive contents zdiff can be used.
$ zdiff -u 2.34-master.patch.gz ../nixpkgs/pkgs/development/libraries/glibc/2.34-master.patch.gz
$ zdiff -u 2.35-master.patch.gz ../nixpkgs/pkgs/development/libraries/glibc/2.35-master.patch.gz
*/
./2.34-master.patch.gz
./2.35-master.patch.gz

/* Allow NixOS and Nix to handle the locale-archive. */
./nix-locale-archive.patch
Expand Down Expand Up @@ -115,33 +115,12 @@ stdenv.mkDerivation ({
sha256 = "091bk3kyrx1gc380gryrxjzgcmh1ajcj8s2rjhp2d2yzd5mpd5ps";
})

/* Provide utf-8 locales by default, so we can use it in stdenv without depending on our large locale-archive. */
(fetchurl {
url = "https://salsa.debian.org/glibc-team/glibc/raw/49767c9f7de4828220b691b29de0baf60d8a54ec/debian/patches/localedata/locale-C.diff";
sha256 = "0irj60hs2i91ilwg5w7sqrxb695c93xg0ik7yhhq9irprd7fidn4";
})

./fix-x64-abi.patch

/* https://github.com/NixOS/nixpkgs/pull/137601 */
./nix-nss-open-files.patch

./0001-Revert-Remove-all-usage-of-BASH-or-BASH-in-installed.patch

/* Fix segfault in getpwuid when stat fails
https://sourceware.org/bugzilla/show_bug.cgi?id=28752 */
(fetchurl {
url = "https://patchwork.sourceware.org/project/glibc/patch/20220314175316.3239120-2-sam@gentoo.org/raw/";
sha256 = "sq0BoPqXHQ69Vq4zJobCspe4XRfnAiuac/wqzVQJESc=";
})

/* Patch pending upstream inclusion to fix string.h syntax for older gcc.
Needed to unbreak gnat bootstrap against old gcc in nixpkgs:
https://patchwork.sourceware.org/project/glibc/patch/20220520150609.346566-1-slyfox@gentoo.org/ */
(fetchurl {
url = "https://patchwork.sourceware.org/project/glibc/patch/20220520150609.346566-1-slyfox@gentoo.org/raw/";
sha256 = "x3/eO1EHJXBIrH2WXHRRD1swtWv+btFVjvMt5tj/wDA=";
})
]
++ lib.optional stdenv.hostPlatform.isMusl ./fix-rpc-types-musl-conflicts.patch
++ lib.optional stdenv.buildPlatform.isDarwin ./darwin-cross-build.patch;
Expand Down