Accepting request 967905 from devel:languages:go
- Template gcc-go.patch to substitute gcc_go_version and eliminate multiple similar patches each with hardcoded gcc go binary name. gcc-go.patch inserts gcc-go binary name e.g. go-8 to compensate for current lack of gcc-go update-alternatives usage. * add gcc-go.patch * drop gcc6-go.patch * drop gcc7-go.patch - For SLE-12 set gcc_go_version to 8 to bootstrap using gcc8-go. gcc6-go and gcc7-go no longer successfully bootstrap go1.17 or go1.18 on SLE-12 aarch64 ppc64le or s390x. * gcc6-go fails with errors e.g. libnoder.a(_go_.o):(.toc+0x0): undefined reference to `__go_pimt__I4_DiagFrN4_boolee3 (forwarded request 967904 from jfkw) OBS-URL: https://build.opensuse.org/request/show/967905 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/go1.18?expand=0&rev=7
This commit is contained in:
commit
9d92b07cb5
@ -2,12 +2,12 @@ Index: go/src/cmd/dist/buildtool.go
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- go.orig/src/cmd/dist/buildtool.go
|
--- go.orig/src/cmd/dist/buildtool.go
|
||||||
+++ go/src/cmd/dist/buildtool.go
|
+++ go/src/cmd/dist/buildtool.go
|
||||||
@@ -190,7 +190,7 @@ func bootstrapBuildTools() {
|
@@ -205,7 +205,7 @@ func bootstrapBuildTools() {
|
||||||
// only applies to the final cmd/go binary, but that's OK: if this is Go 1.10
|
// only applies to the final cmd/go binary, but that's OK: if this is Go 1.10
|
||||||
// or later we don't need to disable inlining to work around bugs in the Go 1.4 compiler.
|
// or later we don't need to disable inlining to work around bugs in the Go 1.4 compiler.
|
||||||
cmd := []string{
|
cmd := []string{
|
||||||
- pathf("%s/bin/go", goroot_bootstrap),
|
- pathf("%s/bin/go", goroot_bootstrap),
|
||||||
+ pathf("%s/bin/go-6", goroot_bootstrap),
|
+ pathf("%s/bin/go-$gcc_go_version", goroot_bootstrap),
|
||||||
"install",
|
"install",
|
||||||
"-gcflags=-l",
|
"-gcflags=-l",
|
||||||
"-tags=math_big_pure_go compiler_bootstrap",
|
"-tags=math_big_pure_go compiler_bootstrap",
|
||||||
@ -20,27 +20,27 @@ Index: go/src/make.bash
|
|||||||
#
|
#
|
||||||
# GOROOT_BOOTSTRAP: A working Go tree >= Go 1.4 for bootstrap.
|
# GOROOT_BOOTSTRAP: A working Go tree >= Go 1.4 for bootstrap.
|
||||||
-# If $GOROOT_BOOTSTRAP/bin/go is missing, $(go env GOROOT) is
|
-# If $GOROOT_BOOTSTRAP/bin/go is missing, $(go env GOROOT) is
|
||||||
+# If $GOROOT_BOOTSTRAP/bin/go-6 is missing, $(go env GOROOT) is
|
+# If $GOROOT_BOOTSTRAP/bin/go-$gcc_go_version is missing, $(go env GOROOT) is
|
||||||
# tried for all "go" in $PATH. $HOME/go1.4 by default.
|
# tried for all "go" in $PATH. $HOME/go1.4 by default.
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
@@ -162,8 +162,8 @@
|
@@ -176,8 +176,8 @@
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done; unset IFS
|
done; unset IFS
|
||||||
-if [ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]; then
|
-if [ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]; then
|
||||||
- echo "ERROR: Cannot find $GOROOT_BOOTSTRAP/bin/go." >&2
|
- echo "ERROR: Cannot find $GOROOT_BOOTSTRAP/bin/go." >&2
|
||||||
+if [ ! -x "$GOROOT_BOOTSTRAP/bin/go-6" ]; then
|
+if [ ! -x "$GOROOT_BOOTSTRAP/bin/go-$gcc_go_version" ]; then
|
||||||
+ echo "ERROR: Cannot find $GOROOT_BOOTSTRAP/bin/go-6." >&2
|
+ echo "ERROR: Cannot find $GOROOT_BOOTSTRAP/bin/go-$gcc_go_version." >&2
|
||||||
echo "Set \$GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4." >&2
|
echo "Set \$GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4." >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -181,7 +181,7 @@
|
@@ -195,7 +195,7 @@
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
rm -f cmd/dist/dist
|
rm -f cmd/dist/dist
|
||||||
-GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" GO111MODULE=off "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist
|
-GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" GO111MODULE=off "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist
|
||||||
+GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" GO111MODULE=off "$GOROOT_BOOTSTRAP/bin/go-6" build -o cmd/dist/dist ./cmd/dist
|
+GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" GO111MODULE=off "$GOROOT_BOOTSTRAP/bin/go-$gcc_go_version" build -o cmd/dist/dist ./cmd/dist
|
||||||
|
|
||||||
# -e doesn't propagate out of eval, so check success by hand.
|
# -e doesn't propagate out of eval, so check success by hand.
|
||||||
eval $(./cmd/dist/dist env -p || echo FAIL=true)
|
eval $(./cmd/dist/dist env -p || echo FAIL=true)
|
||||||
@ -48,30 +48,30 @@ Index: go/src/make.rc
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- go.orig/src/make.rc
|
--- go.orig/src/make.rc
|
||||||
+++ go/src/make.rc
|
+++ go/src/make.rc
|
||||||
@@ -52,7 +52,7 @@ GOROOT = `{cd .. && pwd}
|
@@ -60,7 +60,7 @@ if(! ~ $#GOROOT_BOOTSTRAP 1){
|
||||||
if(! ~ $#GOROOT_BOOTSTRAP 1)
|
GOROOT_BOOTSTRAP = $home/$d
|
||||||
GOROOT_BOOTSTRAP = $home/go1.4
|
}
|
||||||
for(p in $path){
|
for(p in $path){
|
||||||
- if(! test -x $GOROOT_BOOTSTRAP/bin/go){
|
- if(! test -x $GOROOT_BOOTSTRAP/bin/go){
|
||||||
+ if(! test -x $GOROOT_BOOTSTRAP/bin/go-6){
|
+ if(! test -x $GOROOT_BOOTSTRAP/bin/go-$gcc_go_version){
|
||||||
if(go_exe = `{path=$p whatis go}){
|
if(go_exe = `{path=$p whatis go}){
|
||||||
goroot = `{GOROOT='' $go_exe env GOROOT}
|
goroot = `{GOROOT='' $go_exe env GOROOT}
|
||||||
if(! ~ $goroot $GOROOT){
|
if(! ~ $goroot $GOROOT){
|
||||||
@@ -61,7 +61,7 @@ for(p in $path){
|
@@ -73,7 +73,7 @@ for(p in $path){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
-if(! test -x $GOROOT_BOOTSTRAP/bin/go){
|
-if(! test -x $GOROOT_BOOTSTRAP/bin/go){
|
||||||
+if(! test -x $GOROOT_BOOTSTRAP/bin/go-6){
|
+if(! test -x $GOROOT_BOOTSTRAP/bin/go-$gcc_go_version){
|
||||||
echo 'ERROR: Cannot find '$GOROOT_BOOTSTRAP'/bin/go.' >[1=2]
|
echo 'ERROR: Cannot find '$GOROOT_BOOTSTRAP'/bin/go.' >[1=2]
|
||||||
echo 'Set $GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4.' >[1=2]
|
echo 'Set $GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4.' >[1=2]
|
||||||
exit bootstrap
|
exit bootstrap
|
||||||
@@ -75,7 +75,7 @@ if(~ $GOROOT_BOOTSTRAP $GOROOT){
|
@@ -87,7 +87,7 @@ if(~ $GOROOT_BOOTSTRAP $GOROOT){
|
||||||
echo 'Building Go cmd/dist using '^$GOROOT_BOOTSTRAP
|
echo 'Building Go cmd/dist using '^$GOROOT_BOOTSTRAP
|
||||||
if(~ $#vflag 1)
|
if(~ $#vflag 1)
|
||||||
echo cmd/dist
|
echo cmd/dist
|
||||||
-GOROOT=$GOROOT_BOOTSTRAP GOOS='' GOARCH='' GO111MODULE=off $GOROOT_BOOTSTRAP/bin/go build -o cmd/dist/dist ./cmd/dist
|
-GOROOT=$GOROOT_BOOTSTRAP GOOS='' GOARCH='' GO111MODULE=off $GOROOT_BOOTSTRAP/bin/go build -o cmd/dist/dist ./cmd/dist
|
||||||
+GOROOT=$GOROOT_BOOTSTRAP GOOS='' GOARCH='' $GOROOT_BOOTSTRAP/bin/go-6 build -o cmd/dist/dist ./cmd/dist
|
+GOROOT=$GOROOT_BOOTSTRAP GOOS='' GOARCH='' GO111MODULE=off $GOROOT_BOOTSTRAP/bin/go-$gcc_go_version build -o cmd/dist/dist ./cmd/dist
|
||||||
|
|
||||||
eval `{./cmd/dist/dist env -9}
|
eval `{./cmd/dist/dist env -9}
|
||||||
if(~ $#vflag 1)
|
if(~ $#vflag 1)
|
@ -1,77 +0,0 @@
|
|||||||
Index: go/src/cmd/dist/buildtool.go
|
|
||||||
===================================================================
|
|
||||||
--- go.orig/src/cmd/dist/buildtool.go
|
|
||||||
+++ go/src/cmd/dist/buildtool.go
|
|
||||||
@@ -190,7 +190,7 @@ func bootstrapBuildTools() {
|
|
||||||
// only applies to the final cmd/go binary, but that's OK: if this is Go 1.10
|
|
||||||
// or later we don't need to disable inlining to work around bugs in the Go 1.4 compiler.
|
|
||||||
cmd := []string{
|
|
||||||
- pathf("%s/bin/go", goroot_bootstrap),
|
|
||||||
+ pathf("%s/bin/go-7", goroot_bootstrap),
|
|
||||||
"install",
|
|
||||||
"-gcflags=-l",
|
|
||||||
"-tags=math_big_pure_go compiler_bootstrap",
|
|
||||||
Index: go/src/make.bash
|
|
||||||
===================================================================
|
|
||||||
--- go.orig/src/make.bash
|
|
||||||
+++ go/src/make.bash
|
|
||||||
@@ -60,7 +60,7 @@
|
|
||||||
# time goes when these scripts run.
|
|
||||||
#
|
|
||||||
# GOROOT_BOOTSTRAP: A working Go tree >= Go 1.4 for bootstrap.
|
|
||||||
-# If $GOROOT_BOOTSTRAP/bin/go is missing, $(go env GOROOT) is
|
|
||||||
+# If $GOROOT_BOOTSTRAP/bin/go-7 is missing, $(go env GOROOT) is
|
|
||||||
# tried for all "go" in $PATH. $HOME/go1.4 by default.
|
|
||||||
|
|
||||||
set -e
|
|
||||||
@@ -162,8 +162,8 @@
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done; unset IFS
|
|
||||||
-if [ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]; then
|
|
||||||
- echo "ERROR: Cannot find $GOROOT_BOOTSTRAP/bin/go." >&2
|
|
||||||
+if [ ! -x "$GOROOT_BOOTSTRAP/bin/go-7" ]; then
|
|
||||||
+ echo "ERROR: Cannot find $GOROOT_BOOTSTRAP/bin/go-7." >&2
|
|
||||||
echo "Set \$GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4." >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
@@ -181,7 +181,7 @@
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
rm -f cmd/dist/dist
|
|
||||||
-GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" GO111MODULE=off "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist
|
|
||||||
+GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" GO111MODULE=off "$GOROOT_BOOTSTRAP/bin/go-7" build -o cmd/dist/dist ./cmd/dist
|
|
||||||
|
|
||||||
# -e doesn't propagate out of eval, so check success by hand.
|
|
||||||
eval $(./cmd/dist/dist env -p || echo FAIL=true)
|
|
||||||
Index: go/src/make.rc
|
|
||||||
===================================================================
|
|
||||||
--- go.orig/src/make.rc
|
|
||||||
+++ go/src/make.rc
|
|
||||||
@@ -52,7 +52,7 @@ GOROOT = `{cd .. && pwd}
|
|
||||||
if(! ~ $#GOROOT_BOOTSTRAP 1)
|
|
||||||
GOROOT_BOOTSTRAP = $home/go1.4
|
|
||||||
for(p in $path){
|
|
||||||
- if(! test -x $GOROOT_BOOTSTRAP/bin/go){
|
|
||||||
+ if(! test -x $GOROOT_BOOTSTRAP/bin/go-7){
|
|
||||||
if(go_exe = `{path=$p whatis go}){
|
|
||||||
goroot = `{GOROOT='' $go_exe env GOROOT}
|
|
||||||
if(! ~ $goroot $GOROOT){
|
|
||||||
@@ -61,7 +61,7 @@ for(p in $path){
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-if(! test -x $GOROOT_BOOTSTRAP/bin/go){
|
|
||||||
+if(! test -x $GOROOT_BOOTSTRAP/bin/go-7){
|
|
||||||
echo 'ERROR: Cannot find '$GOROOT_BOOTSTRAP'/bin/go.' >[1=2]
|
|
||||||
echo 'Set $GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4.' >[1=2]
|
|
||||||
exit bootstrap
|
|
||||||
@@ -75,7 +75,7 @@ if(~ $GOROOT_BOOTSTRAP $GOROOT){
|
|
||||||
echo 'Building Go cmd/dist using '^$GOROOT_BOOTSTRAP
|
|
||||||
if(~ $#vflag 1)
|
|
||||||
echo cmd/dist
|
|
||||||
-GOROOT=$GOROOT_BOOTSTRAP GOOS='' GOARCH='' GO111MODULE=off $GOROOT_BOOTSTRAP/bin/go build -o cmd/dist/dist ./cmd/dist
|
|
||||||
+GOROOT=$GOROOT_BOOTSTRAP GOOS='' GOARCH='' $GOROOT_BOOTSTRAP/bin/go-7 build -o cmd/dist/dist ./cmd/dist
|
|
||||||
|
|
||||||
eval `{./cmd/dist/dist env -9}
|
|
||||||
if(~ $#vflag 1)
|
|
@ -1,3 +1,23 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Apr 7 23:57:47 UTC 2022 - Jeff Kowalczyk <jkowalczyk@suse.com>
|
||||||
|
|
||||||
|
- Template gcc-go.patch to substitute gcc_go_version and eliminate
|
||||||
|
multiple similar patches each with hardcoded gcc go binary name.
|
||||||
|
gcc-go.patch inserts gcc-go binary name e.g. go-8 to compensate
|
||||||
|
for current lack of gcc-go update-alternatives usage.
|
||||||
|
* add gcc-go.patch
|
||||||
|
* drop gcc6-go.patch
|
||||||
|
* drop gcc7-go.patch
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Apr 7 17:51:56 UTC 2022 - Jeff Kowalczyk <jkowalczyk@suse.com>
|
||||||
|
|
||||||
|
- For SLE-12 set gcc_go_version to 8 to bootstrap using gcc8-go.
|
||||||
|
gcc6-go and gcc7-go no longer successfully bootstrap go1.17 or
|
||||||
|
go1.18 on SLE-12 aarch64 ppc64le or s390x.
|
||||||
|
* gcc6-go fails with errors e.g. libnoder.a(_go_.o):(.toc+0x0):
|
||||||
|
undefined reference to `__go_pimt__I4_DiagFrN4_boolee3
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Mar 19 21:05:53 UTC 2022 - Jeff Kowalczyk <jkowalczyk@suse.com>
|
Tue Mar 19 21:05:53 UTC 2022 - Jeff Kowalczyk <jkowalczyk@suse.com>
|
||||||
|
|
||||||
@ -282,7 +302,7 @@ Tue Mar 15 17:42:07 UTC 2022 - Jeff Kowalczyk <jkowalczyk@suse.com>
|
|||||||
Wed Mar 9 17:03:28 UTC 2022 - Dirk Müller <dmueller@suse.com>
|
Wed Mar 9 17:03:28 UTC 2022 - Dirk Müller <dmueller@suse.com>
|
||||||
|
|
||||||
- add dont-force-gold-on-arm64.patch (bsc#1183043)
|
- add dont-force-gold-on-arm64.patch (bsc#1183043)
|
||||||
- drop binutils-gold dependency
|
- drop binutils-gold dependency
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Fri Feb 18 02:10:17 UTC 2022 - Jeff Kowalczyk <jkowalczyk@suse.com>
|
Fri Feb 18 02:10:17 UTC 2022 - Jeff Kowalczyk <jkowalczyk@suse.com>
|
||||||
|
17
go1.18.spec
17
go1.18.spec
@ -25,7 +25,7 @@
|
|||||||
%define __arch_install_post export NO_BRP_STRIP_DEBUG=true NO_BRP_AR=true
|
%define __arch_install_post export NO_BRP_STRIP_DEBUG=true NO_BRP_AR=true
|
||||||
|
|
||||||
%if 0%{?suse_version} == 1315
|
%if 0%{?suse_version} == 1315
|
||||||
%define gcc_go_version 6
|
%define gcc_go_version 8
|
||||||
%define go_bootstrap_version go1.4
|
%define go_bootstrap_version go1.4
|
||||||
%else
|
%else
|
||||||
%ifarch riscv64
|
%ifarch riscv64
|
||||||
@ -159,9 +159,8 @@ Source6: go.gdbinit
|
|||||||
Source100: llvm-%{tsan_commit}.tar.xz
|
Source100: llvm-%{tsan_commit}.tar.xz
|
||||||
# PATCH-FIX-OPENSUSE: https://go-review.googlesource.com/c/go/+/391115
|
# PATCH-FIX-OPENSUSE: https://go-review.googlesource.com/c/go/+/391115
|
||||||
Patch7: dont-force-gold-on-arm64.patch
|
Patch7: dont-force-gold-on-arm64.patch
|
||||||
# PATCH-FIX-UPSTREAM marguerite@opensuse.org - find /usr/bin/go-5 when bootstrapping with gcc5-go
|
# PATCH-FIX-UPSTREAM marguerite@opensuse.org - find /usr/bin/go-8 when bootstrapping with gcc8-go
|
||||||
Patch8: gcc6-go.patch
|
Patch8: gcc-go.patch
|
||||||
Patch9: gcc7-go.patch
|
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
# boostrap
|
# boostrap
|
||||||
%if %{with gccgo}
|
%if %{with gccgo}
|
||||||
@ -234,13 +233,13 @@ Go runtime race detector libraries. Install this package if you wish to use the
|
|||||||
%setup -q -n go
|
%setup -q -n go
|
||||||
%patch7 -p1
|
%patch7 -p1
|
||||||
%if %{with gccgo}
|
%if %{with gccgo}
|
||||||
%if 0%{?gcc_go_version} == 6
|
# Currently gcc-go does not manage an update-alternatives entry and will
|
||||||
|
# never be symlinked as "go", even if gcc-go is the only installed go toolchain.
|
||||||
|
# Patch go bootstrap scripts to find hardcoded go-(gcc-go-version) e.g. go-8
|
||||||
|
# Substitute defined gcc_go_version into gcc-go.patch
|
||||||
|
sed -i "s/\$gcc_go_version/%{gcc_go_version}/" $RPM_SOURCE_DIR/gcc-go.patch
|
||||||
%patch8 -p1
|
%patch8 -p1
|
||||||
%endif
|
%endif
|
||||||
%if 0%{?gcc_go_version} == 7
|
|
||||||
%patch9 -p1
|
|
||||||
%endif
|
|
||||||
%endif
|
|
||||||
|
|
||||||
cp %{SOURCE4} .
|
cp %{SOURCE4} .
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user