Skip to content

Commit 54faac9

Browse files
achow101fanquake
authored andcommitted
guix: Remove guix store paths from glibc
Without ffile-prefix-map, the debug symbols will contain paths for the guix store which will include the hashes of each package. However, the hash for the same package will differ when on different architectures. In order to be reproducible regardless of the architecture used to build the package, map all guix store prefixes to something fixed, e.g. /usr. We might be able to drop this in favour of using --with-nonshared-cflags when we being using newer versions of glibc.
1 parent 1d4d711 commit 54faac9

File tree

3 files changed

+54
-2
lines changed

3 files changed

+54
-2
lines changed

contrib/guix/manifest.scm

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,8 @@ inspecting signatures in Mach-O binaries.")
549549
"glibc-versioned-locpath.patch"
550550
"glibc-2.24-elfm-loadaddr-dynamic-rewrite.patch"
551551
"glibc-2.24-no-build-time-cxx-header-run.patch"
552-
"glibc-2.24-fcommon.patch"))))))
552+
"glibc-2.24-fcommon.patch"
553+
"glibc-2.24-guix-prefix.patch"))))))
553554

554555
(define-public glibc-2.27/bitcoin-patched
555556
(package
@@ -566,7 +567,8 @@ inspecting signatures in Mach-O binaries.")
566567
"1b2n1gxv9f4fd5yy68qjbnarhf8mf4vmlxk10i3328c1w5pmp0ca"))
567568
(patches (search-our-patches "glibc-ldd-x86_64.patch"
568569
"glibc-2.27-riscv64-Use-__has_include-to-include-asm-syscalls.h.patch"
569-
"glibc-2.27-dont-redefine-nss-database.patch"))))))
570+
"glibc-2.27-dont-redefine-nss-database.patch"
571+
"glibc-2.27-guix-prefix.patch"))))))
570572

571573
(packages->manifest
572574
(append
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Without ffile-prefix-map, the debug symbols will contain paths for the
2+
guix store which will include the hashes of each package. However, the
3+
hash for the same package will differ when on different architectures.
4+
In order to be reproducible regardless of the architecture used to build
5+
the package, map all guix store prefixes to something fixed, e.g. /usr.
6+
7+
We might be able to drop this in favour of using --with-nonshared-cflags
8+
when we being using newer versions of glibc.
9+
10+
--- a/Makeconfig
11+
+++ b/Makeconfig
12+
@@ -950,6 +950,10 @@ object-suffixes-for-libc += .oS
13+
# shared objects. We don't want to use CFLAGS-os because users may, for
14+
# example, make that processor-specific.
15+
CFLAGS-.oS = $(CFLAGS-.o) $(PIC-ccflag)
16+
+
17+
+# Map Guix store paths to /usr
18+
+CFLAGS-.oS += `find /gnu/store -maxdepth 1 -mindepth 1 -type d -exec echo -n " -fdebug-prefix-map={}=/usr" \;`
19+
+
20+
CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
21+
libtype.oS = lib%_nonshared.a
22+
endif
23+
--
24+
2.35.1
25+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
Without ffile-prefix-map, the debug symbols will contain paths for the
2+
guix store which will include the hashes of each package. However, the
3+
hash for the same package will differ when on different architectures.
4+
In order to be reproducible regardless of the architecture used to build
5+
the package, map all guix store prefixes to something fixed, e.g. /usr.
6+
7+
We might be able to drop this in favour of using --with-nonshared-cflags
8+
when we being using newer versions of glibc.
9+
10+
--- a/Makeconfig
11+
+++ b/Makeconfig
12+
@@ -992,6 +992,10 @@ object-suffixes :=
13+
CPPFLAGS-.o = $(pic-default)
14+
# libc.a must be compiled with -fPIE/-fpie for static PIE.
15+
CFLAGS-.o = $(filter %frame-pointer,$(+cflags)) $(pie-default)
16+
+
17+
+# Map Guix store paths to /usr
18+
+CFLAGS-.o += `find /gnu/store -maxdepth 1 -mindepth 1 -type d -exec echo -n " -fdebug-prefix-map={}=/usr" \;`
19+
+
20+
libtype.o := lib%.a
21+
object-suffixes += .o
22+
ifeq (yes,$(build-shared))
23+
--
24+
2.35.1
25+

0 commit comments

Comments
 (0)