GNU bug report logs - #54212
[PATCH] gnu: cross-base: Don't specify mingw --with-newlib

Previous Next

Package: guix-patches;

Reported by: Carl Dong <contact <at> carldong.me>

Date: Tue, 1 Mar 2022 17:00:02 UTC

Severity: normal

Tags: patch

Fixed in version 34e9eae68c9583acce5abc4100add3d88932a5ae

Done: Carl Dong <contact <at> carldong.me>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 54212 in the body.
You can then email your comments to 54212 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#54212; Package guix-patches. (Tue, 01 Mar 2022 17:00:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Carl Dong <contact <at> carldong.me>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Tue, 01 Mar 2022 17:00:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Carl Dong <contact <at> carldong.me>
To: guix-patches <at> gnu.org
Cc: Carl Dong <contact <at> carldong.me>, janneke <at> gnu.org
Subject: [PATCH] gnu: cross-base: Don't specify mingw --with-newlib
Date: Tue,  1 Mar 2022 11:57:45 -0500
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





bug marked as fixed in version 34e9eae68c9583acce5abc4100add3d88932a5ae, send any further explanations to 54212 <at> debbugs.gnu.org and Carl Dong <contact <at> carldong.me> Request was from Carl Dong <contact <at> carldong.me> to control <at> debbugs.gnu.org. (Thu, 17 Mar 2022 02:17:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 14 Apr 2022 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 61 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.