From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id gAOxNC/H7mCsAAAAgWs5BA (envelope-from ) for ; Wed, 14 Jul 2021 13:14:55 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id qERHMC/H7mDNNQAAbx9fmQ (envelope-from ) for ; Wed, 14 Jul 2021 11:14:55 +0000 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 22A47139E7 for ; Wed, 14 Jul 2021 13:14:55 +0200 (CEST) Received: from localhost ([::1]:47322 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3cqs-0002F2-2X for larch@yhetil.org; Wed, 14 Jul 2021 07:14:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57246) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3cq7-0000yo-1d for guix-patches@gnu.org; Wed, 14 Jul 2021 07:14:07 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59881) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m3cq5-0000z1-Qd for guix-patches@gnu.org; Wed, 14 Jul 2021 07:14:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m3cq5-0001QB-NB for guix-patches@gnu.org; Wed, 14 Jul 2021 07:14:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49025] [PATCH v6 09/22] libgpg-error: Prevent silent miscompilation some systems. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 14 Jul 2021 11:14:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49025 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49025@debbugs.gnu.org Cc: Mathieu Othacehe , Maxime Devos Received: via spool by 49025-submit@debbugs.gnu.org id=B49025.16262612185270 (code B ref 49025); Wed, 14 Jul 2021 11:14:05 +0000 Received: (at 49025) by debbugs.gnu.org; 14 Jul 2021 11:13:38 +0000 Received: from localhost ([127.0.0.1]:43159 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m3cpd-0001Mq-Sl for submit@debbugs.gnu.org; Wed, 14 Jul 2021 07:13:38 -0400 Received: from andre.telenet-ops.be ([195.130.132.53]:39816) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m3cpO-0001Je-VE for 49025@debbugs.gnu.org; Wed, 14 Jul 2021 07:13:23 -0400 Received: from localhost.localdomain ([188.188.219.228]) by andre.telenet-ops.be with bizsmtp id UzDG2500W4wFxCU01zDNFg; Wed, 14 Jul 2021 13:13:22 +0200 From: Maxime Devos Date: Wed, 14 Jul 2021 13:12:54 +0200 Message-Id: <20210714111307.19324-10-maximedevos@telenet.be> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210714111307.19324-1-maximedevos@telenet.be> References: <20210714111307.19324-1-maximedevos@telenet.be> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1626261202; bh=QFau1FaeK/5b1bWqy9BVr+tMxwUOU/Qw1BH0pUCw/qc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=vRMtq8u8p5o0JODt8vAOBNtgwpowRYI18830YT2GRNz91ir5nH9vpX7Ri5NAwim+g H+qYkLTfQyEh5Z6k8sjOmoXA+FkPu5GOQFU37Mfy69frv/F1x6y1GuBe2w7hhK5xNo gxfvPbr/CM3rxikfPRsZRV30cHLA1SfCUIZGTmfNMNKWWJdFcuoiLbTNiTKELFmma9 OfMUws+7+QQmNkW1JfRRBNAV1D7qmBZHS2iPFCF/kMhhwPcAmsewRfMqVx4DkmzN5x 2eAWQyEx+dyBYhi2AxsLnP38VwiLjAs2g8drJe/xFO3nZ/P/xVcuerdIbGWhZqaFQP Bt0Ww8bUHo7AQ== 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" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1626261295; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=QFau1FaeK/5b1bWqy9BVr+tMxwUOU/Qw1BH0pUCw/qc=; b=EzA8b+iDYRwHkaqeWvbgEBtKo2/K/XQrC65P4Hj8T/u19253VWu9U/Pba2QUmlvYpShn2L FsWE1rEpeOUOuElEwutTKNpUKF64N7Eox8J9fpMQd9UD5bFoMO0Hv/aXz4PUYRMxI49p3v SZcB9pCIXd4RT6CqkErr3FSlIhR8Emx3IQbOENcCnsXksNw0Q0QBuk4VXfkXUUTZjPe2Z+ 6qkjCLSKx1QJjU2BAjJ7s/esFQ6SBpgxuJrnAFyygh4IV1YUMKWQyieRgGbdHW9SjzilF6 P8PNdTRjO82appXOmrr9AhcUiJRWVvl2eJXrDUyiEXQdRE+TULRU1Dh3591MZA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1626261295; a=rsa-sha256; cv=none; b=fWpKHXssf08xUP5WG4yFDx2RbD/uAwCeJolunlcbAXtlR2JllNfVxAXZzNDm+eq2x+Cm00 9O01iVH5BqumrJaMyaQIV1jfBq8tXV82cx7B71sE60CuA/bR8zgquzJ3Suvyzw5Lxr+BHw zBf9tzoaIOSRkwH0bpvHJN0NBis6mSu6Vh2H50H1/5A8IcQ0o+By2FUrFxoLGIfkoiIAGt +kuZtY3C64+vmfcTG5QlDA44uLArFCaHuTdxXE9gJDx9i1nFGxGks1ghkoHUUWzMbal6Xz M8o6qUxmuPJnhOtV7g1Z5s5omFfyXyp+Xd5Q9aiB0UfY8Pf3QZ56pGZmj97BJw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=vRMtq8u8; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -0.30 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=vRMtq8u8; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 22A47139E7 X-Spam-Score: -0.30 X-Migadu-Scanner: scn1.migadu.com X-TUID: I8aiRCCq+TwF * gnu/packages/gpg.scm (libgpgerror)[arguments]<#:phases>{cross-symlinks}: Only link to src/syscfg/lock-obj-pub.linux-gnu.h if the package is being compiled for a Linux target. Do not link either if the architecture is unknown, as the headers vary with the architecture. --- gnu/packages/gnupg.scm | 40 ++++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/gnu/packages/gnupg.scm b/gnu/packages/gnupg.scm index 5c0d03927e..1a7c682ad6 100644 --- a/gnu/packages/gnupg.scm +++ b/gnu/packages/gnupg.scm @@ -18,6 +18,7 @@ ;;; Copyright © 2018 Björn Höfling ;;; Copyright © 2019 Mathieu Othacehe ;;; Copyright © 2020 Fredrik Salomonsson +;;; Copyright © 2021 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -77,6 +78,7 @@ #:use-module (guix build-system gnu) #:use-module (guix build-system perl) #:use-module (guix build-system python) + #:use-module (ice-9 match) #:use-module (srfi srfi-1)) (define-public libgpg-error @@ -94,27 +96,37 @@ (build-system gnu-build-system) (arguments (if (%current-target-system) - `(#:modules ((ice-9 match) - (guix build gnu-build-system) + `(#:modules ((guix build gnu-build-system) (guix build utils)) #:phases (modify-phases %standard-phases ;; When cross-compiling, some platform specific properties cannot ;; be detected. Create a symlink to the appropriate platform - ;; file. See Cross-Compiling section at: + ;; file if required. Note that these platform files depend on + ;; both the operating system and architecture! + ;; + ;; See Cross-Compiling section at: ;; https://github.com/gpg/libgpg-error/blob/master/README (add-after 'unpack 'cross-symlinks - (lambda* (#:key target inputs #:allow-other-keys) - (let ((triplet - (match (string-take target - (string-index target #\-)) - ("armhf" "arm-unknown-linux-gnueabi") - ("mips64el" "mips-unknown-linux-gnu") - (x - (string-append x "-unknown-linux-gnu"))))) - (symlink - (string-append "lock-obj-pub." triplet ".h") - "src/syscfg/lock-obj-pub.linux-gnu.h")))))) + (lambda _ + (define (link triplet source) + (symlink (string-append "lock-obj-pub." triplet ".h") + (string-append "src/syscfg/lock-obj-pub." + source ".h"))) + ,(let* ((target (%current-target-system)) + (architecture + (string-take target (string-index target #\-)))) + (cond ((target-linux? target) + (match architecture + ("armhf" + `(link "arm-unknown-linux-gnueabi" "linux-gnu")) + ("mips64el" + `(link "mips-unknown-linux-gnu" "linux-gnu")) + ;; Don't always link to the "linux-gnu" + ;; configuration, as this is not correct for + ;; all architectures. + (_ #t))) + (#t #t))))))) '())) (native-inputs `(("gettext" ,gettext-minimal))) (home-page "https://gnupg.org") -- 2.32.0