On Tue, Mar 10, 2020 at 10:13:37AM +0100, Ludovic Courtès wrote:
> [email protected] skribis:
> 
> > commit 7a57ca758c590742b63100944f07fddb7290f797
> > Author: Jan Nieuwenhuizen <[email protected]>
> > AuthorDate: Sun Mar 1 13:45:42 2020 +0100
> >
> >     gnu: commencement: gcc-boot0: Build fix for the Hurd.
> >     
> >     Fixes:
> >         g++   -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE   
> > -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall 
> > -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute 
> > -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros 
> > -Wno-overlength-strings   -DHAVE_CONFIG_H -DGENERATOR_FILE -fno-PIE 
> > -static-libstdc++ -static-libgcc 
> > -Wl,-rpath=/gnu/store/vp2id82a597p119b3wyhhkhd467wvn78-glibc-bootstrap-0/lib
> >  -Wl,-dynamic-linker -Wl,/gnu/store/vp2id82a597p119b3w [...]
> >             build/genmddeps.o build/read-md.o build/errors.o 
> > ../build-i586-unknown-gnu/libiberty/libiberty.a
> >         
> > /gnu/store/jk3kx5jwjs9m60svzk6sz79bf0w33l91-binutils-cross-boot0-2.34/bin/ld:
> >  build/read-md.o: in function `md_reader::~md_reader()':
> >         
> > /tmp/guix-build-gcc-cross-boot0-7.5.0.drv-0/build/gcc/../../gcc-7.5.0/gcc/read-md.c:1049:
> >  undefined reference to `operator delete(void*, unsigned int)'
> >     
> >     This raises the question: Should libstdc++-boot0 (v4.9) be sufficient 
> > to build
> >     gcc-boot0 (v7.5.0)?
> 
> Hmm?  :-)
> 
> >     * gnu/packages/commencement.scm (gcc-boot0): Add static library path.
> 
> >                 `(,(string-append "LDFLAGS="
> > +                                 (if ,(hurd-system?)
> > +                                     (string-append
> > +                                      "-L" (assoc-ref %build-inputs "gcc") 
> > "/lib ")
> > +                                     "")
> 
> Could you add a comment saying that this is to allow the ‘delete’
> operator to be found?  Weird.
> 
> That’s it, thanks for the great work!
> 
> Ludo’.
> 

With the bootstrapping efforts going around there's a couple of patches
floating around to change the gcc version for libstdc++-boot0. I've
tested the following patch, which also prepares the way for any other
future supported platforms.

-- 
Efraim Flashner   <[email protected]>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
From 4506c48da7df4397d459337988adbdd54c0d440d Mon Sep 17 00:00:00 2001
From: Efraim Flashner <[email protected]>
Date: Thu, 13 Feb 2020 10:47:34 +0200
Subject: [PATCH 1/2] gnu: libstdc++-boot0: Use per-architecture gcc versions.

* gnu/packages/commencement.scm (libstdc++-boot0): Use a version of gcc
more closely tied to their bootstrap process.
---
 gnu/packages/commencement.scm | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 2a0a83ad49..b5cb08a19a 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -3,7 +3,7 @@
 ;;; Copyright © 2014 Andreas Enge <[email protected]>
 ;;; Copyright © 2012 Nikita Karetnikov <[email protected]>
 ;;; Copyright © 2014, 2015, 2017 Mark H Weaver <[email protected]>
-;;; Copyright © 2017, 2018, 2019 Efraim Flashner <[email protected]>
+;;; Copyright © 2017, 2018, 2019, 2020 Efraim Flashner <[email protected]>
 ;;; Copyright © 2018 Tobias Geerinckx-Rice <[email protected]>
 ;;; Copyright © 2018 Jan (janneke) Nieuwenhuizen <[email protected]>
 ;;; Copyright © 2019 Marius Bakke <[email protected]>
@@ -1427,9 +1427,12 @@ exec " gcc "/bin/" program
 (define libstdc++-boot0
   ;; GCC's libcc1 is always built as a shared library (the top-level
   ;; 'Makefile.def' forcefully adds --enable-shared) and thus needs to refer
-  ;; to libstdc++.so.  We cannot build libstdc++-5.3 because it relies on
-  ;; C++14 features missing in some of our bootstrap compilers.
-  (let ((lib (make-libstdc++ gcc-4.9)))
+  ;; to libstdc++.so.  We therefore use a version of GCC which most closely
+  ;; matches the bootstrap compiler of that architecture.
+  (let ((lib (make-libstdc++
+               (match (%current-system)
+                 ("aarch64-linux" gcc-5)
+                 (_ gcc-4.9)))))
     (package
       (inherit lib)
       (source (bootstrap-origin (package-source lib)))
-- 
2.25.0

Attachment: signature.asc
Description: PGP signature

Reply via email to