From patchwork Tue Mar 1 16:57:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carl Dong X-Patchwork-Id: 37568 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 2838C27BBE9; Tue, 1 Mar 2022 17:01:14 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id F209227BBEA for ; Tue, 1 Mar 2022 17:01:12 +0000 (GMT) Received: from localhost ([::1]:43268 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nP5s8-0006OG-11 for patchwork@mira.cbaines.net; Tue, 01 Mar 2022 12:01:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34362) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nP5r1-0006Ni-4Q for guix-patches@gnu.org; Tue, 01 Mar 2022 12:00:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:44206) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nP5r0-0001RY-Pl for guix-patches@gnu.org; Tue, 01 Mar 2022 12:00:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nP5r0-0002HY-J3 for guix-patches@gnu.org; Tue, 01 Mar 2022 12:00:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#54212] [PATCH] gnu: cross-base: Don't specify mingw --with-newlib Resent-From: Carl Dong Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 01 Mar 2022 17:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 54212 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54212@debbugs.gnu.org Cc: Carl Dong , janneke@gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16461539878715 (code B ref -1); Tue, 01 Mar 2022 17:00:02 +0000 Received: (at submit) by debbugs.gnu.org; 1 Mar 2022 16:59:47 +0000 Received: from localhost ([127.0.0.1]:38103 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nP5qk-0002GV-SO for submit@debbugs.gnu.org; Tue, 01 Mar 2022 11:59:47 -0500 Received: from lists.gnu.org ([209.51.188.17]:33712) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nP5qj-0002GM-AZ for submit@debbugs.gnu.org; Tue, 01 Mar 2022 11:59:45 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34328) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nP5qj-0006Mx-2g for guix-patches@gnu.org; Tue, 01 Mar 2022 11:59:45 -0500 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:53769) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nP5qh-0001Om-1O; Tue, 01 Mar 2022 11:59:44 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 8B07B3200F3B; Tue, 1 Mar 2022 11:59:39 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Tue, 01 Mar 2022 11:59:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=carldong.me; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm3; bh=6dPGZRHGYkb1tptLzz6NRPSLMAcM9YWoq5ct3uqZ1yw=; b=CTZ5o kQwijefJcrXLiCwy6wkwTjoaOsQuUCNrcJ0Xsxn7h3Qsknlw3/8pywo7SxdSsTho 4dtsCK8llk7Poczb7+2VRk/xtSzFKhcmBrPiJZmWlvzj+A5xw+l6eqDJpijkl229 oyRmJsc0z/6eVIwattvAmdLraRjNCHQ5WbRxkRBodqnicUR0S1xzrZfP2iYLquSf Dk9mECiZUZovLFs6aaeAEI1qTBHqCDl+ahp33AO/ljcyziorNjrVlwkuzysRlPVP nqNi/dV4lpcFg2g61VBTvnEdHlkbp7QS4ewtjAHYeGUtjWV7Mw5J7gUuJK6S88Ro TE5h5iSpBBfSx+QTg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :from:from:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=6dPGZRHGYkb1tptLzz6NRPSLMAcM9 YWoq5ct3uqZ1yw=; b=ig96JR8RngS7YNZ9+nkKDtkRq96cnbiHH7WoFlNAw25Pt Lq3+vR6xCG1q3SmZuh07kgCXD+H5i6V6hM1C3owitwT3MlIO2xUyXDx3PSRvr2Zc mWOZNFjGY/dc7yrMV/NLeuDYr2x8p2Vz/AufbTqN26dh70218icVVJQ7laSUqO5o 3BQhBQTnbODsS+8hqHWhOsWNKcB5CKDLvBt0qxMhzAI/qrtKMMsjuxTcXu+TrKyy MADOyFyFlP0qefm7GAFT+XXGxWLA2Y6ZRlFKbH05NXHXmnN7lt5TJc9FAWuaJtCB VWToCsFeYOn6+8d8gz7/sC1tf/k62QgO03PICvX5w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddruddtvddgleefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgggfestdekredtre dttdenucfhrhhomhepvegrrhhlucffohhnghcuoegtohhnthgrtghtsegtrghrlhguohhn ghdrmhgvqeenucggtffrrghtthgvrhhnpeelueeuleelieekffdtueeifeevhfejfffhff ejheevleehffffieeigeetjeevkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgr mhepmhgrihhlfhhrohhmpegtohhnthgrtghtsegtrghrlhguohhnghdrmhgv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 1 Mar 2022 11:59:38 -0500 (EST) From: Carl Dong Date: Tue, 1 Mar 2022 11:57:45 -0500 Message-Id: <20220301165744.2778077-1-contact@carldong.me> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Received-SPF: pass client-ip=64.147.123.19; envelope-from=contact@carldong.me; helo=wout3-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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches I can commit this myself if someone gives a sanity check. Won't cause rebuilds since it's all cross-base changes. ----- Previous to this commit, we added a --with-newlib configure flag to cross-gcc when cross-newlib?, but cross-newlib? is true only when target-mingw?. It turns out that specifying --with-newlib disables the GLIBCXX_CROSSCONFIG check, which is used to detect _GLIBCXX_HAVE__WFOPEN, which is required in C++17 std::filesystem for mingw-w64 systems. Additional context: In gnu/packages/embedded.scm, --with-newlib is specified explicitly when we're actually using newlib, which seems like the correct way of handling it. Situation in other distros: - Debian's gcc-mingw-w64 doesn't specify --with-newlib - Fedora's mingw64-gcc-c++ explicitly specifies --without-newlib Chesterton's fence: Chatting with janneke, who originally added this mechanism, reveals that this flag is not only no longer required, but also that removing it doesn't break his guile-mingw builds. See IRC logs of #guix for 2022-02-15. * gnu/packages/cross-base.scm (cross-gcc-arguments): Don't check for and specify --with-newlib. (cross-libc): Check for mingw and use mingw-w64 directly. (cross-newlib?): Remove, unexport. (native-libc): Remove. --- gnu/packages/cross-base.scm | 32 +++++--------------------------- 1 file changed, 5 insertions(+), 27 deletions(-) diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm index 529144d127..66412b9e92 100644 --- a/gnu/packages/cross-base.scm +++ b/gnu/packages/cross-base.scm @@ -42,7 +42,6 @@ (define-module (gnu packages cross-base) #:export (cross-binutils cross-libc cross-gcc - cross-newlib? cross-kernel-headers)) (define-syntax %xgcc @@ -177,10 +176,6 @@ (define (cross-gcc-arguments target xgcc libc) `((string-append "--with-toolexeclibdir=" (assoc-ref %outputs "lib") "/" ,target "/lib")) - '()) - ;; For a newlib (non-glibc) target - ,@(if (cross-newlib? target) - '("--with-newlib") '())) ,(if libc @@ -489,10 +484,11 @@ (define* (cross-libc target (xheaders (cross-kernel-headers target))) "Return LIBC cross-built for TARGET, a GNU triplet. Use XGCC and XBINUTILS and the cross tool chain." - (if (cross-newlib? target libc) - (native-libc target libc - #:xgcc xgcc - #:xbinutils xbinutils) + (if (target-mingw? target) + (let ((machine (substring target 0 (string-index target #\-)))) + (make-mingw-w64 machine + #:xgcc xgcc + #:xbinutils xbinutils)) (package (inherit libc) (name (string-append "glibc-cross-" target)) @@ -553,24 +549,6 @@ (define* (cross-libc target ,@(package-inputs libc) ;FIXME: static-bash ,@(package-native-inputs libc)))))) -(define* (native-libc target - #:optional - (libc glibc) - #:key - xgcc - xbinutils) - (if (target-mingw? target) - (let ((machine (substring target 0 (string-index target #\-)))) - (make-mingw-w64 machine - #:xgcc xgcc - #:xbinutils xbinutils)) - libc)) - -(define* (cross-newlib? target - #:optional - (libc glibc)) - (not (eq? (native-libc target libc) libc))) - ;;; Concrete cross tool chains are instantiated like this: ;;