From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41373) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1drihi-0004gY-VX for guix-patches@gnu.org; Tue, 12 Sep 2017 06:46:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1drihe-0005vn-Pa for guix-patches@gnu.org; Tue, 12 Sep 2017 06:46:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:54350) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1drihe-0005vX-JD for guix-patches@gnu.org; Tue, 12 Sep 2017 06:46:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1drihe-0002bN-9g for guix-patches@gnu.org; Tue, 12 Sep 2017 06:46:02 -0400 Subject: [bug#28226] Build go with gccgo Resent-Message-ID: Date: Tue, 12 Sep 2017 13:44:47 +0300 From: Efraim Flashner Message-ID: <20170912104447.GA3972@macbook42.flashner.co.il> References: <20170824205146.GM2484@macbook42.flashner.co.il> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="JP+T4n/bALQSJXh8" Content-Disposition: inline In-Reply-To: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Catonano Cc: 28226@debbugs.gnu.org --JP+T4n/bALQSJXh8 Content-Type: multipart/mixed; boundary="0OAP2g/MAC+5xKAE" Content-Disposition: inline --0OAP2g/MAC+5xKAE Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Sep 12, 2017 at 11:59:31AM +0200, Catonano wrote: > 2017-08-24 22:51 GMT+02:00 Efraim Flashner : >=20 > > I need some help testing this on x86_64, I did all the building and > > testing on aarch64. It turns out there's a known issues in the cgo > > implementation that causes the test suite to fail on aarch64. With this > > patch set I was able to build gccgo@7 -> go@1.7 -> lfam's syncthing. > > >=20 > I can't apply these patches >=20 > ~/projects/guix$ git am > 0001-gnu-custom-gcc-Add-flag-to-optionally-not-remove-con.patch > Applying: gnu: custom-gcc: Add flag to optionally not remove conflicting > files. >=20 > ~/projects/guix$ git am 0002-gnu-Add-gccgo-7.patch > Applying: gnu: Add gccgo@7. > error: patch non riuscita: gnu/packages/gcc.scm:414 > error: gnu/packages/gcc.scm: la patch non pu=C3=B2 essere applicata > Patch failed at 0001 gnu: Add gccgo@7. > The copy of the patch that failed is found in: .git/rebase-apply/patch > When you have resolved this problem, run "git am --continue". > If you prefer to skip this patch, run "git am --skip" instead. > To restore the original branch and stop patching, run "git am --abort". >=20 >=20 > I don't know what these patches do, I was just trying to apply them in > order (1, 2, 3) >=20 > Should I follow a different order ? >=20 > I would have attempted to build this thing >=20 > I git pulled on master right now ( 12 september) and created a branch for > thhese patches and git am'ed there I've reattached the patches, seems they don't apply cleanly anymore --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --0OAP2g/MAC+5xKAE Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0001-gnu-custom-gcc-Add-flag-to-optionally-not-remove-con.patch" Content-Transfer-Encoding: quoted-printable =46rom 649980fb84726ba758f68e40b836974148154428 Mon Sep 17 00:00:00 2001 =46rom: Efraim Flashner Date: Mon, 7 Aug 2017 22:56:57 +0300 Subject: [PATCH 1/3] gnu: custom-gcc: Add flag to optionally not remove conflicting files. * gnu/packages/gcc.scm (custom-gcc): Add flag to optionally keep the files that would conflict with gcc. --- gnu/packages/gcc.scm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index da4d66ce36..14a49b9aac 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -486,7 +486,8 @@ using compilers other than GCC." (define* (custom-gcc gcc name languages #:optional (search-paths (package-native-search-paths gcc)) - #:key (separate-lib-output? #t)) + #:key (separate-lib-output? #t) + (remove-conflicting-files? #t)) "Return a custom version of GCC that supports LANGUAGES. Use SEARCH-PAT= HS as the 'native-search-paths' field." (package (inherit gcc) @@ -509,12 +510,14 @@ as the 'native-search-paths' field." ,flags))) ((#:phases phases) `(modify-phases ,phases - (add-after 'install 'remove-broken-or-conflicting-files + ,@(if remove-conflicting-files? + `((add-after 'install 'remove-broken-or-conflicting-files (lambda* (#:key outputs #:allow-other-keys) (for-each delete-file (find-files (string-append (assoc-ref outputs "ou= t") "/bin") ".*(c\\+\\+|cpp|g\\+\\+|gcov|gcc.*)")) - #t)))))))) + #t))) + '()))))))) =20 (define %generic-search-paths ;; This is the language-neutral search path for GCC. Entries in $CPATH = are --=20 2.14.1 --0OAP2g/MAC+5xKAE Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0002-gnu-Add-gccgo-7.patch" Content-Transfer-Encoding: quoted-printable =46rom 6917ddf5d319df740b63e5a2f50c7d0da0bbfea9 Mon Sep 17 00:00:00 2001 =46rom: Efraim Flashner Date: Mon, 7 Aug 2017 22:59:22 +0300 Subject: [PATCH 2/3] gnu: Add gccgo@7. * gnu/packages/gcc.scm (gccgo@7): New variable. * gnu/packages/gcc.scm (gcc@7)[source]: Add patch. * gnu/packages/patches/gcc-7.1-go-runpath.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. --- gnu/local.mk | 1 + gnu/packages/gcc.scm | 15 ++++++++++++++- gnu/packages/patches/gcc-7.1-go-runpath.patch | 13 +++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/gcc-7.1-go-runpath.patch diff --git a/gnu/local.mk b/gnu/local.mk index 643a88db81..9b61b16578 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -628,6 +628,7 @@ dist_patch_DATA =3D \ %D%/packages/patches/gcc-5-source-date-epoch-2.patch \ %D%/packages/patches/gcc-6-arm-none-eabi-multilib.patch \ %D%/packages/patches/gcc-6-cross-environment-variables.patch \ + %D%/packages/patches/gcc-7.1-go-runpath.patch \ %D%/packages/patches/gcr-disable-failing-tests.patch \ %D%/packages/patches/gcr-fix-collection-tests-to-work-with-gpg-21.patch \ %D%/packages/patches/gdk-pixbuf-list-dir.patch \ diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index 14a49b9aac..aca2e19696 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -415,7 +415,8 @@ Go. It also includes runtime support libraries for the= se languages.") (base32 "16j7i0888j2f1yp9l0nhji6cq65dy6y4nwy8868a8njbzzwavxqw")) (patches (search-patches "gcc-strmov-store-file-names.patch" - "gcc-5.0-libvtv-runpath.patch")))))) + "gcc-5.0-libvtv-runpath.patch" + "gcc-7.1-go-runpath.patch")))))) =20 ;; Note: When changing the default gcc version, update ;; the gcc-toolchain-* definitions and the gfortran definition @@ -566,6 +567,18 @@ as the 'native-search-paths' field." ;; a cyclic dependency. #:separate-lib-output? #f)) =20 +(define-public gccgo-7 + (custom-gcc gcc-7 "gccgo" '("go") + %generic-search-paths + ;; Suppress the separate "lib" output, because otherwise the + ;; "lib" and "out" outputs would refer to each other, creati= ng + ;; a cyclic dependency. + #:separate-lib-output? #f + ;; When building go, it is expected to use the same GCC outp= ut + ;; for gcc and for gccgo, so we compile go with the gcc from + ;; this build. + #:remove-conflicting-files? #f)) + (define-public gcc-objc-4.8 (custom-gcc gcc-4.8 "gcc-objc" '("objc") (list (search-path-specification diff --git a/gnu/packages/patches/gcc-7.1-go-runpath.patch b/gnu/packages/p= atches/gcc-7.1-go-runpath.patch new file mode 100644 index 0000000000..e1ff2fc034 --- /dev/null +++ b/gnu/packages/patches/gcc-7.1-go-runpath.patch @@ -0,0 +1,13 @@ +--- gcc-7.1.0/gotools/Makefile.in ++++ gcc-7.1.0/gotools/Makefile.in +@@ -258,6 +258,6 @@ + # Use the compiler we just built. + @NATIVE_TRUE@GOCOMPILER =3D $(GOC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) + GOCOMPILE =3D $(GOCOMPILER) $(GOCFLAGS) +-AM_LDFLAGS =3D -L $(libgodir) -L $(libgodir)/.libs ++AM_LDFLAGS =3D -Wl,-rpath=3D$(libdir) -L $(libgodir) -L $(libgodir)/.libs + GOLINK =3D $(GOCOMPILER) $(GOCFLAGS) $(AM_GOCFLAGS) $(LDFLAGS) $(AM_LDFLA= GS) -o $@ + cmdsrcdir =3D $(srcdir)/../libgo/go/cmd +--=20 +2.14.0 + --=20 2.14.1 --0OAP2g/MAC+5xKAE Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="0003-gnu-go-Build-with-gccgo-7.patch" Content-Transfer-Encoding: quoted-printable =46rom 5ae1423b545a1284a840ee883e2781bb92b49741 Mon Sep 17 00:00:00 2001 =46rom: Efraim Flashner Date: Mon, 7 Aug 2017 23:09:29 +0300 Subject: [PATCH 3/3] gnu: go: Build with gccgo@7. * gnu/packages/golang.scm (go@1.8)[inputs]: Remove gcc-lib. [native-inputs]: Remove go@1.4, add gccgo@7. --- gnu/packages/golang.scm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm index 9f3ccc8f69..be5f2f8e37 100644 --- a/gnu/packages/golang.scm +++ b/gnu/packages/golang.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright =C2=A9 2016 Efraim Flashner +;;; Copyright =C2=A9 2016, 2017 Efraim Flashner ;;; Copyright =C2=A9 2016 Matthew Jordan ;;; Copyright =C2=A9 2016 Andy Wingo ;;; Copyright =C2=A9 2016 Ludovic Court=C3=A8s @@ -220,7 +220,7 @@ sequential processes (CSP) concurrent programming featu= res added.") (replace 'prebuild ;; TODO: Most of this could be factorized with Go 1.4. (lambda* (#:key inputs outputs #:allow-other-keys) - (let* ((gcclib (string-append (assoc-ref inputs "gcc:lib") = "/lib")) + (let* ((gcclib (string-append (assoc-ref inputs "go") "/lib= ")) (ld (string-append (assoc-ref inputs "libc") "/lib")) (loader (car (find-files ld "^ld-linux.+"))) (net-base (assoc-ref inputs "net-base")) @@ -370,8 +370,11 @@ sequential processes (CSP) concurrent programming feat= ures added.") "LICENSE" "VERSION" "CONTRIBUTING.md" "robots.txt")) =20 (copy-recursively "../" output)))))))) + (inputs + `(("tzdata" ,tzdata) + ("pcre" ,pcre))) (native-inputs - `(("go" ,go-1.4) + `(("go" ,gccgo-7) ,@(package-native-inputs go-1.4))))) =20 (define-public go go-1.9) --=20 2.14.1 --0OAP2g/MAC+5xKAE-- --JP+T4n/bALQSJXh8 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAlm3upkACgkQQarn3Mo9 g1HG/xAApWGWdAPo5yfqCnPrpZC43dN3bHVzj5DhHpHsZgsfuX48kOPSCY988eqb ATM/4rz3Uuo4o23sM5S1QFBijHw6M3EpIm3kllwuhCb58rpQOzCyxWqGcW3wkOmh A2/UO28R81vtlXmTTIrX3tchFea4CYIlkyhg4LtZW3Hg8gXXpvrZ1bYKyd6cpRQw zLvZ9gS98YPoaPyAKC8Ktd1+REXtcoeekjwUDJk4Ln6AkPq2sjfqTqicUPWDtVB6 GEFrakdKgTEFaL3jMrBbPy4lM56ljC+i8HP/eh19Qg9Be8TnmwSps6ifYdhdQJPV dunOj8VrCdiqQ5bNySb+W4hBPJle1oJfYbYcFVaTgA+LW8l/vPmhfF1zFW65fcsR QIAMaFvKNDQBrld6cFPSsrg+YcWzWSAgSVGQ81r982ipBufuHkZWvaujDzVDB59c bPCiqVZE2qIE4xRHYAELTFRpJMOTszJP/ASqcNTl5ilx5bA2c3zZqKujhHn5T32X GuZ/t+h6JC0GjH9HcqlaGUvB+b0XNMWRlOA51WYp8miKEyS0wdL549ViUQQBj2Ur f9xzth8KuhBTtZO9gCmHhOwjosXLLP3+tOx51hWPbsxZeDzFW+tzdztnqQT7nh4b jhH12W7RAa6eNURYsicXbRpnIRgqQmf+GirW7rCZorQpm+T7BjU= =otmL -----END PGP SIGNATURE----- --JP+T4n/bALQSJXh8--