From fbdf746826b308a9d23644fbb5bea93dee5e85e9 Mon Sep 17 00:00:00 2001 From: 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 | 10 ++++++++++ 3 files changed, 25 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 8c00b0020..ee9429770 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -623,6 +623,7 @@ dist_patch_DATA = \ %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 a22bb3c25..9cf347f76 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -414,7 +414,8 @@ Go. It also includes runtime support libraries for these languages.") (base32 "05xwps0ci7wgxh50askpa2r9p8518qxdgh6ad7pnyk7n6p13d0ca")) (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")))))) ;; Note: When changing the default gcc version, update ;; the gcc-toolchain-* definitions and the gfortran definition @@ -565,6 +566,18 @@ as the 'native-search-paths' field." ;; a cyclic dependency. #:separate-lib-output? #f)) +(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, creating + ;; a cyclic dependency. + #:separate-lib-output? #f + ;; When building go, it is expected to use the same GCC output + ;; 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/patches/gcc-7.1-go-runpath.patch new file mode 100644 index 000000000..d7d91301e --- /dev/null +++ b/gnu/packages/patches/gcc-7.1-go-runpath.patch @@ -0,0 +1,10 @@ +--- 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 = $(GOC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) + GOCOMPILE = $(GOCOMPILER) $(GOCFLAGS) +-AM_LDFLAGS = -L $(libgodir) -L $(libgodir)/.libs ++AM_LDFLAGS = -Wl,-rpath=$(libdir) -L $(libgodir) -L $(libgodir)/.libs + GOLINK = $(GOCOMPILER) $(GOCFLAGS) $(AM_GOCFLAGS) $(LDFLAGS) $(AM_LDFLAGS) -o $@ + cmdsrcdir = $(srcdir)/../libgo/go/cmd -- 2.14.0