diff options
Diffstat (limited to 'meta/recipes-devtools/go/go-1.17/0009-Revert-cmd-go-make-sure-CC-and-CXX-are-absolute.patch')
| -rw-r--r-- | meta/recipes-devtools/go/go-1.17/0009-Revert-cmd-go-make-sure-CC-and-CXX-are-absolute.patch | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/meta/recipes-devtools/go/go-1.17/0009-Revert-cmd-go-make-sure-CC-and-CXX-are-absolute.patch b/meta/recipes-devtools/go/go-1.17/0009-Revert-cmd-go-make-sure-CC-and-CXX-are-absolute.patch new file mode 100644 index 0000000000..f857b72234 --- /dev/null +++ b/meta/recipes-devtools/go/go-1.17/0009-Revert-cmd-go-make-sure-CC-and-CXX-are-absolute.patch | |||
| @@ -0,0 +1,94 @@ | |||
| 1 | From 66a45dae3af140662e17ef85c2e6fe40270a2553 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Mon, 22 Feb 2021 17:54:01 -0800 | ||
| 4 | Subject: [PATCH] Revert "cmd/go: make sure CC and CXX are absolute" | ||
| 5 | |||
| 6 | OE uses CC/CXX values which consists of cmpiler and options together, | ||
| 7 | secondly, the environment is canned so this check add little value to OE | ||
| 8 | based builds | ||
| 9 | |||
| 10 | Fixes go-runtime build issues | ||
| 11 | |||
| 12 | go install: CXX environment variable is relative; must be absolute path: powerpc64le-yoe-linux-musl-g++ -mlittle-endian -mhard-float -m64 -mabi=elfv2 -mcpu=power9 -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/mnt/b/yoe/master/build/tmp/work/ppc64p9le-yoe-linux-musl/go/1.16-r0/recipe-sysroot | ||
| 13 | |||
| 14 | This reverts commit aa161e799df7e1eba99d2be10271e76b6f758142. | ||
| 15 | |||
| 16 | Upstream-Status: Inappropriate [OE-Specific] | ||
| 17 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 18 | --- | ||
| 19 | src/cmd/go/internal/envcmd/env.go | 5 ----- | ||
| 20 | src/cmd/go/internal/work/init.go | 6 ------ | ||
| 21 | src/cmd/go/testdata/script/env_write.txt | 24 ------------------------ | ||
| 22 | 3 files changed, 35 deletions(-) | ||
| 23 | |||
| 24 | diff --git a/src/cmd/go/internal/envcmd/env.go b/src/cmd/go/internal/envcmd/env.go | ||
| 25 | index ff6f0d8..43b94e7 100644 | ||
| 26 | --- a/src/cmd/go/internal/envcmd/env.go | ||
| 27 | +++ b/src/cmd/go/internal/envcmd/env.go | ||
| 28 | @@ -457,11 +457,6 @@ func checkEnvWrite(key, val string) error { | ||
| 29 | if !filepath.IsAbs(val) && val != "" { | ||
| 30 | return fmt.Errorf("GOPATH entry is relative; must be absolute path: %q", val) | ||
| 31 | } | ||
| 32 | - // Make sure CC and CXX are absolute paths | ||
| 33 | - case "CC", "CXX", "GOMODCACHE": | ||
| 34 | - if !filepath.IsAbs(val) && val != "" && val != filepath.Base(val) { | ||
| 35 | - return fmt.Errorf("%s entry is relative; must be absolute path: %q", key, val) | ||
| 36 | - } | ||
| 37 | } | ||
| 38 | |||
| 39 | if !utf8.ValidString(val) { | ||
| 40 | diff --git a/src/cmd/go/internal/work/init.go b/src/cmd/go/internal/work/init.go | ||
| 41 | index 37a3e2d..316b0cf 100644 | ||
| 42 | --- a/src/cmd/go/internal/work/init.go | ||
| 43 | +++ b/src/cmd/go/internal/work/init.go | ||
| 44 | @@ -39,12 +39,6 @@ func BuildInit() { | ||
| 45 | cfg.BuildPkgdir = p | ||
| 46 | } | ||
| 47 | |||
| 48 | - // Make sure CC and CXX are absolute paths | ||
| 49 | - for _, key := range []string{"CC", "CXX"} { | ||
| 50 | - if path := cfg.Getenv(key); !filepath.IsAbs(path) && path != "" && path != filepath.Base(path) { | ||
| 51 | - base.Fatalf("go %s: %s environment variable is relative; must be absolute path: %s\n", flag.Args()[0], key, path) | ||
| 52 | - } | ||
| 53 | - } | ||
| 54 | } | ||
| 55 | |||
| 56 | func instrumentInit() { | ||
| 57 | diff --git a/src/cmd/go/testdata/script/env_write.txt b/src/cmd/go/testdata/script/env_write.txt | ||
| 58 | index b5e9739..566c876 100644 | ||
| 59 | --- a/src/cmd/go/testdata/script/env_write.txt | ||
| 60 | +++ b/src/cmd/go/testdata/script/env_write.txt | ||
| 61 | @@ -129,30 +129,6 @@ go env -w GOTMPDIR= | ||
| 62 | go env GOTMPDIR | ||
| 63 | stdout ^$ | ||
| 64 | |||
| 65 | -# go env -w rejects relative CC values | ||
| 66 | -[!windows] go env -w CC=/usr/bin/clang | ||
| 67 | -go env -w CC=clang | ||
| 68 | -[!windows] ! go env -w CC=./clang | ||
| 69 | -[!windows] ! go env -w CC=bin/clang | ||
| 70 | -[!windows] stderr 'go env -w: CC entry is relative; must be absolute path' | ||
| 71 | - | ||
| 72 | -[windows] go env -w CC=$WORK\bin\clang | ||
| 73 | -[windows] ! go env -w CC=.\clang | ||
| 74 | -[windows] ! go env -w CC=bin\clang | ||
| 75 | -[windows] stderr 'go env -w: CC entry is relative; must be absolute path' | ||
| 76 | - | ||
| 77 | -# go env -w rejects relative CXX values | ||
| 78 | -[!windows] go env -w CC=/usr/bin/cpp | ||
| 79 | -go env -w CXX=cpp | ||
| 80 | -[!windows] ! go env -w CXX=./cpp | ||
| 81 | -[!windows] ! go env -w CXX=bin/cpp | ||
| 82 | -[!windows] stderr 'go env -w: CXX entry is relative; must be absolute path' | ||
| 83 | - | ||
| 84 | -[windows] go env -w CXX=$WORK\bin\cpp | ||
| 85 | -[windows] ! go env -w CXX=.\cpp | ||
| 86 | -[windows] ! go env -w CXX=bin\cpp | ||
| 87 | -[windows] stderr 'go env -w: CXX entry is relative; must be absolute path' | ||
| 88 | - | ||
| 89 | # go env -w/-u checks validity of GOOS/ARCH combinations | ||
| 90 | env GOOS= | ||
| 91 | env GOARCH= | ||
| 92 | -- | ||
| 93 | 2.20.1 | ||
| 94 | |||
