Re: [OE-core] [PATCH v4 1/4] go: Refactor patches for 1.13.3
This looks good to me now. On Fri, Oct 25, 2019 at 6:58 AM Alexander Kube wrote: > > From: Alex Kube > > Signed-off-by: Alex Kube > --- > ...ow-CC-and-CXX-to-have-multiple-words.patch | 38 +++ > ...ent-based-hash-generation-less-pedan.patch | 226 ++ > ...-to-be-overridden-in-the-environment.patch | 54 > ...4-ld-add-soname-to-shareable-objects.patch | 50 > ...de-CC-when-building-dist-and-go_boot.patch | 44 +++ > ...dist-separate-host-and-target-builds.patch | 279 ++ > ...d-go-make-GOROOT-precious-by-default.patch | 113 +++ > ...008-use-GOBUILDMODE-to-set-buildmode.patch | 47 +++ > ...place-glibc-dynamic-linker-with-musl.patch | 134 + > 9 files changed, 985 insertions(+) > create mode 100644 > meta/recipes-devtools/go/go-1.13/0001-allow-CC-and-CXX-to-have-multiple-words.patch > create mode 100644 > meta/recipes-devtools/go/go-1.13/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch > create mode 100644 > meta/recipes-devtools/go/go-1.13/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch > create mode 100644 > meta/recipes-devtools/go/go-1.13/0004-ld-add-soname-to-shareable-objects.patch > create mode 100644 > meta/recipes-devtools/go/go-1.13/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch > create mode 100644 > meta/recipes-devtools/go/go-1.13/0006-cmd-dist-separate-host-and-target-builds.patch > create mode 100644 > meta/recipes-devtools/go/go-1.13/0007-cmd-go-make-GOROOT-precious-by-default.patch > create mode 100644 > meta/recipes-devtools/go/go-1.13/0008-use-GOBUILDMODE-to-set-buildmode.patch > create mode 100644 > meta/recipes-devtools/go/go-1.13/0009-ld-replace-glibc-dynamic-linker-with-musl.patch > > diff --git > a/meta/recipes-devtools/go/go-1.13/0001-allow-CC-and-CXX-to-have-multiple-words.patch > > b/meta/recipes-devtools/go/go-1.13/0001-allow-CC-and-CXX-to-have-multiple-words.patch > new file mode 100644 > index 00..ddfd5e41d1 > --- /dev/null > +++ > b/meta/recipes-devtools/go/go-1.13/0001-allow-CC-and-CXX-to-have-multiple-words.patch > @@ -0,0 +1,38 @@ > +From 9e3dc44cdfa58d96504d0a789dc82617dd5bef55 Mon Sep 17 00:00:00 2001 > +From: Alex Kube > +Date: Wed, 23 Oct 2019 21:01:13 +0430 > +Subject: [PATCH 1/9] cmd/go: Allow CC and CXX to have multiple words > + > +Upstream-Status: Inappropriate [OE specific] > + > +Adapted to Go 1.13 from patches originally submitted to > +the meta/recipes-devtools/go tree by > +Matt Madison . > + > +Signed-off-by: Alexander J Kube > + > +--- > + src/cmd/go/internal/envcmd/env.go | 4 ++-- > + 1 file changed, 2 insertions(+), 2 deletions(-) > + > +diff --git a/src/cmd/go/internal/envcmd/env.go > b/src/cmd/go/internal/envcmd/env.go > +index 17852de..7b5ec5e 100644 > +--- a/src/cmd/go/internal/envcmd/env.go > b/src/cmd/go/internal/envcmd/env.go > +@@ -100,11 +100,11 @@ func MkEnv() []cfg.EnvVar { > + > + cc := cfg.DefaultCC(cfg.Goos, cfg.Goarch) > + if env := strings.Fields(cfg.Getenv("CC")); len(env) > 0 { > +- cc = env[0] > ++ cc = strings.Join(env, " ") > + } > + cxx := cfg.DefaultCXX(cfg.Goos, cfg.Goarch) > + if env := strings.Fields(cfg.Getenv("CXX")); len(env) > 0 { > +- cxx = env[0] > ++ cxx = strings.Join(env, " ") > + } > + env = append(env, cfg.EnvVar{Name: "AR", Value: envOr("AR", "ar")}) > + env = append(env, cfg.EnvVar{Name: "CC", Value: cc}) > +-- > +2.17.1 (Apple Git-112) > + > diff --git > a/meta/recipes-devtools/go/go-1.13/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch > > b/meta/recipes-devtools/go/go-1.13/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch > new file mode 100644 > index 00..4eddd39809 > --- /dev/null > +++ > b/meta/recipes-devtools/go/go-1.13/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch > @@ -0,0 +1,226 @@ > +From a13ae484e41139094505d2834437e9262a5315f7 Mon Sep 17 00:00:00 2001 > +From: Alex Kube > +Date: Wed, 23 Oct 2019 21:14:22 +0430 > +Subject: [PATCH 2/9] cmd/go: make content-based hash generation less pedantic > + > +Upstream-Status: Inappropriate [OE specific] > + > +Go 1.10's build tool now uses content-based hashes to > +determine when something should be built or re-built. > +This same mechanism is used to maintain a built-artifact > +cache for speeding up builds. > + > +However, the hashes it generates include information that > +doesn't work well with OE, nor with using a shared runtime > +library. > + > +First, it embeds path names to source files, unless > +building within GOROOT. This prevents the building > +of a package in GOPATH for later staging into GOROOT. > + > +This patch adds support for the environment variable > +GOPATH_OMIT_IN_ACTIONID. If present, path name > +embedding is disabled. > + > +Second, if cgo is enabled, the build ID for cgo-related > +packages will include the current value of the
[OE-core] [PATCH v4 1/4] go: Refactor patches for 1.13.3
From: Alex Kube Signed-off-by: Alex Kube --- ...ow-CC-and-CXX-to-have-multiple-words.patch | 38 +++ ...ent-based-hash-generation-less-pedan.patch | 226 ++ ...-to-be-overridden-in-the-environment.patch | 54 ...4-ld-add-soname-to-shareable-objects.patch | 50 ...de-CC-when-building-dist-and-go_boot.patch | 44 +++ ...dist-separate-host-and-target-builds.patch | 279 ++ ...d-go-make-GOROOT-precious-by-default.patch | 113 +++ ...008-use-GOBUILDMODE-to-set-buildmode.patch | 47 +++ ...place-glibc-dynamic-linker-with-musl.patch | 134 + 9 files changed, 985 insertions(+) create mode 100644 meta/recipes-devtools/go/go-1.13/0001-allow-CC-and-CXX-to-have-multiple-words.patch create mode 100644 meta/recipes-devtools/go/go-1.13/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch create mode 100644 meta/recipes-devtools/go/go-1.13/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch create mode 100644 meta/recipes-devtools/go/go-1.13/0004-ld-add-soname-to-shareable-objects.patch create mode 100644 meta/recipes-devtools/go/go-1.13/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch create mode 100644 meta/recipes-devtools/go/go-1.13/0006-cmd-dist-separate-host-and-target-builds.patch create mode 100644 meta/recipes-devtools/go/go-1.13/0007-cmd-go-make-GOROOT-precious-by-default.patch create mode 100644 meta/recipes-devtools/go/go-1.13/0008-use-GOBUILDMODE-to-set-buildmode.patch create mode 100644 meta/recipes-devtools/go/go-1.13/0009-ld-replace-glibc-dynamic-linker-with-musl.patch diff --git a/meta/recipes-devtools/go/go-1.13/0001-allow-CC-and-CXX-to-have-multiple-words.patch b/meta/recipes-devtools/go/go-1.13/0001-allow-CC-and-CXX-to-have-multiple-words.patch new file mode 100644 index 00..ddfd5e41d1 --- /dev/null +++ b/meta/recipes-devtools/go/go-1.13/0001-allow-CC-and-CXX-to-have-multiple-words.patch @@ -0,0 +1,38 @@ +From 9e3dc44cdfa58d96504d0a789dc82617dd5bef55 Mon Sep 17 00:00:00 2001 +From: Alex Kube +Date: Wed, 23 Oct 2019 21:01:13 +0430 +Subject: [PATCH 1/9] cmd/go: Allow CC and CXX to have multiple words + +Upstream-Status: Inappropriate [OE specific] + +Adapted to Go 1.13 from patches originally submitted to +the meta/recipes-devtools/go tree by +Matt Madison . + +Signed-off-by: Alexander J Kube + +--- + src/cmd/go/internal/envcmd/env.go | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/cmd/go/internal/envcmd/env.go b/src/cmd/go/internal/envcmd/env.go +index 17852de..7b5ec5e 100644 +--- a/src/cmd/go/internal/envcmd/env.go b/src/cmd/go/internal/envcmd/env.go +@@ -100,11 +100,11 @@ func MkEnv() []cfg.EnvVar { + + cc := cfg.DefaultCC(cfg.Goos, cfg.Goarch) + if env := strings.Fields(cfg.Getenv("CC")); len(env) > 0 { +- cc = env[0] ++ cc = strings.Join(env, " ") + } + cxx := cfg.DefaultCXX(cfg.Goos, cfg.Goarch) + if env := strings.Fields(cfg.Getenv("CXX")); len(env) > 0 { +- cxx = env[0] ++ cxx = strings.Join(env, " ") + } + env = append(env, cfg.EnvVar{Name: "AR", Value: envOr("AR", "ar")}) + env = append(env, cfg.EnvVar{Name: "CC", Value: cc}) +-- +2.17.1 (Apple Git-112) + diff --git a/meta/recipes-devtools/go/go-1.13/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch b/meta/recipes-devtools/go/go-1.13/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch new file mode 100644 index 00..4eddd39809 --- /dev/null +++ b/meta/recipes-devtools/go/go-1.13/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch @@ -0,0 +1,226 @@ +From a13ae484e41139094505d2834437e9262a5315f7 Mon Sep 17 00:00:00 2001 +From: Alex Kube +Date: Wed, 23 Oct 2019 21:14:22 +0430 +Subject: [PATCH 2/9] cmd/go: make content-based hash generation less pedantic + +Upstream-Status: Inappropriate [OE specific] + +Go 1.10's build tool now uses content-based hashes to +determine when something should be built or re-built. +This same mechanism is used to maintain a built-artifact +cache for speeding up builds. + +However, the hashes it generates include information that +doesn't work well with OE, nor with using a shared runtime +library. + +First, it embeds path names to source files, unless +building within GOROOT. This prevents the building +of a package in GOPATH for later staging into GOROOT. + +This patch adds support for the environment variable +GOPATH_OMIT_IN_ACTIONID. If present, path name +embedding is disabled. + +Second, if cgo is enabled, the build ID for cgo-related +packages will include the current value of the environment +variables for invoking the compiler (CC, CXX, FC) and +any CGO_xxFLAGS variables. Only if the settings used +during a compilation exactly match, character for character, +the values used for compiling runtime/cgo or any other +cgo-enabled package being imported, will the tool +decide that the imported
[OE-core] [PATCH v4 1/4] go: Refactor patches for 1.13.3
From: Alex Kube Signed-off-by: Alex Kube --- ...ow-CC-and-CXX-to-have-multiple-words.patch | 38 +++ ...ent-based-hash-generation-less-pedan.patch | 226 ++ ...-to-be-overridden-in-the-environment.patch | 54 ...4-ld-add-soname-to-shareable-objects.patch | 50 ...de-CC-when-building-dist-and-go_boot.patch | 44 +++ ...dist-separate-host-and-target-builds.patch | 279 ++ ...d-go-make-GOROOT-precious-by-default.patch | 113 +++ ...008-use-GOBUILDMODE-to-set-buildmode.patch | 47 +++ ...place-glibc-dynamic-linker-with-musl.patch | 134 + 9 files changed, 985 insertions(+) create mode 100644 meta/recipes-devtools/go/go-1.13/0001-allow-CC-and-CXX-to-have-multiple-words.patch create mode 100644 meta/recipes-devtools/go/go-1.13/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch create mode 100644 meta/recipes-devtools/go/go-1.13/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch create mode 100644 meta/recipes-devtools/go/go-1.13/0004-ld-add-soname-to-shareable-objects.patch create mode 100644 meta/recipes-devtools/go/go-1.13/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch create mode 100644 meta/recipes-devtools/go/go-1.13/0006-cmd-dist-separate-host-and-target-builds.patch create mode 100644 meta/recipes-devtools/go/go-1.13/0007-cmd-go-make-GOROOT-precious-by-default.patch create mode 100644 meta/recipes-devtools/go/go-1.13/0008-use-GOBUILDMODE-to-set-buildmode.patch create mode 100644 meta/recipes-devtools/go/go-1.13/0009-ld-replace-glibc-dynamic-linker-with-musl.patch diff --git a/meta/recipes-devtools/go/go-1.13/0001-allow-CC-and-CXX-to-have-multiple-words.patch b/meta/recipes-devtools/go/go-1.13/0001-allow-CC-and-CXX-to-have-multiple-words.patch new file mode 100644 index 00..ddfd5e41d1 --- /dev/null +++ b/meta/recipes-devtools/go/go-1.13/0001-allow-CC-and-CXX-to-have-multiple-words.patch @@ -0,0 +1,38 @@ +From 9e3dc44cdfa58d96504d0a789dc82617dd5bef55 Mon Sep 17 00:00:00 2001 +From: Alex Kube +Date: Wed, 23 Oct 2019 21:01:13 +0430 +Subject: [PATCH 1/9] cmd/go: Allow CC and CXX to have multiple words + +Upstream-Status: Inappropriate [OE specific] + +Adapted to Go 1.13 from patches originally submitted to +the meta/recipes-devtools/go tree by +Matt Madison . + +Signed-off-by: Alexander J Kube + +--- + src/cmd/go/internal/envcmd/env.go | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/cmd/go/internal/envcmd/env.go b/src/cmd/go/internal/envcmd/env.go +index 17852de..7b5ec5e 100644 +--- a/src/cmd/go/internal/envcmd/env.go b/src/cmd/go/internal/envcmd/env.go +@@ -100,11 +100,11 @@ func MkEnv() []cfg.EnvVar { + + cc := cfg.DefaultCC(cfg.Goos, cfg.Goarch) + if env := strings.Fields(cfg.Getenv("CC")); len(env) > 0 { +- cc = env[0] ++ cc = strings.Join(env, " ") + } + cxx := cfg.DefaultCXX(cfg.Goos, cfg.Goarch) + if env := strings.Fields(cfg.Getenv("CXX")); len(env) > 0 { +- cxx = env[0] ++ cxx = strings.Join(env, " ") + } + env = append(env, cfg.EnvVar{Name: "AR", Value: envOr("AR", "ar")}) + env = append(env, cfg.EnvVar{Name: "CC", Value: cc}) +-- +2.17.1 (Apple Git-112) + diff --git a/meta/recipes-devtools/go/go-1.13/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch b/meta/recipes-devtools/go/go-1.13/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch new file mode 100644 index 00..4eddd39809 --- /dev/null +++ b/meta/recipes-devtools/go/go-1.13/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch @@ -0,0 +1,226 @@ +From a13ae484e41139094505d2834437e9262a5315f7 Mon Sep 17 00:00:00 2001 +From: Alex Kube +Date: Wed, 23 Oct 2019 21:14:22 +0430 +Subject: [PATCH 2/9] cmd/go: make content-based hash generation less pedantic + +Upstream-Status: Inappropriate [OE specific] + +Go 1.10's build tool now uses content-based hashes to +determine when something should be built or re-built. +This same mechanism is used to maintain a built-artifact +cache for speeding up builds. + +However, the hashes it generates include information that +doesn't work well with OE, nor with using a shared runtime +library. + +First, it embeds path names to source files, unless +building within GOROOT. This prevents the building +of a package in GOPATH for later staging into GOROOT. + +This patch adds support for the environment variable +GOPATH_OMIT_IN_ACTIONID. If present, path name +embedding is disabled. + +Second, if cgo is enabled, the build ID for cgo-related +packages will include the current value of the environment +variables for invoking the compiler (CC, CXX, FC) and +any CGO_xxFLAGS variables. Only if the settings used +during a compilation exactly match, character for character, +the values used for compiling runtime/cgo or any other +cgo-enabled package being imported, will the tool +decide that the imported