From patchwork Wed Aug 25 18:03:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: M X-Patchwork-Id: 32286 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 081AF27BBE4; Wed, 25 Aug 2021 19:06:48 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 99F9027BBE1 for ; Wed, 25 Aug 2021 19:06:47 +0100 (BST) Received: from localhost ([::1]:35814 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mIxIU-0005I3-ON for patchwork@mira.cbaines.net; Wed, 25 Aug 2021 14:06:46 -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 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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)