commit d66020a
hovercats
·
2025-05-28 13:18:29 +0000 UTC
parent 9a20473
go-bootstrap: fix build with gcc 15
4 files changed,
+18,
-20
+1,
-0
1@@ -7,6 +7,7 @@
2 patch -p1 < 0001-use-POSIX-sh-and-remove-bashisms.patch
3
4 export CC="${CC:-cc}"
5+export CFLAGS="$CFLAGS -std=c17"
6 export GOARCH=amd64
7 export GO_LDFLAGS="-w -s"
8
+2,
-1
1@@ -1,4 +1,5 @@
2+66f84c3d1cc58997d51cd868203d92f0952063f48b8cabf9bf72da1345530a52b6
3 fb555f6674734d4f36e88594f29aede488ff75a36f659b4eee08217183905f1a12
4 fab34f540e4ad83908f3c897053cb0d5529452f81fce530cec916aa7b9c6948b69
5 e38b036986f4969980664342af2e0b14c503bf4222b980f2bfdcb32fd62fde146d
6-d6a30ce78da0edd9c876236cb0f3b9a1d16003d81a307899d625c3d254130390ae
7+8d0ad35b60b098294705bf964aab84d469f34b6de5d2eaed04ff037fb25a2c0125
1@@ -1,16 +1,16 @@
2-From 0677e181c2e88f21c588933246beca6ac61e0db9 Mon Sep 17 00:00:00 2001
3+From f5046858f3da701dad0647207d957e1301c0d7f8 Mon Sep 17 00:00:00 2001
4 From: hovercats <hovercatswithlasereyes@protonmail.com>
5-Date: Thu, 2 May 2024 18:37:05 +0200
6-Subject: [PATCH] use POSIX sh and remove bashisms
7+Date: Sun, 25 May 2025 06:52:08 +0200
8+Subject: [PATCH] use POSIX sh and remove some bashism
9
10 ---
11 go1.17.13/src/make.bash | 4 ++--
12 go1.20.6/src/make.bash | 4 ++--
13 go1.4-bootstrap/src/make.bash | 10 +++++-----
14- 3 files changed, 9 insertions(+), 9 deletions(-)
15+ 4 files changed, 26 insertions(+), 26 deletions(-)
16
17 diff --git a/go1.17.13/src/make.bash b/go1.17.13/src/make.bash
18-index 7986125a..9a770665 100755
19+index 7986125a..d1a77270 100755
20 --- a/go1.17.13/src/make.bash
21 +++ b/go1.17.13/src/make.bash
22 @@ -1,4 +1,4 @@
23@@ -29,7 +29,7 @@ index 7986125a..9a770665 100755
24 goroot=$(GOROOT='' GOOS='' GOARCH='' "$go_exe" env GOROOT)
25 if [ "$goroot" != "$GOROOT" ]; then
26 diff --git a/go1.20.6/src/make.bash b/go1.20.6/src/make.bash
27-index c07f39bb..cc5c620d 100755
28+index c07f39bb..7aefc113 100755
29 --- a/go1.20.6/src/make.bash
30 +++ b/go1.20.6/src/make.bash
31 @@ -1,4 +1,4 @@
32@@ -48,7 +48,7 @@ index c07f39bb..cc5c620d 100755
33 goroot=$(GOROOT='' GOOS='' GOARCH='' "$go_exe" env GOROOT)
34 if [ "$goroot" != "$GOROOT" ]; then
35 diff --git a/go1.4-bootstrap/src/make.bash b/go1.4-bootstrap/src/make.bash
36-index 104c3ba5..043d38ac 100755
37+index 104c3ba5..f05a635c 100755
38 --- a/go1.4-bootstrap/src/make.bash
39 +++ b/go1.4-bootstrap/src/make.bash
40 @@ -1,4 +1,4 @@
41@@ -57,15 +57,6 @@ index 104c3ba5..043d38ac 100755
42 # Copyright 2009 The Go Authors. All rights reserved.
43 # Use of this source code is governed by a BSD-style
44 # license that can be found in the LICENSE file.
45-@@ -43,7 +43,7 @@
46- # This is used by cgo. Default is CC.
47- #
48- # CXX_FOR_TARGET: Command line to run to compile C++ code for GOARCH.
49--# This is used by cgo. Default is CXX, or, if that is not set,
50-+# This is used by cgo. Default is CXX, or, if that is not set,
51- # "g++" or "clang++".
52- #
53- # GO_DISTFLAGS: extra flags to provide to "dist bootstrap". Use "-s"
54 @@ -102,7 +102,7 @@ done
55 # Test for debian/kFreeBSD.
56 # cmd/dist will detect kFreeBSD as freebsd/$GOARCH, but we need to
57@@ -75,7 +66,7 @@ index 104c3ba5..043d38ac 100755
58 export CGO_ENABLED=0
59 fi
60
61-@@ -122,12 +122,12 @@ case "$GOHOSTARCH" in
62+@@ -122,15 +122,15 @@ case "$GOHOSTARCH" in
63 386) mflag=-m32;;
64 amd64) mflag=-m64;;
65 esac
66@@ -89,7 +80,11 @@ index 104c3ba5..043d38ac 100755
67 +if [ -z "$CC" -a -z "$(command -v gcc)" -a -n "$(command -v clang)" ]; then
68 export CC=clang CXX=clang++
69 fi
70- ${CC:-gcc} $mflag -O2 -Wall -Werror -o cmd/dist/dist -Icmd/dist "$DEFGOROOT" cmd/dist/*.c
71+-${CC:-gcc} $mflag -O2 -Wall -Werror -o cmd/dist/dist -Icmd/dist "$DEFGOROOT" cmd/dist/*.c
72++${CC:-gcc} $mflag -std=gnu17 -O2 -Wall -Werror -o cmd/dist/dist -Icmd/dist "$DEFGOROOT" cmd/dist/*.c
73+
74+ # -e doesn't propagate out of eval, so check success by hand.
75+ eval $(./cmd/dist/dist env -p || echo FAIL=true)
76 --
77-2.44.0
78+2.49.0
79
+1,
-0
1@@ -1,3 +1,4 @@
2+https://golang.org/dl/go1.22.6.src.tar.gz go1.22.6
3 https://golang.org/dl/go1.20.6.src.tar.gz go1.20.6
4 https://golang.org/dl/go1.17.13.src.tar.gz go1.17.13
5 https://dl.google.com/go/go1.4-bootstrap-20171003.tar.gz go1.4-bootstrap