From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id wAq1NLiGJmGkmQAAgWs5BA (envelope-from ) for ; Wed, 25 Aug 2021 20:06:48 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id yGokMLiGJmGpawAAbx9fmQ (envelope-from ) for ; Wed, 25 Aug 2021 18:06:48 +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 8C7A370D8 for ; Wed, 25 Aug 2021 20:06:48 +0200 (CEST) Received: from localhost ([::1]:35814 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIxIV-0005I3-Jq for larch@yhetil.org; Wed, 25 Aug 2021 14:06:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59456) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mIxHo-0003ds-Gv for guix-patches@gnu.org; Wed, 25 Aug 2021 14:06:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36237) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mIxHo-0002Si-5k for guix-patches@gnu.org; Wed, 25 Aug 2021 14:06:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mIxHo-0002wU-0K for guix-patches@gnu.org; Wed, 25 Aug 2021 14:06:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50201] [PATCH 40/52] gnu: xorg: Unify --disable-malloc0-returnsnull code. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 25 Aug 2021 18:06:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50201 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50201@debbugs.gnu.org Cc: Maxime Devos Received: via spool by 50201-submit@debbugs.gnu.org id=B50201.162991473011116 (code B ref 50201); Wed, 25 Aug 2021 18:06:03 +0000 Received: (at 50201) by debbugs.gnu.org; 25 Aug 2021 18:05:30 +0000 Received: from localhost ([127.0.0.1]:47763 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mIxHC-0002t4-9D for submit@debbugs.gnu.org; Wed, 25 Aug 2021 14:05:30 -0400 Received: from laurent.telenet-ops.be ([195.130.137.89]:55644) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mIxFb-0002hZ-Uu for 50201@debbugs.gnu.org; Wed, 25 Aug 2021 14:03:50 -0400 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by laurent.telenet-ops.be with bizsmtp id lu3k2500G0mfAB401u3n9X; Wed, 25 Aug 2021 20:03:47 +0200 From: Maxime Devos Date: Wed, 25 Aug 2021 20:03:20 +0200 Message-Id: <20210825180332.5720-40-maximedevos@telenet.be> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210825180332.5720-1-maximedevos@telenet.be> References: <20210825180332.5720-1-maximedevos@telenet.be> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1629914627; bh=BDyjBdKpQ1Wh75Z6mUGDrYSAUeOoqyCoyWTVLBkYws0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=k16ZSLUh5YXJkALBjqLk2m7zkNpmq0ijmLjP7fGw74ypmVahjD6io49wYhOugiUOT raBSFktDKqRtP6BMwLKctQ17z5R8wVfRriRKSKXfJxJ4SEyuTc+NnVV2gvFITyj+Qr 7AdKUFQE7kgn/8Gj9agRnfJK0cwXZYwDwu8gXORX2DBw1zbFzSaMGqSrb3L3Zkegkt frMg6ho440qN81wDkMhaxhTchJyBKDCN6dcZ5nCbv50sbBr8Gah02nRwnM9Zi5kZKY AeTcLKvQ3gWn3L7V7rKL3CTzQLy1CgsB88yQS/kYrMZ5lFThJ06zkQXYi9KZeA3WnC e5akV1Uy3uBRQ== 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=1629914808; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=BDyjBdKpQ1Wh75Z6mUGDrYSAUeOoqyCoyWTVLBkYws0=; b=gWc3SLu0X/1pDs6Cxxof/wBlgS9H/oTLN28VR5TfjUEF8aOFkV6+QFv5e6NAtlZhiYW5Ez UCniTIM2oyCrwtXzzbVpE2zoi1LXZ4IJnsTQZB8KrOjbIfnlqDFrrD/GDG/0HJuJa2Kyzu rqOd2tlN7wISukRjXfwZgz+NWSy83z80BivbSnuWj79QV9opDyaV4HtFwOYDLvwiLd99ju 03V8Kt7+PzmW2gMe9VZkTCNRFc5HNLA4ZkY9tHw36JK981emAgahFiPGkh0vVGLAqh4VYY ao+8qObB6rd0Me6Txn+5jj8PejbUjz/eNUJ748UBPg4lkz8pGv6g2YJ134eSPg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1629914808; a=rsa-sha256; cv=none; b=M7816guBJNCxWndiQbqH/C9OCFyAZhouVoKcLq/QWj1nUeasfJuZxEmbMaTgrZj0PowG8d bDUXqJ9s4A/a0xySW7ppGYS/HKLL2oMe7KwZxTQRs1MPQsmCcmRW2A4ppFbeNhhADuWm92 nlNQShBvJUOg/63SwBlyE2o2pguD+rau+wE2TSpsGAH7jDJ4LT5nxyhLyZWCOIoHNam/qB a9S10W6qG2wSKaLM5F045MdDSSXwo4zHgJBvbJzBCXWtLUy5SjT1vE0PGJSjcwDsvteb/3 bn2PwzMAvzuMGn6bQ3uN5hwFrjuJr+ZlVLtFZsl3bR65fVGDcRyEVgg2l4tk3A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=k16ZSLUh; 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: 3.68 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=k16ZSLUh; 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: 8C7A370D8 X-Spam-Score: 3.68 X-Migadu-Scanner: scn0.migadu.com X-TUID: GTkrbKOh0YIE The idea is to keep the comments in one place, instead of copying them over and over. It's also documented more now. * gnu/packages/xorg.scm (malloc0-flags): New procedure. (libxext,libxrender,libx11,libxt): Use new procedures. --- gnu/packages/xorg.scm | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm index def751c62c..0197e785cb 100644 --- a/gnu/packages/xorg.scm +++ b/gnu/packages/xorg.scm @@ -102,6 +102,16 @@ +;; When cross-compiling certain packages, "--disable-malloc0returnsnull" +;; needs to be passed. Otherwise, the configure script will try to run a +;; binary for the host on the build machine. +(define (malloc0-flags) + (if (%current-target-system) + ;; At least on glibc-based systems, malloc(0) evaluates to a non-NULL + ;; pointer (except in out-of-memory situations). On other systems, + ;; --enable-malloc0returnsnull might be required instead. + '("--disable-malloc0returnsnull") + '())) ;; packages without propagated input ;; (rationale for this separation: The packages in PROPAGATED_INPUTS need to @@ -4792,10 +4802,7 @@ cannot be adequately worked around on the client side of the wire.") (string-append "--mandir=" (assoc-ref %outputs "doc") "/share/man") - ;; Disable zero malloc check that fails when cross-compiling. - ,@(if (%current-target-system) - '("--disable-malloc0returnsnull") - '())))) + ,@(malloc0-flags)))) (propagated-inputs `(("xorgproto" ,xorgproto))) (inputs @@ -4885,11 +4892,7 @@ cannot be adequately worked around on the client side of the wire.") (build-system gnu-build-system) (arguments `(#:configure-flags - (list "--disable-static" - ;; Disable zero malloc check that fails when cross-compiling. - ,@(if (%current-target-system) - '("--disable-malloc0returnsnull") - '())))) + (list "--disable-static" ,@(malloc0-flags)))) (propagated-inputs `(("xorgproto" ,xorgproto))) (inputs @@ -5562,11 +5565,7 @@ draggable titlebars and borders.") (assoc-ref %outputs "doc") "/share/man") "--disable-static" - - ;; Disable zero malloc check that fails when cross-compiling. - ,@(if (%current-target-system) - '("--disable-malloc0returnsnull") - '())))) + ,@(malloc0-flags)))) (propagated-inputs `(("xorgproto" ,xorgproto) ("libxcb" ,libxcb))) @@ -5644,10 +5643,7 @@ draggable titlebars and borders.") (assoc-ref %outputs "doc") "/share/man") "--disable-static" - ;; Disable zero malloc check that fails when cross-compiling. - ,@(if (%current-target-system) - '("--disable-malloc0returnsnull") - '())))) + ,@(malloc0-flags)))) (propagated-inputs `(("libx11" ,libx11) ("libice" ,libice) -- 2.33.0