From 22ebd22e4736d0018c212967c24a6200446660cd Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Tue, 3 Dec 2024 17:39:48 +0000 Subject: [PATCH] sys-apps/guix: add a libgcrypt -lgcrypt order underlinking workaround --- sys-apps/guix/files/guix-9999-libgcrypt.patch | 21 +++++++++++++++++++ sys-apps/guix/guix-9999.ebuild | 1 + 2 files changed, 22 insertions(+) create mode 100644 sys-apps/guix/files/guix-9999-libgcrypt.patch diff --git a/sys-apps/guix/files/guix-9999-libgcrypt.patch b/sys-apps/guix/files/guix-9999-libgcrypt.patch new file mode 100644 index 0000000..1a5ee20 --- /dev/null +++ b/sys-apps/guix/files/guix-9999-libgcrypt.patch @@ -0,0 +1,21 @@ +https://git.savannah.gnu.org/cgit/guix.git/commit/?id=8a7bd211d21f06c1234fbb82bb905d202d58f598 +introduced a regression: + + x86_64-pc-linux-gnu-g++ -Wall -std=c++11 -O2 -pipe -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,--hash-style=gnu -lgcrypt -o guix-daemon nix/nix-daemon/guix_daemon-nix-daemon.o nix/nix-daemon/guix_daemon-guix-daemon.o libstore.a libutil.a libformat.a -lz -lsqlite3 -lbz2 + /usr/lib/gcc/x86_64-pc-linux-gnu/14/../../../../x86_64-pc-linux-gnu/bin/ld: nix/nix-daemon/guix_daemon-guix-daemon.o: in function `main': +guix-daemon.cc:(.text.startup+0x62): undefined reference to `gcry_check_version' + +This happens because: +- linker is using --Wl,-as-needed by default +- -lgcrypt is passed before actual use +--- a/nix/local.mk ++++ b/nix/local.mk +@@ -124,7 +124,7 @@ guix_daemon_CPPFLAGS = \ + + guix_daemon_LDADD = \ + libstore.a libutil.a libformat.a -lz \ +- $(SQLITE3_LIBS) $(LIBGCRYPT_LIBS) ++ $(SQLITE3_LIBS) $(LIBGCRYPT_LDFLAGS) + + guix_daemon_headers = \ + %D%/nix-daemon/shared.hh diff --git a/sys-apps/guix/guix-9999.ebuild b/sys-apps/guix/guix-9999.ebuild index c26f8f1..df381fa 100644 --- a/sys-apps/guix/guix-9999.ebuild +++ b/sys-apps/guix/guix-9999.ebuild @@ -97,6 +97,7 @@ DEPEND="${RDEPEND} PATCHES=( "${FILESDIR}"/${PN}-9999-default-daemon.patch "${FILESDIR}"/${PN}-1.3.0-compression-error.patch + "${FILESDIR}"/${PN}-9999-libgcrypt.patch ) QA_PREBUILT="usr/share/guile/site/*/gnu/packages/bootstrap/*"