From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id iAEyDQ0rUGfZzQAAqHPOHw:P1 (envelope-from ) for ; Wed, 04 Dec 2024 10:12:29 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id iAEyDQ0rUGfZzQAAqHPOHw (envelope-from ) for ; Wed, 04 Dec 2024 11:12:29 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=NP+Tvgbe; dkim=fail ("headers rsa verify failed") header.d=fastmail.com header.s=fm1 header.b=mPy0dDm0; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm1 header.b=mqa1Qx9P; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=fastmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1733307149; a=rsa-sha256; cv=none; b=fCBiLfvtsHyAv2RyLeaTy346X8T+ZRR6g2ptLb6FAxtVTfgPlVT1QsK0KkuU5sJFro6yD9 IVDlw8OVEGKfh4gFyD7x8ne9JFkcSR7r0Ps5Z1BDGmtg9R7AgwquwCzDzFD/f1cdwhp7Ut YRf5qc8JsmkM41TbmDrnVaLUDMYO7PDnJ+LUURFs63yzu2Eecp2fHsAQvdmr9IllhFSqll OTrDLMbDnfsIh1fODEUXm5x++EAlecxYeqJSjdbDAyulMfJvm/QE8UxhY26tnJY9kpCmew 9otc0T574mWQoQss25z8gwWYkZ4vMz/2WMlAxW7+IJQ4qVGDo1nyguNvk1lXrg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=NP+Tvgbe; dkim=fail ("headers rsa verify failed") header.d=fastmail.com header.s=fm1 header.b=mPy0dDm0; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm1 header.b=mqa1Qx9P; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=fastmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1733307149; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=X7n/bQbURNcBT+q4ynYffhKMo/v9R8GxEK7Nb2CRMfY=; b=tEqYURzJpqGQ9LTMiabqPmhBRJ5xSYSGKJwtBxOf92WMFgodape8lywYvLWxRIbXMkTvfn ziqmK7KWxzA9p0QpSqWgIUkxWBW5Wx2pwMU9/VMw8YTAhyXUjHFx0M01F/9uRBa2dYyosL 5wjRxpZFarYB+EEBE3yTJ3hDv23FVOUUWwvac/fbgVzKf7uaH27e71Or911u8oY3SoPMq2 CG7pNNFNbcdQ12oA7+AikoLaDA38yjPSwIrH09K+5Q25FRJ65+T2JKIP2iSW07lHA/kfAe d51LctGSDrwGcfLj0h8apEqwsbW6L4dVgDNHE5tHX/nDLQaL/i6xzI1tE0MBsQ== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 7EDB28FA6A for ; Wed, 04 Dec 2024 11:12:28 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tImMf-0006jN-LZ; Wed, 04 Dec 2024 05:12:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tImMV-0006ig-JE for guix-patches@gnu.org; Wed, 04 Dec 2024 05:12:05 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tImMU-0006YI-Mw for guix-patches@gnu.org; Wed, 04 Dec 2024 05:12:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=X7n/bQbURNcBT+q4ynYffhKMo/v9R8GxEK7Nb2CRMfY=; b=NP+TvgbeaJKvFxa8Lfw9472d7sBOudd2TQieqkzmq2Gizr3ZUiwVuQ/cPjtLvJwsCWJC9mR5AJ8IGOocC8xInOc05X5hh+v8Llyu7miFzBtHhUVeU28YZEEeU6YyMGJmoMQTRH2asxC3r5NChBunUdsVXCSzQ8+6HLNxEzdzKoPgMAaVl6PQLs2kli0P3OsP5doAXK+B23ZsRrtaAlh6Tw+EeMQFOsKdVAUQ0u+R18A8QNxetWJbX/nSp1bf1ns+pb0EK8MMs2cmzI+e96qhGyjnzaAftRzVJon1ePIt6NvFXmGApljo5ar53IIf1qQEcTChSMxFT2X65/Ohg0UdFg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tImMU-00006B-BT for guix-patches@gnu.org; Wed, 04 Dec 2024 05:12:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74686] [PATCH] daemon: Fix linking gcrypt when --as-needed linker arg is used Resent-From: =?UTF-8?Q?Do=C4=9Fan_?= =?UTF-8?Q?=C3=87e=C3=A7en?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 04 Dec 2024 10:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 74686 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 74686@debbugs.gnu.org Cc: =?UTF-8?Q?Do=C4=9Fan_?= =?UTF-8?Q?=C3=87e=C3=A7en?= X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.173330707532753 (code B ref -1); Wed, 04 Dec 2024 10:12:02 +0000 Received: (at submit) by debbugs.gnu.org; 4 Dec 2024 10:11:15 +0000 Received: from localhost ([127.0.0.1]:34353 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tImLj-0008WC-4G for submit@debbugs.gnu.org; Wed, 04 Dec 2024 05:11:15 -0500 Received: from lists.gnu.org ([209.51.188.17]:55614) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tImLf-0008W3-63 for submit@debbugs.gnu.org; Wed, 04 Dec 2024 05:11:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tImLe-0006gU-Vq for guix-patches@gnu.org; Wed, 04 Dec 2024 05:11:11 -0500 Received: from fout-a4-smtp.messagingengine.com ([103.168.172.147]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tImLc-0006Ua-Or for guix-patches@gnu.org; Wed, 04 Dec 2024 05:11:10 -0500 Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id 462E9138096D; Wed, 4 Dec 2024 05:11:03 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Wed, 04 Dec 2024 05:11:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:subject:subject:to :to; s=fm1; t=1733307063; x=1733393463; bh=X7n/bQbURNcBT+q4ynYff hKMo/v9R8GxEK7Nb2CRMfY=; b=mPy0dDm0ojjz1VO/WNIRUmialBtck67yac3Bg 4jC9NQd7GDANGdUiNkvGClCp/YA+gLArvy5bSCEvW6q1NzXEVr+l18oHTmToV91i 5jR3yEgJHOPjAIfPjthPzMi2F3NWiGOd3bxAlfpOqYuv+CVVqZrw8IGfu7e5wP03 8tl1kRSdFOYLSo7gjsnpRI1jbtg0Qs22rYsTKB/fVONP9VnXOy98arfiIZvL+YAk +btdia1Dzx5IaJYH6UoED3kEDCJBJnS7423u3TrSftgIrAHVO8U9wfeqcMv7/OZr b2LKY/QuwNLjAymGfYGMehRMvjl0z6IcKWWfqWojdLYJEGK7A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1733307063; x=1733393463; bh=X7n/bQbURNcBT+q4ynYffhKMo/v9R8GxEK7 Nb2CRMfY=; b=mqa1Qx9Potg/3BJiWf8oJAOy4FKtXu7YirXqMKSdc15LrsEGTcK wcrAACbWjJ6MjXUjmzEYDyG6W+U7aCLgG7SdJD+PdRWu0o9sWI8fQPpVvI7p0S0s A/xY/tV1O8G7ruViIajUvaxTPbikbV4gmjzTVTCiaITG+11DPJM9TSO/7QU2gaQ5 ReSJaMENpVp5PW+6MEV5UREAwhcTJS71rbkedAYPXUeUoOna33+7H3lxCxsuyU+Q 14xwjXVjM6KEyby0vDc4jqdHxMk3cY8hQgqrGu74Nfu+9CjtZMlP3NGJy8131p4s 83JN3TM8U98j0BQa2gJKbZ0ti96NXu4/1Lg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrieehgdduudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvvefuff fkofgggfestdekredtredtjeenucfhrhhomhepffhoghgrnhcurmgvpogvnhcuoehsvghp vghthhesfhgrshhtmhgrihhlrdgtohhmqeenucggtffrrghtthgvrhhnpedtfeetuddvff dvvefgjeffkeffheeijeegudevgeetffeufffgfeekveeigeegveenucffohhmrghinhep ghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfh hrohhmpehsvghpvghthhesfhgrshhtmhgrihhlrdgtohhmpdhnsggprhgtphhtthhopedv pdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehguhhigidqphgrthgthhgvshesgh hnuhdrohhrghdprhgtphhtthhopehsvghpvghthhesfhgrshhtmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: i57994943:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 4 Dec 2024 05:11:01 -0500 (EST) From: =?UTF-8?Q?Do=C4=9Fan_?= =?UTF-8?Q?=C3=87e=C3=A7en?= Date: Wed, 4 Dec 2024 12:10:11 +0200 Message-ID: <5a89940f415ff9475062136c4e29e27d650fdbe3.1733307011.git.sepeth@fastmail.com> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=103.168.172.147; envelope-from=sepeth@fastmail.com; helo=fout-a4-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -0.93 X-Spam-Score: -0.93 X-Migadu-Queue-Id: 7EDB28FA6A X-Migadu-Scanner: mx12.migadu.com X-TUID: 9lozWmJXDeU7 As it is mentioned in autoconf manual that library names should be specified in LIBS, not LDFLAGS. See: https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.72/html_node/Preset-Output-Variables.html#index-LDFLAGS-2 This change also brings back the save_* vars trick that was there before. I missed in my earlier change that nix/local.mk was referring LIBGCRYPT_* vars directly. And, instead of CXXFLAGS, CPPFLAGS is used since the latter is probably more correct as this is used for include dirs, therefore using preprocessor flags. Tested with ./configure LDFLAGS="-Wl,--as-needed" --with-libgcrypt-prefix=... combinations. Change-Id: Iadb10e1994c9a78e2927847af2cfe5e096fbb2a8 --- config-daemon.ac | 20 ++++++++++++++------ nix/local.mk | 8 ++++++-- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/config-daemon.ac b/config-daemon.ac index 1ac204ceed1..6731c68bc39 100644 --- a/config-daemon.ac +++ b/config-daemon.ac @@ -39,27 +39,32 @@ if test "x$guix_build_daemon" = "xyes"; then case "$LIBGCRYPT_PREFIX" in no) - LIBGCRYPT_CXXFLAGS="" + LIBGCRYPT_CPPFLAGS="" ;; *) - LIBGCRYPT_CXXFLAGS="-I$LIBGCRYPT_PREFIX/include" + LIBGCRYPT_CPPFLAGS="-I$LIBGCRYPT_PREFIX/include" ;; esac case "$LIBGCRYPT_LIBDIR" in no | "") - LIBGCRYPT_LDFLAGS="-lgcrypt" ;; *) - LIBGCRYPT_LDFLAGS="-L$LIBGCRYPT_LIBDIR -lgcrypt" + LIBGCRYPT_LDFLAGS="-L$LIBGCRYPT_LIBDIR" ;; esac - AC_SUBST([LIBGCRYPT_CXXFLAGS]) + LIBGCRYPT_LIBS="-lgcrypt" + AC_SUBST([LIBGCRYPT_CPPFLAGS]) AC_SUBST([LIBGCRYPT_LDFLAGS]) + AC_SUBST([LIBGCRYPT_LIBS]) - CXXFLAGS="$CXXFLAGS $LIBGCRYPT_CXXFLAGS" + save_CPPFLAGS="$CPPFLAGS" + save_LDFLAGS="$LDFLAGS" + save_LIBS="$LIBS" + CPPFLAGS="$CPPFLAGS $LIBGCRYPT_CPPFLAGS" LDFLAGS="$LDFLAGS $LIBGCRYPT_LDFLAGS" + LIBS="$LIBS $LIBGCRYPT_LIBS" have_gcrypt=yes AC_CHECK_LIB([gcrypt], [gcry_md_open], [:], [have_gcrypt=no]) @@ -67,6 +72,9 @@ if test "x$guix_build_daemon" = "xyes"; then if test "x$have_gcrypt" != "xyes"; then AC_MSG_ERROR([GNU libgcrypt not found; please install it.]) fi + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" dnl Chroot support. AC_CHECK_FUNCS([chroot unshare]) diff --git a/nix/local.mk b/nix/local.mk index 8a2b2b88e86..0d23a48a024 100644 --- a/nix/local.mk +++ b/nix/local.mk @@ -69,7 +69,8 @@ libutil_headers = \ libutil_a_CPPFLAGS = \ -I$(top_builddir)/nix \ -I$(top_srcdir)/%D%/libutil \ - $(libformat_a_CPPFLAGS) + $(libformat_a_CPPFLAGS) \ + $(LIBGCRYPT_CPPFLAGS) libstore_a_SOURCES = \ %D%/libstore/gc.cc \ @@ -109,7 +110,7 @@ libstore_a_CPPFLAGS = \ -DDEFAULT_CHROOT_DIRS="\"\"" libstore_a_CXXFLAGS = $(AM_CXXFLAGS) \ - $(SQLITE3_CFLAGS) $(LIBGCRYPT_CFLAGS) + $(SQLITE3_CFLAGS) bin_PROGRAMS = guix-daemon @@ -122,6 +123,9 @@ guix_daemon_CPPFLAGS = \ $(libutil_a_CPPFLAGS) \ -I$(top_srcdir)/%D%/libstore +guix_daemon_LDFLAGS = \ + $(LIBGCRYPT_LDFLAGS) + guix_daemon_LDADD = \ libstore.a libutil.a libformat.a -lz \ $(SQLITE3_LIBS) $(LIBGCRYPT_LIBS) base-commit: 1c4a00820a1ba6265d2d96f4f7804d0807d69dcc -- 2.46.0