From unknown Sun Jun 15 01:08:43 2025 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 Content-Transfer-Encoding: 8bit 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-Spam-Score: -1.7 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.7 (--) 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: ;; -- 2.34.1 From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 16 22:16:27 2022 Received: (at control) by debbugs.gnu.org; 17 Mar 2022 02:16:27 +0000 Received: from localhost ([127.0.0.1]:52619 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUfgh-0007Gn-JL for submit@debbugs.gnu.org; Wed, 16 Mar 2022 22:16:27 -0400 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]:51417) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nUfgf-0007GZ-BB for control@debbugs.gnu.org; Wed, 16 Mar 2022 22:16:26 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 1D8C23201FC9 for ; Wed, 16 Mar 2022 22:16:19 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Wed, 16 Mar 2022 22:16:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=carldong.me; h= cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to; s=fm1; bh=FoGLLVutJiZDp1azoNHb+0DRx0KEtz/STYdvTC Z4pjc=; b=hEV2901PDCr0apCu5sGSAejSl46E7na0DCeNrWRH8I4H/I34j9fO05 W9dPNEj2Im66TG/oO/De87pmaXNnXsXUpK+tGP6hLJE59QdowOPhaTqxBe06gBbq V//OrY7u1mZsrLPDM+EsqwxU8pCCfObb/56SvkqTNveWFpHYeu3AW0TcAOQ7cXP+ JwUqfkRTzPQLaB3+fWqJVBS67KQCNXmGWaJ+WsLNsFMPbNg+jByTp6ahhkggU4hC OUWd0EIXrioSJPuHOw//PBrNhoV/U5x+yv23ulkG8zxyZJSKMHZzGHefxxNI94GA ljnaFmJJNfHVqHX5C52s6yls/Nnw19rg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :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=fm3; bh=FoGLLVutJiZDp1azo NHb+0DRx0KEtz/STYdvTCZ4pjc=; b=W9p/v7+Sh8UdOKI+ICoqK4yyP26tlD2eG 9X0fxNF9IlwUz1BAU5FLcdxcYzlh+sGhU0fIwDYADFpDs2WLRP2D/1Sm74Ga8L1q y5d5DDrC+5H97u014GjqBsU2J1GWuijVFcYOBSL6B1Qccdu0GDI/9jWGesWxATDU 1jlVcO8y80Ht4W6NTYbhFkHt/sIkHgNBqEE7BBbSvGElld9nQTGs6rbDldz3QGzq LlOwoglD+dmNJLMID/icRyudSKw+hk2XUpMntkye+9FK9WeXnu0wW9bV0aj4X9Q4 TnwaT103bVks6lRPCHh4EqIzKKlijanYP9fx1Xk7IJmEqgC7VlCQg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudeffedggeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhtgfgggfukfffvffosehtjehmtd hhtddvnecuhfhrohhmpeevrghrlhcuffhonhhguceotghonhhtrggtthestggrrhhlugho nhhgrdhmvgeqnecuggftrfgrthhtvghrnheptddvfeelfeffueejgeelhfeitdekieetfe ethfffgeekveefjefhudetheegveefnecuvehluhhsthgvrhfuihiivgeptdenucfrrghr rghmpehmrghilhhfrhhomheptghonhhtrggtthestggrrhhlughonhhgrdhmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 16 Mar 2022 22:16:18 -0400 (EDT) From: Carl Dong Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.60.0.1.1\)) Subject: Closing 54212 Message-Id: <0AED24F2-B6B5-4B16-9F7F-FCB197ED4683@carldong.me> Date: Wed, 16 Mar 2022 22:16:17 -0400 To: control@debbugs.gnu.org X-Mailer: Apple Mail (2.3693.60.0.1.1) X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) close 54212 34e9eae68c9583acce5abc4100add3d88932a5ae