From: Sergei Trofimovich <slyich@gmail.com>
To: 74677@debbugs.gnu.org
Cc: Sergei Trofimovich <slyich@gmail.com>
Subject: [bug#74677] [PATCH] nix/local.mk: fix -lgcrypt link on --as-needed toolchains
Date: Tue, 3 Dec 2024 21:15:15 +0000 [thread overview]
Message-ID: <20241203211515.1620700-1-slyich@gmail.com> (raw)
https://git.savannah.gnu.org/cgit/guix.git/commit/?id=8a7bd211d21f06c1234fbb82bb905d202d58f598
introduced a build regression on Gentoo as:
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:
- Gentoo linker is using --Wl,-as-needed by default
- -lgcrypt is passed before actual use of it's symbols in `guix-daemon.cc`
The change uses `LIBGCRYPT_LDFLAGS` as if it was `LIBGCRYPT_LIBS`.
* nix/local.mk (guix_daemon_LDADD): Use LIBGCRYPT_LDFLAGS instead of
unset LIBGCRYPT_LIBS.
---
nix/local.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/nix/local.mk b/nix/local.mk
index 8a2b2b88e8..50368457dd 100644
--- 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
--
2.47.0
next reply other threads:[~2024-12-03 21:16 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-03 21:15 Sergei Trofimovich [this message]
2024-12-09 22:17 ` bug#74677: [PATCH] nix/local.mk: fix -lgcrypt link on --as-needed toolchains Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241203211515.1620700-1-slyich@gmail.com \
--to=slyich@gmail.com \
--cc=74677@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).