Skip to content

Commit

Permalink
sys-apps/guix: add a libgcrypt -lgcrypt order underlinking workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
trofi committed Dec 3, 2024
1 parent 094ee26 commit 22ebd22
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions sys-apps/guix/files/guix-9999-libgcrypt.patch
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions sys-apps/guix/guix-9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -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/*"
Expand Down

0 comments on commit 22ebd22

Please sign in to comment.