From patchwork Thu Mar 7 21:42:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 159934 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp7939827jad; Thu, 7 Mar 2019 13:42:55 -0800 (PST) X-Google-Smtp-Source: APXvYqySzAAd8PQTeJO+P2nCdhYRdRThk7xYQ3Y4IM1Yc+ILkSZetge0pfjn4g7sEZ75icqaACI1 X-Received: by 2002:a63:2bcd:: with SMTP id r196mr13133856pgr.355.1551994975133; Thu, 07 Mar 2019 13:42:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551994975; cv=none; d=google.com; s=arc-20160816; b=wvYKnzcexcReUkMbqe2+pAxuESSLNoOdGTZwd/NZe0ac90jGgniEkiuuHXID4mGbnd vjtFuFRy6NKF90BAk8CjTGd2hG0um69rPcx+PNzjJoq+CvT8F2y2WCS/oqrbS6k2YLPc 0YSTXNXhR44cijoFlqTom6FGHRZmneCyk3s7pFalr0KmGgx8ncOXacAbVMJYaki1Z+ba aNMhs3b+wUoURjN56rJAQWY/Mas2dBMkPVo6OBAyWxEP1fr3vskkl+5TpnjYHsK5mP1J OFOFiRVsSEMYwKChrRv5ZOS4L0iDNkbXpb/TR0duXQAlL1bY6i9wsLWphRvSidN3c1Hs PdGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:date:to:from:dkim-signature:delivered-to; bh=qcnVFJCXcEJO5kCtTsBou8+S9MAYk971cehYgTiLFRw=; b=Dnq6Bu0N7MJvDpjwNLCMbFg8bUvhBqDRfT/N3x/O+rwf4rWwuWInS7SF1IaN0Z7vik el6so6x6lf+dOfIko6lhJ+wSBY6qvbcMMZLv4trlztv6JDrZi+cXxW9pzQ0STyZ/Jhdb 69Fmja4RtKvb6fLtPb5SuxF+stnij4mbGRwnGRxVGxpxjP03mpCdYi2KA50Yc8wPRNsA nOerPBtuXWlbUB9/apGYl/8RJsSUeh8I7/cRjzNpKg69PBakN+mkTBCYeA3mnndIjd9G fAaBeG8xQygjEBbECWJkRgDLH1BJGrqroBztWm/8wpuzgDLaASirTolOXbK840NGfDPe XG4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=As3GRD0b; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id ck9si5582433plb.196.2019.03.07.13.42.54; Thu, 07 Mar 2019 13:42:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=As3GRD0b; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from ec2-34-214-78-129.us-west-2.compute.amazonaws.com (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 20D6D7CF21; Thu, 7 Mar 2019 21:42:51 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by mail.openembedded.org (Postfix) with ESMTP id 96E347CF14 for ; Thu, 7 Mar 2019 21:42:49 +0000 (UTC) Received: by mail-pf1-f193.google.com with SMTP id i20so12466006pfo.6 for ; Thu, 07 Mar 2019 13:42:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=SpvNU92hD9hdo1uZtfaOR78cZaYm4j6FZTOB3jMY0f8=; b=As3GRD0b2N8ChKHQazOOhsmLNZMZM3Qbq8vsKwSFvARi5+4nU8dYqYeID2fe2pC4VQ lS4lupORb/j0XXgd8jTwF/QmXJUZe4KxW/zUSlltjEN95CCddDmNCisn6+/EAfeY4vGf 3FxqESJ3MZ20bg0CzliF7NpYxANRZx85VorR1xtOiLjl/1pw1bhQcn4roSgJJkPT8pHe ZsaIbmSe2QU9dwPJ6zLqWattRIwXjSIYpVAIsdumx1Ku9HfX/mSvbQYf3vTNqIOHrwqq qF85LmRIjkCLlTcjOdRvdJNr+vdNdbVw+mWOdjQy7N+B1pxuk+2Ej6K/zDbq1XRH9L6H 3gvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=SpvNU92hD9hdo1uZtfaOR78cZaYm4j6FZTOB3jMY0f8=; b=nu8CNpFqIk8wTa3/puPSWrdkVpTDnUkkDi9Xpwo7+RAZwnJm755HRbYZHVprKV9nO3 GRlpHEyN2unGjzDO0ocVo3nkgUM19ZmrZ62uvM93UxJKMw81SfzpjvbdyAI0xCuDuheO +RHxsTA+GQ5O6YkT4UDKrdQV59xp5iriLBPVq3S16AS+7WlW/PUCyZqbOLwtTsj5lXFo 9N2CMqmvM5TlKBI1Ab37hECMCNXilp6YOCcNoH87VieOGe4zW1gHp34ycv2Vv1NnU6FT LLFUnSyWR/4vri+ibiZeRuespbkFlVciQJPe/30sbVrTOQI6dovk49xsSAt80hX5d2Md Nb3w== X-Gm-Message-State: APjAAAVwoEBElEtzWypcAhz1L0BT0Nsrrr1FQjBsWVSols9/qZM6fsRD A55MERjPUQu0fpfttYKLPyjjQ2Pp X-Received: by 2002:a65:664d:: with SMTP id z13mr13303782pgv.389.1551994969442; Thu, 07 Mar 2019 13:42:49 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:8500:6bc6::3401]) by smtp.gmail.com with ESMTPSA id v186sm16043043pfv.184.2019.03.07.13.42.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Mar 2019 13:42:48 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Date: Thu, 7 Mar 2019 13:42:41 -0800 Message-Id: <20190307214242.37072-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [OE-core] [PATCH V2 1/2] go: Add recipes for 1.12 release and make it default X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org - Refresh patches - Enable GOCACHE required as of Go 1.12 Signed-off-by: Khem Raj --- v2: Refresh patches to make devtool happy, improve commit msg meta/conf/distro/include/tcmode-default.inc | 2 +- meta/recipes-devtools/go/go-1.12.inc | 23 ++ ...ow-CC-and-CXX-to-have-multiple-words.patch | 31 ++ ...ent-based-hash-generation-less-pedan.patch | 218 ++++++++++++++ ...-to-be-overridden-in-the-environment.patch | 48 +++ ...4-ld-add-soname-to-shareable-objects.patch | 45 +++ ...de-CC-when-building-dist-and-go_boot.patch | 37 +++ ...dist-separate-host-and-target-builds.patch | 282 ++++++++++++++++++ ...d-go-make-GOROOT-precious-by-default.patch | 106 +++++++ ...008-use-GOBUILDMODE-to-set-buildmode.patch | 37 +++ ...place-glibc-dynamic-linker-with-musl.patch | 112 +++++++ meta/recipes-devtools/go/go-common.inc | 1 - .../go/go-cross-canadian_1.12.bb | 2 + meta/recipes-devtools/go/go-cross.inc | 1 - meta/recipes-devtools/go/go-cross_1.12.bb | 2 + meta/recipes-devtools/go/go-crosssdk_1.12.bb | 2 + meta/recipes-devtools/go/go-native_1.12.bb | 2 + meta/recipes-devtools/go/go-runtime_1.12.bb | 2 + meta/recipes-devtools/go/go_1.12.bb | 14 + 19 files changed, 964 insertions(+), 3 deletions(-) create mode 100644 meta/recipes-devtools/go/go-1.12.inc create mode 100644 meta/recipes-devtools/go/go-1.12/0001-allow-CC-and-CXX-to-have-multiple-words.patch create mode 100644 meta/recipes-devtools/go/go-1.12/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch create mode 100644 meta/recipes-devtools/go/go-1.12/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch create mode 100644 meta/recipes-devtools/go/go-1.12/0004-ld-add-soname-to-shareable-objects.patch create mode 100644 meta/recipes-devtools/go/go-1.12/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch create mode 100644 meta/recipes-devtools/go/go-1.12/0006-cmd-dist-separate-host-and-target-builds.patch create mode 100644 meta/recipes-devtools/go/go-1.12/0007-cmd-go-make-GOROOT-precious-by-default.patch create mode 100644 meta/recipes-devtools/go/go-1.12/0008-use-GOBUILDMODE-to-set-buildmode.patch create mode 100644 meta/recipes-devtools/go/go-1.12/0009-ld-replace-glibc-dynamic-linker-with-musl.patch create mode 100644 meta/recipes-devtools/go/go-cross-canadian_1.12.bb create mode 100644 meta/recipes-devtools/go/go-cross_1.12.bb create mode 100644 meta/recipes-devtools/go/go-crosssdk_1.12.bb create mode 100644 meta/recipes-devtools/go/go-native_1.12.bb create mode 100644 meta/recipes-devtools/go/go-runtime_1.12.bb create mode 100644 meta/recipes-devtools/go/go_1.12.bb -- 2.21.0 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/conf/distro/include/tcmode-default.inc b/meta/conf/distro/include/tcmode-default.inc index 12d3901ee1..04373cc0aa 100644 --- a/meta/conf/distro/include/tcmode-default.inc +++ b/meta/conf/distro/include/tcmode-default.inc @@ -25,7 +25,7 @@ GDBVERSION ?= "8.2%" GLIBCVERSION ?= "2.29%" LINUXLIBCVERSION ?= "5.0%" QEMUVERSION ?= "3.1%" -GOVERSION ?= "1.11%" +GOVERSION ?= "1.12%" PREFERRED_VERSION_gcc ?= "${GCCVERSION}" PREFERRED_VERSION_gcc-cross-${TARGET_ARCH} ?= "${GCCVERSION}" diff --git a/meta/recipes-devtools/go/go-1.12.inc b/meta/recipes-devtools/go/go-1.12.inc new file mode 100644 index 0000000000..4f6c341fc3 --- /dev/null +++ b/meta/recipes-devtools/go/go-1.12.inc @@ -0,0 +1,23 @@ +require go-common.inc + +GO_BASEVERSION = "1.12" +GO_MINOR = "" +PV .= "${GO_MINOR}" +FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/go-${GO_BASEVERSION}:" + +LIC_FILES_CHKSUM = "file://LICENSE;md5=5d4950ecb7b26d2c5e4e7b4e0dd74707" + +SRC_URI += "\ + file://0001-allow-CC-and-CXX-to-have-multiple-words.patch \ + file://0002-cmd-go-make-content-based-hash-generation-less-pedan.patch \ + file://0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch \ + file://0004-ld-add-soname-to-shareable-objects.patch \ + file://0005-make.bash-override-CC-when-building-dist-and-go_boot.patch \ + file://0006-cmd-dist-separate-host-and-target-builds.patch \ + file://0007-cmd-go-make-GOROOT-precious-by-default.patch \ + file://0008-use-GOBUILDMODE-to-set-buildmode.patch \ +" +SRC_URI_append_libc-musl = " file://0009-ld-replace-glibc-dynamic-linker-with-musl.patch" + +SRC_URI[main.md5sum] = "b3332feba8a945a193b47a52d9981bb9" +SRC_URI[main.sha256sum] = "09c43d3336743866f2985f566db0520b36f4992aea2b4b2fd9f52f17049e88f2" diff --git a/meta/recipes-devtools/go/go-1.12/0001-allow-CC-and-CXX-to-have-multiple-words.patch b/meta/recipes-devtools/go/go-1.12/0001-allow-CC-and-CXX-to-have-multiple-words.patch new file mode 100644 index 0000000000..4442858c83 --- /dev/null +++ b/meta/recipes-devtools/go/go-1.12/0001-allow-CC-and-CXX-to-have-multiple-words.patch @@ -0,0 +1,31 @@ +From 7cc519aa5f84cf8fc7ac8c10fc69aa8040330ea0 Mon Sep 17 00:00:00 2001 +From: Matt Madison +Date: Mon, 19 Feb 2018 08:49:33 -0800 +Subject: [PATCH] allow CC and CXX to have multiple words + +Upstream-Status: Inappropriate [OE specific] + +Signed-off-by: Matt Madison + +--- + 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 afadbad..cedbfbf 100644 +--- a/src/cmd/go/internal/envcmd/env.go ++++ b/src/cmd/go/internal/envcmd/env.go +@@ -85,11 +85,11 @@ func MkEnv() []cfg.EnvVar { + + cc := cfg.DefaultCC(cfg.Goos, cfg.Goarch) + if env := strings.Fields(os.Getenv("CC")); len(env) > 0 { +- cc = env[0] ++ cc = strings.Join(env, " ") + } + cxx := cfg.DefaultCXX(cfg.Goos, cfg.Goarch) + if env := strings.Fields(os.Getenv("CXX")); len(env) > 0 { +- cxx = env[0] ++ cxx = strings.Join(env, " ") + } + env = append(env, cfg.EnvVar{Name: "CC", Value: cc}) + env = append(env, cfg.EnvVar{Name: "CXX", Value: cxx}) diff --git a/meta/recipes-devtools/go/go-1.12/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch b/meta/recipes-devtools/go/go-1.12/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch new file mode 100644 index 0000000000..66b8561874 --- /dev/null +++ b/meta/recipes-devtools/go/go-1.12/0002-cmd-go-make-content-based-hash-generation-less-pedan.patch @@ -0,0 +1,218 @@ +From 47db69e20ed66fb62b01affd83d829654b829893 Mon Sep 17 00:00:00 2001 +From: Matt Madison +Date: Mon, 19 Feb 2018 08:50:59 -0800 +Subject: [PATCH] cmd/go: make content-based hash generation less pedantic + +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 package is up-to-date. + +This is done to help ensure correctness, but is overly +simplistic and effectively prevents the reuse of built +artifacts that use cgo (or shared runtime, which includes +runtime/cgo). + +This patch filters out all compiler flags except those +beginning with '-m'. The default behavior can be restored +by setting the CGO_PEDANTIC environment variable. + +Upstream-Status: Inappropriate [OE specific] + +Signed-off-by: Matt Madison + +--- + src/cmd/go/internal/envcmd/env.go | 2 +- + src/cmd/go/internal/work/exec.go | 63 ++++++++++++++++++++++--------- + 2 files changed, 46 insertions(+), 19 deletions(-) + +diff --git a/src/cmd/go/internal/envcmd/env.go b/src/cmd/go/internal/envcmd/env.go +index cedbfbf..5763a0d 100644 +--- a/src/cmd/go/internal/envcmd/env.go ++++ b/src/cmd/go/internal/envcmd/env.go +@@ -128,7 +128,7 @@ func ExtraEnvVars() []cfg.EnvVar { + func ExtraEnvVarsCostly() []cfg.EnvVar { + var b work.Builder + b.Init() +- cppflags, cflags, cxxflags, fflags, ldflags, err := b.CFlags(&load.Package{}) ++ cppflags, cflags, cxxflags, fflags, ldflags, err := b.CFlags(&load.Package{}, false) + if err != nil { + // Should not happen - b.CFlags was given an empty package. + fmt.Fprintf(os.Stderr, "go: invalid cflags: %v\n", err) +diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go +index 12e1527..e41bfac 100644 +--- a/src/cmd/go/internal/work/exec.go ++++ b/src/cmd/go/internal/work/exec.go +@@ -174,6 +174,8 @@ func (b *Builder) Do(root *Action) { + wg.Wait() + } + ++var omitGopath = os.Getenv("GOPATH_OMIT_IN_ACTIONID") != "" ++ + // buildActionID computes the action ID for a build action. + func (b *Builder) buildActionID(a *Action) cache.ActionID { + p := a.Package +@@ -190,7 +192,7 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID { + // but it does not hide the exact value of $GOPATH. + // Include the full dir in that case. + // Assume b.WorkDir is being trimmed properly. +- if !p.Goroot && !strings.HasPrefix(p.Dir, b.WorkDir) { ++ if !p.Goroot && !omitGopath && !strings.HasPrefix(p.Dir, b.WorkDir) { + fmt.Fprintf(h, "dir %s\n", p.Dir) + } + fmt.Fprintf(h, "goos %s goarch %s\n", cfg.Goos, cfg.Goarch) +@@ -201,13 +203,13 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID { + } + if len(p.CgoFiles)+len(p.SwigFiles) > 0 { + fmt.Fprintf(h, "cgo %q\n", b.toolID("cgo")) +- cppflags, cflags, cxxflags, fflags, ldflags, _ := b.CFlags(p) +- fmt.Fprintf(h, "CC=%q %q %q %q\n", b.ccExe(), cppflags, cflags, ldflags) ++ cppflags, cflags, cxxflags, fflags, ldflags, _ := b.CFlags(p, true) ++ fmt.Fprintf(h, "CC=%q %q %q %q\n", b.ccExe(true), cppflags, cflags, ldflags) + if len(p.CXXFiles)+len(p.SwigFiles) > 0 { +- fmt.Fprintf(h, "CXX=%q %q\n", b.cxxExe(), cxxflags) ++ fmt.Fprintf(h, "CXX=%q %q\n", b.cxxExe(true), cxxflags) + } + if len(p.FFiles) > 0 { +- fmt.Fprintf(h, "FC=%q %q\n", b.fcExe(), fflags) ++ fmt.Fprintf(h, "FC=%q %q\n", b.fcExe(true), fflags) + } + // TODO(rsc): Should we include the SWIG version or Fortran/GCC/G++/Objective-C compiler versions? + } +@@ -2096,33 +2098,33 @@ var ( + // gccCmd returns a gcc command line prefix + // defaultCC is defined in zdefaultcc.go, written by cmd/dist. + func (b *Builder) GccCmd(incdir, workdir string) []string { +- return b.compilerCmd(b.ccExe(), incdir, workdir) ++ return b.compilerCmd(b.ccExe(false), incdir, workdir) + } + + // gxxCmd returns a g++ command line prefix + // defaultCXX is defined in zdefaultcc.go, written by cmd/dist. + func (b *Builder) GxxCmd(incdir, workdir string) []string { +- return b.compilerCmd(b.cxxExe(), incdir, workdir) ++ return b.compilerCmd(b.cxxExe(false), incdir, workdir) + } + + // gfortranCmd returns a gfortran command line prefix. + func (b *Builder) gfortranCmd(incdir, workdir string) []string { +- return b.compilerCmd(b.fcExe(), incdir, workdir) ++ return b.compilerCmd(b.fcExe(false), incdir, workdir) + } + + // ccExe returns the CC compiler setting without all the extra flags we add implicitly. +-func (b *Builder) ccExe() []string { +- return b.compilerExe(origCC, cfg.DefaultCC(cfg.Goos, cfg.Goarch)) ++func (b *Builder) ccExe(filtered bool) []string { ++ return b.compilerExe(origCC, cfg.DefaultCC(cfg.Goos, cfg.Goarch), filtered) + } + + // cxxExe returns the CXX compiler setting without all the extra flags we add implicitly. +-func (b *Builder) cxxExe() []string { +- return b.compilerExe(origCXX, cfg.DefaultCXX(cfg.Goos, cfg.Goarch)) ++func (b *Builder) cxxExe(filtered bool) []string { ++ return b.compilerExe(origCXX, cfg.DefaultCXX(cfg.Goos, cfg.Goarch), filtered) + } + + // fcExe returns the FC compiler setting without all the extra flags we add implicitly. +-func (b *Builder) fcExe() []string { +- return b.compilerExe(os.Getenv("FC"), "gfortran") ++func (b *Builder) fcExe(filtered bool) []string { ++ return b.compilerExe(os.Getenv("FC"), "gfortran", filtered) + } + + // compilerExe returns the compiler to use given an +@@ -2131,11 +2133,14 @@ func (b *Builder) fcExe() []string { + // of the compiler but can have additional arguments if they + // were present in the environment value. + // For example if CC="gcc -DGOPHER" then the result is ["gcc", "-DGOPHER"]. +-func (b *Builder) compilerExe(envValue string, def string) []string { ++func (b *Builder) compilerExe(envValue string, def string, filtered bool) []string { + compiler := strings.Fields(envValue) + if len(compiler) == 0 { + compiler = []string{def} + } ++ if filtered { ++ return append(compiler[0:1], filterCompilerFlags(compiler[1:])...) ++ } + return compiler + } + +@@ -2285,8 +2290,23 @@ func envList(key, def string) []string { + return strings.Fields(v) + } + ++var filterFlags = os.Getenv("CGO_PEDANTIC") == "" ++ ++func filterCompilerFlags(flags []string) []string { ++ var newflags []string ++ if !filterFlags { ++ return flags ++ } ++ for _, flag := range flags { ++ if strings.HasPrefix(flag, "-m") { ++ newflags = append(newflags, flag) ++ } ++ } ++ return newflags ++} ++ + // CFlags returns the flags to use when invoking the C, C++ or Fortran compilers, or cgo. +-func (b *Builder) CFlags(p *load.Package) (cppflags, cflags, cxxflags, fflags, ldflags []string, err error) { ++func (b *Builder) CFlags(p *load.Package, filtered bool) (cppflags, cflags, cxxflags, fflags, ldflags []string, err error) { + defaults := "-g -O2" + + if cppflags, err = buildFlags("CPPFLAGS", "", p.CgoCPPFLAGS, checkCompilerFlags); err != nil { +@@ -2304,6 +2324,13 @@ func (b *Builder) CFlags(p *load.Package) (cppflags, cflags, cxxflags, fflags, l + if ldflags, err = buildFlags("LDFLAGS", defaults, p.CgoLDFLAGS, checkLinkerFlags); err != nil { + return + } ++ if filtered { ++ cppflags = filterCompilerFlags(cppflags) ++ cflags = filterCompilerFlags(cflags) ++ cxxflags = filterCompilerFlags(cxxflags) ++ fflags = filterCompilerFlags(fflags) ++ ldflags = filterCompilerFlags(ldflags) ++ } + + return + } +@@ -2319,7 +2346,7 @@ var cgoRe = regexp.MustCompile(`[/\\:]`) + + func (b *Builder) cgo(a *Action, cgoExe, objdir string, pcCFLAGS, pcLDFLAGS, cgofiles, gccfiles, gxxfiles, mfiles, ffiles []string) (outGo, outObj []string, err error) { + p := a.Package +- cgoCPPFLAGS, cgoCFLAGS, cgoCXXFLAGS, cgoFFLAGS, cgoLDFLAGS, err := b.CFlags(p) ++ cgoCPPFLAGS, cgoCFLAGS, cgoCXXFLAGS, cgoFFLAGS, cgoLDFLAGS, err := b.CFlags(p, false) + if err != nil { + return nil, nil, err + } +@@ -2679,7 +2706,7 @@ func (b *Builder) swigIntSize(objdir string) (intsize string, err error) { + + // Run SWIG on one SWIG input file. + func (b *Builder) swigOne(a *Action, p *load.Package, file, objdir string, pcCFLAGS []string, cxx bool, intgosize string) (outGo, outC string, err error) { +- cgoCPPFLAGS, cgoCFLAGS, cgoCXXFLAGS, _, _, err := b.CFlags(p) ++ cgoCPPFLAGS, cgoCFLAGS, cgoCXXFLAGS, _, _, err := b.CFlags(p, false) + if err != nil { + return "", "", err + } diff --git a/meta/recipes-devtools/go/go-1.12/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch b/meta/recipes-devtools/go/go-1.12/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch new file mode 100644 index 0000000000..b6ca40edee --- /dev/null +++ b/meta/recipes-devtools/go/go-1.12/0003-allow-GOTOOLDIR-to-be-overridden-in-the-environment.patch @@ -0,0 +1,48 @@ +From 5c32c38bf19b24f0aadd78012d17ff5caa82151e Mon Sep 17 00:00:00 2001 +From: Matt Madison +Date: Sat, 17 Feb 2018 05:24:20 -0800 +Subject: [PATCH] allow GOTOOLDIR to be overridden in the environment + +to allow for split host/target build roots + +Upstream-Status: Inappropriate [OE specific] + +Signed-off-by: Matt Madison + +--- + src/cmd/dist/build.go | 4 +++- + src/cmd/go/internal/cfg/cfg.go | 7 +++++-- + 2 files changed, 8 insertions(+), 3 deletions(-) + +Index: go/src/cmd/dist/build.go +=================================================================== +--- go.orig/src/cmd/dist/build.go ++++ go/src/cmd/dist/build.go +@@ -228,7 +228,9 @@ func xinit() { + workdir = xworkdir() + xatexit(rmworkdir) + +- tooldir = pathf("%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch) ++ if tooldir = os.Getenv("GOTOOLDIR"); tooldir == "" { ++ tooldir = pathf("%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch) ++ } + } + + // compilerEnv returns a map from "goos/goarch" to the +Index: go/src/cmd/go/internal/cfg/cfg.go +=================================================================== +--- go.orig/src/cmd/go/internal/cfg/cfg.go ++++ go/src/cmd/go/internal/cfg/cfg.go +@@ -116,7 +116,11 @@ func init() { + // variables. This matches the initialization of ToolDir in + // go/build, except for using GOROOT rather than + // runtime.GOROOT. +- build.ToolDir = filepath.Join(GOROOT, "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH) ++ if s := os.Getenv("GOTOOLDIR"); s != "" { ++ build.ToolDir = filepath.Clean(s) ++ } else { ++ build.ToolDir = filepath.Join(GOROOT, "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH) ++ } + } + } + diff --git a/meta/recipes-devtools/go/go-1.12/0004-ld-add-soname-to-shareable-objects.patch b/meta/recipes-devtools/go/go-1.12/0004-ld-add-soname-to-shareable-objects.patch new file mode 100644 index 0000000000..004a33a023 --- /dev/null +++ b/meta/recipes-devtools/go/go-1.12/0004-ld-add-soname-to-shareable-objects.patch @@ -0,0 +1,45 @@ +From 55eb8c95a89f32aec16b7764e78e8cf75169dc81 Mon Sep 17 00:00:00 2001 +From: Matt Madison +Date: Sat, 17 Feb 2018 06:26:10 -0800 +Subject: [PATCH] ld: add soname to shareable objects + +so that OE's shared library dependency handling +can find them. + +Upstream-Status: Inappropriate [OE specific] + +Signed-off-by: Matt Madison + +--- + src/cmd/link/internal/ld/lib.go | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go +index 220aab3..703925f 100644 +--- a/src/cmd/link/internal/ld/lib.go ++++ b/src/cmd/link/internal/ld/lib.go +@@ -1135,6 +1135,7 @@ func (ctxt *Link) hostlink() { + argv = append(argv, "-Wl,-z,relro") + } + argv = append(argv, "-shared") ++ argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile))) + if ctxt.HeadType != objabi.Hwindows { + // Pass -z nodelete to mark the shared library as + // non-closeable: a dlclose will do nothing. +@@ -1146,6 +1147,8 @@ func (ctxt *Link) hostlink() { + argv = append(argv, "-Wl,-z,relro") + } + argv = append(argv, "-shared") ++ argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile))) ++ + case BuildModePlugin: + if ctxt.HeadType == objabi.Hdarwin { + argv = append(argv, "-dynamiclib") +@@ -1154,6 +1157,7 @@ func (ctxt *Link) hostlink() { + argv = append(argv, "-Wl,-z,relro") + } + argv = append(argv, "-shared") ++ argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile))) + } + } + diff --git a/meta/recipes-devtools/go/go-1.12/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch b/meta/recipes-devtools/go/go-1.12/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch new file mode 100644 index 0000000000..ace8de9eae --- /dev/null +++ b/meta/recipes-devtools/go/go-1.12/0005-make.bash-override-CC-when-building-dist-and-go_boot.patch @@ -0,0 +1,37 @@ +From 1bf15aa8fb773604b2524cfdab493fa4d8fa9285 Mon Sep 17 00:00:00 2001 +From: Matt Madison +Date: Sat, 17 Feb 2018 06:32:45 -0800 +Subject: [PATCH] make.bash: override CC when building dist and go_bootstrap + +for handling OE cross-canadian builds. + +Upstream-Status: Inappropriate [OE specific] + +Signed-off-by: Matt Madison + +--- + src/make.bash | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/make.bash b/src/make.bash +index 78882d9..25943d0 100755 +--- a/src/make.bash ++++ b/src/make.bash +@@ -163,7 +163,7 @@ if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; then + exit 1 + fi + rm -f cmd/dist/dist +-GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist ++CC="${BUILD_CC:-${CC}}" GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" 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) +@@ -194,7 +194,7 @@ fi + # Run dist bootstrap to complete make.bash. + # Bootstrap installs a proper cmd/dist, built with the new toolchain. + # Throw ours, built with Go 1.4, away after bootstrap. +-./cmd/dist/dist bootstrap $buildall $vflag $GO_DISTFLAGS "$@" ++CC="${BUILD_CC:-${CC}}" ./cmd/dist/dist bootstrap $buildall $vflag $GO_DISTFLAGS "$@" + rm -f ./cmd/dist/dist + + # DO NOT ADD ANY NEW CODE HERE. diff --git a/meta/recipes-devtools/go/go-1.12/0006-cmd-dist-separate-host-and-target-builds.patch b/meta/recipes-devtools/go/go-1.12/0006-cmd-dist-separate-host-and-target-builds.patch new file mode 100644 index 0000000000..0c0d5da80a --- /dev/null +++ b/meta/recipes-devtools/go/go-1.12/0006-cmd-dist-separate-host-and-target-builds.patch @@ -0,0 +1,282 @@ +From fe0fcaf43ef3aab81541dad2a71b46254dc4cf6a Mon Sep 17 00:00:00 2001 +From: Matt Madison +Date: Sat, 17 Feb 2018 10:03:48 -0800 +Subject: [PATCH] cmd/dist: separate host and target builds + +Change the dist tool to allow for OE-style cross- +and cross-canadian builds: + + - command flags --host-only and --target only are added; + if one is present, the other changes mentioned below + take effect, and arguments may also be specified on + the command line to enumerate the package(s) to be + built. + + - for OE cross builds, go_bootstrap is always built for + the current build host, and is moved, along with the supporting + toolchain (asm, compile, etc.) to a separate 'native_native' + directory under GOROOT/pkg/tool. + + - go_bootstrap is not automatically removed after the build, + so it can be reused later (e.g., building both static and + shared runtime). + +Note that for --host-only builds, it would be nice to specify +just the "cmd" package to build only the go commands/tools, +the staleness checks in the dist tool will fail if the "std" +library has not also been built. So host-only builds have to +build everything anyway. + +Upstream-Status: Inappropriate [OE specific] + +Signed-off-by: Matt Madison + +more dist cleanup + +--- + src/cmd/dist/build.go | 153 ++++++++++++++++++++++++++++++------------ + 1 file changed, 111 insertions(+), 42 deletions(-) + +Index: go/src/cmd/dist/build.go +=================================================================== +--- go.orig/src/cmd/dist/build.go ++++ go/src/cmd/dist/build.go +@@ -39,6 +39,7 @@ var ( + goldflags string + workdir string + tooldir string ++ build_tooldir string + oldgoos string + oldgoarch string + exe string +@@ -50,6 +51,7 @@ var ( + + rebuildall bool + defaultclang bool ++ crossBuild bool + + vflag int // verbosity + ) +@@ -231,6 +233,8 @@ func xinit() { + if tooldir = os.Getenv("GOTOOLDIR"); tooldir == "" { + tooldir = pathf("%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch) + } ++ build_tooldir = pathf("%s/pkg/tool/native_native", goroot) ++ + } + + // compilerEnv returns a map from "goos/goarch" to the +@@ -260,7 +264,6 @@ func compilerEnv(envName, def string) ma + if gohostos != goos || gohostarch != goarch { + m[gohostos+"/"+gohostarch] = m[""] + } +- m[""] = env + } + + for _, goos := range okgoos { +@@ -487,8 +490,10 @@ func setup() { + // We keep it in pkg/, just like the object directory above. + if rebuildall { + xremoveall(tooldir) ++ xremoveall(build_tooldir) + } + xmkdirall(tooldir) ++ xmkdirall(build_tooldir) + + // Remove tool binaries from before the tool/gohostos_gohostarch + xremoveall(pathf("%s/bin/tool", goroot)) +@@ -1155,11 +1160,29 @@ func cmdbootstrap() { + + var noBanner bool + var debug bool ++ var hostOnly bool ++ var targetOnly bool ++ var toBuild = []string { "std", "cmd" } ++ + flag.BoolVar(&rebuildall, "a", rebuildall, "rebuild all") + flag.BoolVar(&debug, "d", debug, "enable debugging of bootstrap process") + flag.BoolVar(&noBanner, "no-banner", noBanner, "do not print banner") ++ flag.BoolVar(&hostOnly, "host-only", hostOnly, "build only host binaries, not target") ++ flag.BoolVar(&targetOnly, "target-only", targetOnly, "build only target binaries, not host") + +- xflagparse(0) ++ xflagparse(-1) ++ ++ if (hostOnly && targetOnly) { ++ fatalf("specify only one of --host-only or --target-only\n") ++ } ++ crossBuild = hostOnly || targetOnly ++ if flag.NArg() > 0 { ++ if crossBuild { ++ toBuild = flag.Args() ++ } else { ++ fatalf("package names not permitted without --host-only or --target-only\n") ++ } ++ } + + if debug { + // cmd/buildid is used in debug mode. +@@ -1207,8 +1230,13 @@ func cmdbootstrap() { + xprintf("\n") + } + +- gogcflags = os.Getenv("GO_GCFLAGS") // we were using $BOOT_GO_GCFLAGS until now +- goldflags = os.Getenv("GO_LDFLAGS") ++ // For split host/target cross/cross-canadian builds, we don't ++ // want to be setting these flags until after we have compiled ++ // the toolchain that runs on the build host. ++ if ! crossBuild { ++ gogcflags = os.Getenv("GO_GCFLAGS") // we were using $BOOT_GO_GCFLAGS until now ++ goldflags = os.Getenv("GO_LDFLAGS") ++ } + goBootstrap := pathf("%s/go_bootstrap", tooldir) + cmdGo := pathf("%s/go", gobin) + if debug { +@@ -1237,7 +1265,11 @@ func cmdbootstrap() { + xprintf("\n") + } + xprintf("Building Go toolchain2 using go_bootstrap and Go toolchain1.\n") +- os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch)) ++ if crossBuild { ++ os.Setenv("CC", defaultcc[""]) ++ } else { ++ os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch)) ++ } + goInstall(goBootstrap, append([]string{"-i"}, toolchain...)...) + if debug { + run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full") +@@ -1274,50 +1306,84 @@ func cmdbootstrap() { + } + checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...) + +- if goos == oldgoos && goarch == oldgoarch { +- // Common case - not setting up for cross-compilation. +- timelog("build", "toolchain") +- if vflag > 0 { +- xprintf("\n") ++ if crossBuild { ++ gogcflags = os.Getenv("GO_GCFLAGS") ++ goldflags = os.Getenv("GO_LDFLAGS") ++ tool_files, _ := filepath.Glob(pathf("%s/*", tooldir)) ++ for _, f := range tool_files { ++ copyfile(pathf("%s/%s", build_tooldir, filepath.Base(f)), f, writeExec) ++ xremove(f) ++ } ++ os.Setenv("GOTOOLDIR", build_tooldir) ++ goBootstrap = pathf("%s/go_bootstrap", build_tooldir) ++ if hostOnly { ++ timelog("build", "host toolchain") ++ if vflag > 0 { ++ xprintf("\n") ++ } ++ xprintf("Building %s for host, %s/%s.\n", strings.Join(toBuild, ","), goos, goarch) ++ goInstall(goBootstrap, toBuild...) ++ checkNotStale(goBootstrap, toBuild...) ++ // Skip cmdGo staleness checks here, since we can't necessarily run the cmdGo binary ++ ++ timelog("build", "target toolchain") ++ if vflag > 0 { ++ xprintf("\n") ++ } ++ } else if targetOnly { ++ goos = oldgoos ++ goarch = oldgoarch ++ os.Setenv("GOOS", goos) ++ os.Setenv("GOARCH", goarch) ++ os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch)) ++ xprintf("Building %s for target, %s/%s.\n", strings.Join(toBuild, ","), goos, goarch) ++ goInstall(goBootstrap, toBuild...) ++ checkNotStale(goBootstrap, toBuild...) ++ // Skip cmdGo staleness checks here, since we can't run the target's cmdGo binary + } +- xprintf("Building packages and commands for %s/%s.\n", goos, goarch) + } else { +- // GOOS/GOARCH does not match GOHOSTOS/GOHOSTARCH. +- // Finish GOHOSTOS/GOHOSTARCH installation and then +- // run GOOS/GOARCH installation. +- timelog("build", "host toolchain") +- if vflag > 0 { +- xprintf("\n") ++ ++ if goos == oldgoos && goarch == oldgoarch { ++ // Common case - not setting up for cross-compilation. ++ timelog("build", "toolchain") ++ if vflag > 0 { ++ xprintf("\n") ++ } ++ xprintf("Building packages and commands for %s/%s.\n", goos, goarch) ++ } else { ++ // GOOS/GOARCH does not match GOHOSTOS/GOHOSTARCH. ++ // Finish GOHOSTOS/GOHOSTARCH installation and then ++ // run GOOS/GOARCH installation. ++ timelog("build", "host toolchain") ++ if vflag > 0 { ++ xprintf("\n") ++ } ++ xprintf("Building packages and commands for host, %s/%s.\n", goos, goarch) ++ goInstall(goBootstrap, "std", "cmd") ++ checkNotStale(goBootstrap, "std", "cmd") ++ checkNotStale(cmdGo, "std", "cmd") ++ ++ timelog("build", "target toolchain") ++ if vflag > 0 { ++ xprintf("\n") ++ } ++ goos = oldgoos ++ goarch = oldgoarch ++ os.Setenv("GOOS", goos) ++ os.Setenv("GOARCH", goarch) ++ os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch)) ++ xprintf("Building packages and commands for target, %s/%s.\n", goos, goarch) + } +- xprintf("Building packages and commands for host, %s/%s.\n", goos, goarch) + goInstall(goBootstrap, "std", "cmd") + checkNotStale(goBootstrap, "std", "cmd") + checkNotStale(cmdGo, "std", "cmd") + +- timelog("build", "target toolchain") +- if vflag > 0 { +- xprintf("\n") +- } +- goos = oldgoos +- goarch = oldgoarch +- os.Setenv("GOOS", goos) +- os.Setenv("GOARCH", goarch) +- os.Setenv("CC", compilerEnvLookup(defaultcc, goos, goarch)) +- xprintf("Building packages and commands for target, %s/%s.\n", goos, goarch) +- } +- targets := []string{"std", "cmd"} +- if goos == "js" && goarch == "wasm" { +- // Skip the cmd tools for js/wasm. They're not usable. +- targets = targets[:1] +- } +- goInstall(goBootstrap, targets...) +- checkNotStale(goBootstrap, targets...) +- checkNotStale(cmdGo, targets...) +- if debug { +- run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full") +- run("", ShowOutput|CheckExit, pathf("%s/buildid", tooldir), pathf("%s/pkg/%s_%s/runtime/internal/sys.a", goroot, goos, goarch)) +- checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...) +- copyfile(pathf("%s/compile4", tooldir), pathf("%s/compile", tooldir), writeExec) ++ if debug { ++ run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full") ++ run("", ShowOutput|CheckExit, pathf("%s/buildid", tooldir), pathf("%s/pkg/%s_%s/runtime/internal/sys.a", goroot, goos, goarch)) ++ checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...) ++ copyfile(pathf("%s/compile4", tooldir), pathf("%s/compile", tooldir), writeExec) ++ } + } + + // Check that there are no new files in $GOROOT/bin other than +@@ -1335,7 +1401,11 @@ func cmdbootstrap() { + } + + // Remove go_bootstrap now that we're done. +- xremove(pathf("%s/go_bootstrap", tooldir)) ++ // Except that for split host/target cross-builds, we need to ++ // keep it. ++ if ! crossBuild { ++ xremove(pathf("%s/go_bootstrap", tooldir)) ++ } + + // Print trailing banner unless instructed otherwise. + if !noBanner { diff --git a/meta/recipes-devtools/go/go-1.12/0007-cmd-go-make-GOROOT-precious-by-default.patch b/meta/recipes-devtools/go/go-1.12/0007-cmd-go-make-GOROOT-precious-by-default.patch new file mode 100644 index 0000000000..29ef947abd --- /dev/null +++ b/meta/recipes-devtools/go/go-1.12/0007-cmd-go-make-GOROOT-precious-by-default.patch @@ -0,0 +1,106 @@ +From 7cc60b3887be2d5674b9f5d422d022976cf205e5 Mon Sep 17 00:00:00 2001 +From: Matt Madison +Date: Fri, 2 Mar 2018 06:00:20 -0800 +Subject: [PATCH] cmd/go: make GOROOT precious by default + +The go build tool normally rebuilds whatever it detects is +stale. This can be a problem when GOROOT is intended to +be read-only and the go runtime has been built as a shared +library, since we don't want every application to be rebuilding +the shared runtime - particularly in cross-build/packaging +setups, since that would lead to 'abi mismatch' runtime errors. + +This patch prevents the install and linkshared actions from +installing to GOROOT unless overridden with the GOROOT_OVERRIDE +environment variable. + +Upstream-Status: Inappropriate [OE specific] + +Signed-off-by: Matt Madison + +--- + src/cmd/go/internal/work/action.go | 3 +++ + src/cmd/go/internal/work/build.go | 5 +++++ + src/cmd/go/internal/work/exec.go | 25 +++++++++++++++++++++++++ + 3 files changed, 33 insertions(+) + +Index: go/src/cmd/go/internal/work/action.go +=================================================================== +--- go.orig/src/cmd/go/internal/work/action.go ++++ go/src/cmd/go/internal/work/action.go +@@ -600,6 +600,9 @@ func (b *Builder) addTransitiveLinkDeps( + if p1 == nil || p1.Shlib == "" || haveShlib[filepath.Base(p1.Shlib)] { + continue + } ++ if goRootPrecious && (p1.Standard || p1.Goroot) { ++ continue ++ } + haveShlib[filepath.Base(p1.Shlib)] = true + // TODO(rsc): The use of ModeInstall here is suspect, but if we only do ModeBuild, + // we'll end up building an overall library or executable that depends at runtime +Index: go/src/cmd/go/internal/work/build.go +=================================================================== +--- go.orig/src/cmd/go/internal/work/build.go ++++ go/src/cmd/go/internal/work/build.go +@@ -147,6 +147,7 @@ See also: go install, go get, go clean. + } + + const concurrentGCBackendCompilationEnabledByDefault = true ++var goRootPrecious bool = true + + func init() { + // break init cycle +@@ -160,6 +161,10 @@ func init() { + + AddBuildFlags(CmdBuild) + AddBuildFlags(CmdInstall) ++ ++ if x := os.Getenv("GOROOT_OVERRIDE"); x != "" { ++ goRootPrecious = false ++ } + } + + // Note that flags consulted by other parts of the code +Index: go/src/cmd/go/internal/work/exec.go +=================================================================== +--- go.orig/src/cmd/go/internal/work/exec.go ++++ go/src/cmd/go/internal/work/exec.go +@@ -436,6 +436,23 @@ func (b *Builder) build(a *Action) (err + return fmt.Errorf("missing or invalid binary-only package; expected file %q", a.Package.Target) + } + ++ if goRootPrecious && (a.Package.Standard || a.Package.Goroot) { ++ _, err := os.Stat(a.Package.Target) ++ if err == nil { ++ a.built = a.Package.Target ++ a.Target = a.Package.Target ++ a.buildID = b.fileHash(a.Package.Target) ++ a.Package.Stale = false ++ a.Package.StaleReason = "GOROOT-resident package" ++ return nil ++ } ++ a.Package.Stale = true ++ a.Package.StaleReason = "missing or invalid GOROOT-resident package" ++ if b.IsCmdList { ++ return nil ++ } ++ } ++ + if err := b.Mkdir(a.Objdir); err != nil { + return err + } +@@ -1438,6 +1455,14 @@ func BuildInstallFunc(b *Builder, a *Act + return nil + } + ++ if goRootPrecious && a.Package != nil { ++ p := a.Package ++ if p.Standard || p.Goroot { ++ err := fmt.Errorf("attempting to install package %s into read-only GOROOT", p.ImportPath) ++ return err ++ } ++ } ++ + if err := b.Mkdir(a.Objdir); err != nil { + return err + } diff --git a/meta/recipes-devtools/go/go-1.12/0008-use-GOBUILDMODE-to-set-buildmode.patch b/meta/recipes-devtools/go/go-1.12/0008-use-GOBUILDMODE-to-set-buildmode.patch new file mode 100644 index 0000000000..225cf439c5 --- /dev/null +++ b/meta/recipes-devtools/go/go-1.12/0008-use-GOBUILDMODE-to-set-buildmode.patch @@ -0,0 +1,37 @@ +From 0e0c247f0caec23528889ff09d98348cba9028f1 Mon Sep 17 00:00:00 2001 +From: Hongxu Jia +Date: Fri, 26 Oct 2018 15:02:32 +0800 +Subject: [PATCH] use GOBUILDMODE to set buildmode + +While building go itself, the go build system does not support +to set `-buildmode=pie' from environment. + +Add GOBUILDMODE to support it which make PIE executables the default +build mode, as PIE executables are required as of Yocto + +Refers: https://groups.google.com/forum/#!topic/golang-dev/gRCe5URKewI +Upstream-Status: Denied [upstream choose antoher solution: `17a256b +cmd/go: -buildmode=pie for android/arm'] + +Signed-off-by: Hongxu Jia +--- + src/cmd/go/internal/work/build.go | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +Index: go/src/cmd/go/internal/work/build.go +=================================================================== +--- go.orig/src/cmd/go/internal/work/build.go ++++ go/src/cmd/go/internal/work/build.go +@@ -223,7 +223,11 @@ func AddBuildFlags(cmd *base.Command) { + + cmd.Flag.Var(&load.BuildAsmflags, "asmflags", "") + cmd.Flag.Var(buildCompiler{}, "compiler", "") +- cmd.Flag.StringVar(&cfg.BuildBuildmode, "buildmode", "default", "") ++ if bm := os.Getenv("GOBUILDMODE"); bm != "" { ++ cmd.Flag.StringVar(&cfg.BuildBuildmode, "buildmode", bm, "") ++ } else { ++ cmd.Flag.StringVar(&cfg.BuildBuildmode, "buildmode", "default", "") ++ } + cmd.Flag.Var(&load.BuildGcflags, "gcflags", "") + cmd.Flag.Var(&load.BuildGccgoflags, "gccgoflags", "") + cmd.Flag.StringVar(&cfg.BuildMod, "mod", "", "") diff --git a/meta/recipes-devtools/go/go-1.12/0009-ld-replace-glibc-dynamic-linker-with-musl.patch b/meta/recipes-devtools/go/go-1.12/0009-ld-replace-glibc-dynamic-linker-with-musl.patch new file mode 100644 index 0000000000..840cf4bbd7 --- /dev/null +++ b/meta/recipes-devtools/go/go-1.12/0009-ld-replace-glibc-dynamic-linker-with-musl.patch @@ -0,0 +1,112 @@ +From 35ea4be34e94912b00837e0f7c7385f2e98fe769 Mon Sep 17 00:00:00 2001 +From: Matt Madison +Date: Sun, 18 Feb 2018 08:24:05 -0800 +Subject: [PATCH] ld: replace glibc dynamic linker with musl + +Rework of patch by Khem Raj +for go 1.10. Should be applied conditionally on +musl being the system C library. + +Upstream-Status: Inappropriate [Real fix should be portable across libcs] + +Signed-off-by: Matt Madison + +--- + src/cmd/link/internal/amd64/obj.go | 2 +- + src/cmd/link/internal/arm/obj.go | 2 +- + src/cmd/link/internal/arm64/obj.go | 2 +- + src/cmd/link/internal/mips/obj.go | 2 +- + src/cmd/link/internal/mips64/obj.go | 2 +- + src/cmd/link/internal/ppc64/obj.go | 2 +- + src/cmd/link/internal/s390x/obj.go | 2 +- + src/cmd/link/internal/x86/obj.go | 2 +- + 8 files changed, 8 insertions(+), 8 deletions(-) + +--- a/src/cmd/link/internal/amd64/obj.go ++++ b/src/cmd/link/internal/amd64/obj.go +@@ -62,7 +62,7 @@ func Init() (*sys.Arch, ld.Arch) { + PEreloc1: pereloc1, + TLSIEtoLE: tlsIEtoLE, + +- Linuxdynld: "/lib64/ld-linux-x86-64.so.2", ++ Linuxdynld: "/lib64/ld-musl-x86-64.so.1", + Freebsddynld: "/libexec/ld-elf.so.1", + Openbsddynld: "/usr/libexec/ld.so", + Netbsddynld: "/libexec/ld.elf_so", +--- a/src/cmd/link/internal/arm/obj.go ++++ b/src/cmd/link/internal/arm/obj.go +@@ -59,7 +59,7 @@ func Init() (*sys.Arch, ld.Arch) { + Machoreloc1: machoreloc1, + PEreloc1: pereloc1, + +- Linuxdynld: "/lib/ld-linux.so.3", // 2 for OABI, 3 for EABI ++ Linuxdynld: "/lib/ld-musl-armhf.so.1", + Freebsddynld: "/usr/libexec/ld-elf.so.1", + Openbsddynld: "/usr/libexec/ld.so", + Netbsddynld: "/libexec/ld.elf_so", +--- a/src/cmd/link/internal/arm64/obj.go ++++ b/src/cmd/link/internal/arm64/obj.go +@@ -57,7 +57,7 @@ func Init() (*sys.Arch, ld.Arch) { + Gentext: gentext, + Machoreloc1: machoreloc1, + +- Linuxdynld: "/lib/ld-linux-aarch64.so.1", ++ Linuxdynld: "/lib/ld-musl-aarch64.so.1", + + Freebsddynld: "XXX", + Openbsddynld: "XXX", +--- a/src/cmd/link/internal/mips/obj.go ++++ b/src/cmd/link/internal/mips/obj.go +@@ -60,7 +60,7 @@ func Init() (*sys.Arch, ld.Arch) { + Gentext: gentext, + Machoreloc1: machoreloc1, + +- Linuxdynld: "/lib/ld.so.1", ++ Linuxdynld: "/lib/ld-musl-mipsle.so.1", + + Freebsddynld: "XXX", + Openbsddynld: "XXX", +--- a/src/cmd/link/internal/mips64/obj.go ++++ b/src/cmd/link/internal/mips64/obj.go +@@ -59,7 +59,7 @@ func Init() (*sys.Arch, ld.Arch) { + Gentext: gentext, + Machoreloc1: machoreloc1, + +- Linuxdynld: "/lib64/ld64.so.1", ++ Linuxdynld: "/lib64/ld-musl-mips64le.so.1", + Freebsddynld: "XXX", + Openbsddynld: "XXX", + Netbsddynld: "XXX", +--- a/src/cmd/link/internal/ppc64/obj.go ++++ b/src/cmd/link/internal/ppc64/obj.go +@@ -62,7 +62,7 @@ func Init() (*sys.Arch, ld.Arch) { + Machoreloc1: machoreloc1, + + // TODO(austin): ABI v1 uses /usr/lib/ld.so.1, +- Linuxdynld: "/lib64/ld64.so.1", ++ Linuxdynld: "/lib64/ld-musl-powerpc64le.so.1", + + Freebsddynld: "XXX", + Openbsddynld: "XXX", +--- a/src/cmd/link/internal/s390x/obj.go ++++ b/src/cmd/link/internal/s390x/obj.go +@@ -57,7 +57,7 @@ func Init() (*sys.Arch, ld.Arch) { + Gentext: gentext, + Machoreloc1: machoreloc1, + +- Linuxdynld: "/lib64/ld64.so.1", ++ Linuxdynld: "/lib64/ld-musl-s390x.so.1", + + // not relevant for s390x + Freebsddynld: "XXX", +--- a/src/cmd/link/internal/x86/obj.go ++++ b/src/cmd/link/internal/x86/obj.go +@@ -58,7 +58,7 @@ func Init() (*sys.Arch, ld.Arch) { + Machoreloc1: machoreloc1, + PEreloc1: pereloc1, + +- Linuxdynld: "/lib/ld-linux.so.2", ++ Linuxdynld: "/lib/ld-musl-i386.so.1", + Freebsddynld: "/usr/libexec/ld-elf.so.1", + Openbsddynld: "/usr/libexec/ld.so", + Netbsddynld: "/usr/libexec/ld.elf_so", diff --git a/meta/recipes-devtools/go/go-common.inc b/meta/recipes-devtools/go/go-common.inc index 11d55c4d36..93a3d3b5fb 100644 --- a/meta/recipes-devtools/go/go-common.inc +++ b/meta/recipes-devtools/go/go-common.inc @@ -25,7 +25,6 @@ SSTATE_SCAN_CMD = "true" export GOROOT_OVERRIDE = "1" export GOTMPDIR ?= "${WORKDIR}/go-tmp" GOTMPDIR[vardepvalue] = "" -export GOCACHE = "off" export CGO_ENABLED = "1" do_compile_prepend() { diff --git a/meta/recipes-devtools/go/go-cross-canadian_1.12.bb b/meta/recipes-devtools/go/go-cross-canadian_1.12.bb new file mode 100644 index 0000000000..7ac9449e47 --- /dev/null +++ b/meta/recipes-devtools/go/go-cross-canadian_1.12.bb @@ -0,0 +1,2 @@ +require go-cross-canadian.inc +require go-${PV}.inc diff --git a/meta/recipes-devtools/go/go-cross.inc b/meta/recipes-devtools/go/go-cross.inc index 6d9aa5c2dd..29ce7f6e84 100644 --- a/meta/recipes-devtools/go/go-cross.inc +++ b/meta/recipes-devtools/go/go-cross.inc @@ -14,7 +14,6 @@ export GO386 = "${TARGET_GO386}" export GOMIPS = "${TARGET_GOMIPS}" export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go" export GOROOT_FINAL = "${libdir}/go" -export GOCACHE = "off" CC = "${@d.getVar('BUILD_CC').strip()}" do_configure[noexec] = "1" diff --git a/meta/recipes-devtools/go/go-cross_1.12.bb b/meta/recipes-devtools/go/go-cross_1.12.bb new file mode 100644 index 0000000000..80b5a03f6c --- /dev/null +++ b/meta/recipes-devtools/go/go-cross_1.12.bb @@ -0,0 +1,2 @@ +require go-cross.inc +require go-${PV}.inc diff --git a/meta/recipes-devtools/go/go-crosssdk_1.12.bb b/meta/recipes-devtools/go/go-crosssdk_1.12.bb new file mode 100644 index 0000000000..1857c8a577 --- /dev/null +++ b/meta/recipes-devtools/go/go-crosssdk_1.12.bb @@ -0,0 +1,2 @@ +require go-crosssdk.inc +require go-${PV}.inc diff --git a/meta/recipes-devtools/go/go-native_1.12.bb b/meta/recipes-devtools/go/go-native_1.12.bb new file mode 100644 index 0000000000..bbf3c0dd73 --- /dev/null +++ b/meta/recipes-devtools/go/go-native_1.12.bb @@ -0,0 +1,2 @@ +require ${PN}.inc +require go-${PV}.inc diff --git a/meta/recipes-devtools/go/go-runtime_1.12.bb b/meta/recipes-devtools/go/go-runtime_1.12.bb new file mode 100644 index 0000000000..43b68b4e46 --- /dev/null +++ b/meta/recipes-devtools/go/go-runtime_1.12.bb @@ -0,0 +1,2 @@ +require go-${PV}.inc +require go-runtime.inc diff --git a/meta/recipes-devtools/go/go_1.12.bb b/meta/recipes-devtools/go/go_1.12.bb new file mode 100644 index 0000000000..42cdb0430a --- /dev/null +++ b/meta/recipes-devtools/go/go_1.12.bb @@ -0,0 +1,14 @@ +require go-${PV}.inc +require go-target.inc + +export GOBUILDMODE="" + +# Add pie to GOBUILDMODE to satisfy "textrel" QA checking, but mips +# doesn't support -buildmode=pie, so skip the QA checking for mips and its +# variants. +python() { + if 'mips' in d.getVar('TARGET_ARCH'): + d.appendVar('INSANE_SKIP_%s' % d.getVar('PN'), " textrel") + else: + d.setVar('GOBUILDMODE', 'pie') +} From patchwork Thu Mar 7 21:42:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 159935 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp7940180jad; Thu, 7 Mar 2019 13:43:20 -0800 (PST) X-Google-Smtp-Source: APXvYqzi+SLn8fH3Nm9P8iyeiUIPD4FSxtqU2EwYyH035LXBc0+K8PjyjsI458LXZmlY4menpYrw X-Received: by 2002:a17:902:744b:: with SMTP id e11mr15015206plt.220.1551995000420; Thu, 07 Mar 2019 13:43:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551995000; cv=none; d=google.com; s=arc-20160816; b=ap3QlH/b8A7Xa2KBWRs+qXTHyRKsMHaFIh9RxWuGv0MMmgY+DgpLV9qAGBOFbsdGzf cgqCs+e49ooeyocmYQohDebLHSW+scNRUmkrDFh4o5LbCOJUiqBIxkBPRT9CibAp3Hgr 2wZovLQaRupKqKKpb36rex5GHo81Y8jr9jWSZJbiyMbDh+TLa8ZN1G9+srkbpaSb7tvN IC3j54puLmqrroiQUsx4NSm25t5a1UQsU1a9QCrtl1hpH4+XUsJzVatxZU1a2EwbO4AQ 63I9b2ATbyZVTuZ8U5eVMSV2rPwJmCVIOfJG35KMWJ6HRqnL8E6SVXdEC8xEnT74rLsK SXsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:delivered-to; bh=60uYnYrmJ0Y8ftQANa6HVOfvrHqhgdFPG2nBkv9QXSo=; b=QnuCc9MKQq8UdtGxHP4FcJKChGQk0Ws1FTs4Fc94q15zMExb0763pVvIqmw6uzTVOU as/tEq/5SSuRsU3j0p2oeTQH5hEObEwj33Grcru0RnPaL2AyidlSEyla20Y+VbT9VrjK ugQDDAD3kn0ImpGQR1EuDySlpuhtZ2CBF89XVcaeB/oX2wJIafQPhr9T9+Fu1gvwZc7p LEew+I5YXliFuBx12RDiqNO1ICw8FQczYh545twFqVgMk4xp5LjSh3R3VQCayb7cJpK6 8HTAjKdQFaI30z9hGf6aHjMN/16ywg7gYbkBEN0L1SK2enLPQf2rc1zbYU8++TDjvVpy 4mew== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=poAxqBvA; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id k63si4746195pgd.26.2019.03.07.13.43.20; Thu, 07 Mar 2019 13:43:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=poAxqBvA; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from ec2-34-214-78-129.us-west-2.compute.amazonaws.com (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 292387CF21; Thu, 7 Mar 2019 21:43:18 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) by mail.openembedded.org (Postfix) with ESMTP id E48477CF14 for ; Thu, 7 Mar 2019 21:42:49 +0000 (UTC) Received: by mail-pf1-f195.google.com with SMTP id s22so12466321pfh.4 for ; Thu, 07 Mar 2019 13:42:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HA62kIT/3IpCc1gjJny0Un13Nh1wK3bHvo+B26FBQB0=; b=poAxqBvAUC6067xMDj3lkWtEH7Pxc6GIjxRnZUwp+cLeMDLou8jsaSHquIiKoyKOvf RYJnB8OxxlT1oWFUZY7QUiZWzkD6GoiB+xh6YPyZTSUES2Tv7LbzvjXbzeKwBza3rxyk HAEJ/Q85gIHltMuF22C80VdnQpIxCJRmkiRO3kE7zue+8n1JxVfQpyS9sxGlFzgO6BSR r4UlGZBpwxo+HBp5E3P2fLLSIA/2LsGrVtg4D1iWv6QdiinCTMEw7gxGDDSOC6c9KVAz RgE+3z8vQEMtXZjbjaAUxHwJtlOiHWM+lKoetrfFEEpQC2wNmKSQpsS18ZrzIZOEMssz NQyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=HA62kIT/3IpCc1gjJny0Un13Nh1wK3bHvo+B26FBQB0=; b=L7RWUwDU9yqJc04VrHu+iuLamxphiIJtCu2dEvNk0mbgakMXBPTijJuNIqR0JU+vMd H0driBHVUUz5gRDxQbT5IoLvBqeJJKD/3KpA0sn5bpI7u3JvbSN1y+IkHFpqM2+e4rZ4 /GZ34p3vvHcNJKbarFy8WHjT3AyqNXZr/QHjfbHddNvJUq3DIulXjkkTGPwR/F1wBc/m WsL5G+VIJt5Epil3ebB0tKl2N43wcdeUr5tGSCGrQpWiivD7TvomdXf1G/GNvYv4BUVn Q3sKFDIsMKxuA48AwCJHPdebFDZ5MKqXQi4daA1eZquCycaLwqeL/pXsT/d+0uBmYqlu FSPA== X-Gm-Message-State: APjAAAV4oZeXcUS6fme0PwT6SmNehjQfGkq+XR6NqC9O1ivwaCxC10bu Ih27B9uaBou63kz7zxLL8Khxku1J X-Received: by 2002:a17:902:7e0f:: with SMTP id b15mr14392957plm.124.1551994970278; Thu, 07 Mar 2019 13:42:50 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:8500:6bc6::3401]) by smtp.gmail.com with ESMTPSA id v186sm16043043pfv.184.2019.03.07.13.42.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Mar 2019 13:42:49 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Date: Thu, 7 Mar 2019 13:42:42 -0800 Message-Id: <20190307214242.37072-2-raj.khem@gmail.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190307214242.37072-1-raj.khem@gmail.com> References: <20190307214242.37072-1-raj.khem@gmail.com> MIME-Version: 1.0 Cc: Avelino , Rob Pike Subject: [OE-core] [PATCH V2 2/2] go-1.9: Drop the recipes X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org We now have 1.11 and 1.12 Signed-off-by: Khem Raj --- v2: Rebased ( no changes ) .../0001-make.bash-quote-CC_FOR_TARGET.patch | 32 ----- ...d-CXX-environment-variable-construct.patch | 67 ----------- ...tter-separate-host-and-target-builds.patch | 92 --------------- ...OOLDIR-to-be-overridden-in-the-envir.patch | 68 ----------- ...d-go-make-GOROOT-precious-by-default.patch | 41 ------- ...TOOLDIR_BOOTSTRAP-environment-variab.patch | 36 ------ ...7-ld-add-soname-to-shareable-objects.patch | 46 -------- ...HOSTxx-indirection-for-cross-canadia.patch | 33 ------ ...-pie-forces-external-linking-mode-on.patch | 47 -------- ...de-CC-when-building-dist-and-go_boot.patch | 43 ------- ...011-use-GOBUILDMODE-to-set-buildmode.patch | 40 ------- .../go/go-1.9/set-external-linker.patch | 111 ------------------ 12 files changed, 656 deletions(-) delete mode 100644 meta/recipes-devtools/go/go-1.9/0001-make.bash-quote-CC_FOR_TARGET.patch delete mode 100644 meta/recipes-devtools/go/go-1.9/0002-cmd-go-fix-CC-and-CXX-environment-variable-construct.patch delete mode 100644 meta/recipes-devtools/go/go-1.9/0003-make.bash-better-separate-host-and-target-builds.patch delete mode 100644 meta/recipes-devtools/go/go-1.9/0004-cmd-go-allow-GOTOOLDIR-to-be-overridden-in-the-envir.patch delete mode 100644 meta/recipes-devtools/go/go-1.9/0005-cmd-go-make-GOROOT-precious-by-default.patch delete mode 100644 meta/recipes-devtools/go/go-1.9/0006-make.bash-add-GOTOOLDIR_BOOTSTRAP-environment-variab.patch delete mode 100644 meta/recipes-devtools/go/go-1.9/0007-ld-add-soname-to-shareable-objects.patch delete mode 100644 meta/recipes-devtools/go/go-1.9/0008-make.bash-add-GOHOSTxx-indirection-for-cross-canadia.patch delete mode 100644 meta/recipes-devtools/go/go-1.9/0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch delete mode 100644 meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch delete mode 100644 meta/recipes-devtools/go/go-1.9/0011-use-GOBUILDMODE-to-set-buildmode.patch delete mode 100644 meta/recipes-devtools/go/go-1.9/set-external-linker.patch -- 2.21.0 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/recipes-devtools/go/go-1.9/0001-make.bash-quote-CC_FOR_TARGET.patch b/meta/recipes-devtools/go/go-1.9/0001-make.bash-quote-CC_FOR_TARGET.patch deleted file mode 100644 index 7800975e48..0000000000 --- a/meta/recipes-devtools/go/go-1.9/0001-make.bash-quote-CC_FOR_TARGET.patch +++ /dev/null @@ -1,32 +0,0 @@ -From d24734ad44006791fd48fc45ea34fe608ff672fb Mon Sep 17 00:00:00 2001 -From: Matt Madison -Date: Wed, 13 Sep 2017 08:04:23 -0700 -Subject: [PATCH 1/7] make.bash: quote CC_FOR_TARGET - -For OE cross-builds, $CC_FOR_TARGET has more than -one word and needs to be quoted. - -Upstream-Status: Pending - -Signed-off-by: Khem Raj -Signed-off-by: Matt Madison ---- - src/make.bash | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/make.bash b/src/make.bash -index 71e7531..dcf3256 100755 ---- a/src/make.bash -+++ b/src/make.bash -@@ -175,7 +175,7 @@ echo "##### Building packages and commands for $GOOS/$GOARCH." - - old_bin_files=$(cd $GOROOT/bin && echo *) - --CC=$CC_FOR_TARGET "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd -+CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd - - # Check that there are no new files in $GOROOT/bin other than go and gofmt - # and $GOOS_$GOARCH (a directory used when cross-compiling). --- -2.7.4 - diff --git a/meta/recipes-devtools/go/go-1.9/0002-cmd-go-fix-CC-and-CXX-environment-variable-construct.patch b/meta/recipes-devtools/go/go-1.9/0002-cmd-go-fix-CC-and-CXX-environment-variable-construct.patch deleted file mode 100644 index a4e42261c3..0000000000 --- a/meta/recipes-devtools/go/go-1.9/0002-cmd-go-fix-CC-and-CXX-environment-variable-construct.patch +++ /dev/null @@ -1,67 +0,0 @@ -From a7170d32a13aead608abd18996f6dab2e2a631b5 Mon Sep 17 00:00:00 2001 -From: Matt Madison -Date: Wed, 13 Sep 2017 08:06:37 -0700 -Subject: [PATCH 2/7] cmd/go: fix CC and CXX environment variable construction - -For OE cross-builds, CC and CXX have multiple words, and -we need their complete definitions when setting up the -environment during Go builds. - -Upstream-Status: Pending - -Signed-off-by: Khem Raj -Signed-off-by: Matt Madison ---- - src/cmd/go/internal/envcmd/env.go | 4 ++-- - src/cmd/go/internal/work/build.go | 12 ++++++++++++ - 2 files changed, 14 insertions(+), 2 deletions(-) - -diff --git a/src/cmd/go/internal/envcmd/env.go b/src/cmd/go/internal/envcmd/env.go -index 43d4334..529d21d 100644 ---- a/src/cmd/go/internal/envcmd/env.go -+++ b/src/cmd/go/internal/envcmd/env.go -@@ -74,10 +74,10 @@ func MkEnv() []cfg.EnvVar { - } - - cmd := b.GccCmd(".") -- env = append(env, cfg.EnvVar{Name: "CC", Value: cmd[0]}) -+ env = append(env, cfg.EnvVar{Name: "CC", Value: strings.Join(b.GccCmdForReal(), " ")}) - env = append(env, cfg.EnvVar{Name: "GOGCCFLAGS", Value: strings.Join(cmd[3:], " ")}) - cmd = b.GxxCmd(".") -- env = append(env, cfg.EnvVar{Name: "CXX", Value: cmd[0]}) -+ env = append(env, cfg.EnvVar{Name: "CXX", Value: strings.Join(b.GxxCmdForReal(), " ")}) - - if cfg.BuildContext.CgoEnabled { - env = append(env, cfg.EnvVar{Name: "CGO_ENABLED", Value: "1"}) -diff --git a/src/cmd/go/internal/work/build.go b/src/cmd/go/internal/work/build.go -index 7d667ff..85df0b3 100644 ---- a/src/cmd/go/internal/work/build.go -+++ b/src/cmd/go/internal/work/build.go -@@ -3127,12 +3127,24 @@ func (b *Builder) GccCmd(objdir string) []string { - return b.ccompilerCmd("CC", cfg.DefaultCC, objdir) - } - -+// gccCmd returns a gcc command line prefix -+// defaultCC is defined in zdefaultcc.go, written by cmd/dist. -+func (b *Builder) GccCmdForReal() []string { -+ return envList("CC", cfg.DefaultCC) -+} -+ - // gxxCmd returns a g++ command line prefix - // defaultCXX is defined in zdefaultcc.go, written by cmd/dist. - func (b *Builder) GxxCmd(objdir string) []string { - return b.ccompilerCmd("CXX", cfg.DefaultCXX, objdir) - } - -+// gxxCmd returns a g++ command line prefix -+// defaultCXX is defined in zdefaultcc.go, written by cmd/dist. -+func (b *Builder) GxxCmdForReal() []string { -+ return envList("CXX", cfg.DefaultCXX) -+} -+ - // gfortranCmd returns a gfortran command line prefix. - func (b *Builder) gfortranCmd(objdir string) []string { - return b.ccompilerCmd("FC", "gfortran", objdir) --- -2.7.4 - diff --git a/meta/recipes-devtools/go/go-1.9/0003-make.bash-better-separate-host-and-target-builds.patch b/meta/recipes-devtools/go/go-1.9/0003-make.bash-better-separate-host-and-target-builds.patch deleted file mode 100644 index ffd9f2359c..0000000000 --- a/meta/recipes-devtools/go/go-1.9/0003-make.bash-better-separate-host-and-target-builds.patch +++ /dev/null @@ -1,92 +0,0 @@ -From 31e88f06af7ab787d8fe0c1ca625193e1799e167 Mon Sep 17 00:00:00 2001 -From: Matt Madison -Date: Wed, 13 Sep 2017 08:12:04 -0700 -Subject: [PATCH 3/7] make.bash: better separate host and target builds - -Fore OE cross-builds, the simple checks in make.bash are -insufficient for distinguishing host and target build -environments, so add some options for telling the -script which parts are being built. - -Upstream-Status: Pending - -Signed-off-by: Khem Raj -Signed-off-by: Matt Madison ---- - src/make.bash | 51 ++++++++++++++++++++++++++++----------------------- - 1 file changed, 28 insertions(+), 23 deletions(-) - -diff --git a/src/make.bash b/src/make.bash -index dcf3256..9553623 100755 ---- a/src/make.bash -+++ b/src/make.bash -@@ -156,13 +156,22 @@ if [ "$1" = "--no-clean" ]; then - buildall="" - shift - fi --./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap -+do_host_build="yes" -+do_target_build="yes" -+if [ "$1" = "--target-only" ]; then -+ do_host_build="no" -+ shift -+elif [ "$1" = "--host-only" ]; then -+ do_target_build="no" -+ shift -+fi - --# Delay move of dist tool to now, because bootstrap may clear tool directory. --mv cmd/dist/dist "$GOTOOLDIR"/dist --echo -+if [ "$do_host_build" = "yes" ]; then -+ ./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap -+ # Delay move of dist tool to now, because bootstrap may clear tool directory. -+ mv cmd/dist/dist "$GOTOOLDIR"/dist -+ echo - --if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOHOSTOS" != "$GOOS" ]; then - echo "##### Building packages and commands for host, $GOHOSTOS/$GOHOSTARCH." - # CC_FOR_TARGET is recorded as the default compiler for the go tool. When building for the host, however, - # use the host compiler, CC, from `cmd/dist/dist env` instead. -@@ -171,24 +180,20 @@ if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOHOSTOS" != "$GOOS" ]; then - echo - fi - --echo "##### Building packages and commands for $GOOS/$GOARCH." -- --old_bin_files=$(cd $GOROOT/bin && echo *) -- --CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd -- --# Check that there are no new files in $GOROOT/bin other than go and gofmt --# and $GOOS_$GOARCH (a directory used when cross-compiling). --(cd $GOROOT/bin && for f in *; do -- if ! expr " $old_bin_files go gofmt ${GOOS}_${GOARCH} " : ".* $f " >/dev/null 2>/dev/null; then -- echo 1>&2 "ERROR: unexpected new file in $GOROOT/bin: $f" -- exit 1 -- fi --done) -- --echo -- --rm -f "$GOTOOLDIR"/go_bootstrap -+if [ "$do_target_build" = "yes" ]; then -+ GO_INSTALL="${GO_TARGET_INSTALL:-std cmd}" -+ echo "##### Building packages and commands for $GOOS/$GOARCH." -+ if [ "$GOHOSTOS" = "$GOOS" -a "$GOHOSTARCH" = "$GOARCH" -a "$do_host_build" = "yes" ]; then -+ rm -rf ./host-tools -+ mkdir ./host-tools -+ mv "$GOTOOLDIR"/* ./host-tools -+ GOTOOLDIR="$PWD/host-tools" -+ fi -+ GOTOOLDIR="$GOTOOLDIR" CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v ${GO_INSTALL} -+ echo -+ -+ rm -f "$GOTOOLDIR"/go_bootstrap -+fi - - if [ "$1" != "--no-banner" ]; then - "$GOTOOLDIR"/dist banner --- -2.7.4 - diff --git a/meta/recipes-devtools/go/go-1.9/0004-cmd-go-allow-GOTOOLDIR-to-be-overridden-in-the-envir.patch b/meta/recipes-devtools/go/go-1.9/0004-cmd-go-allow-GOTOOLDIR-to-be-overridden-in-the-envir.patch deleted file mode 100644 index 180b06a4d3..0000000000 --- a/meta/recipes-devtools/go/go-1.9/0004-cmd-go-allow-GOTOOLDIR-to-be-overridden-in-the-envir.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 1369178b497b12088ec4c2794606cc9f14cc327c Mon Sep 17 00:00:00 2001 -From: Matt Madison -Date: Wed, 13 Sep 2017 08:15:03 -0700 -Subject: [PATCH 4/7] cmd/go: allow GOTOOLDIR to be overridden in the - environment - -For OE cross-builds, host-side tools reside in the native -GOROOT, not the target GOROOT. Allow GOTOOLDIR to be set -in the environment to allow that split, rather than always -computing GOTOOLDIR relative to the GOROOT setting. - -Upstream-Status: Pending - -Signed-off-by: Khem Raj -Signed-off-by: Matt Madison ---- - src/cmd/go/internal/cfg/cfg.go | 7 ++++++- - src/cmd/go/internal/work/build.go | 2 +- - src/go/build/build.go | 2 +- - 3 files changed, 8 insertions(+), 3 deletions(-) - -diff --git a/src/cmd/go/internal/cfg/cfg.go b/src/cmd/go/internal/cfg/cfg.go -index b3ad1ce..c1dc974 100644 ---- a/src/cmd/go/internal/cfg/cfg.go -+++ b/src/cmd/go/internal/cfg/cfg.go -@@ -91,7 +91,12 @@ func init() { - // as the tool directory does not move based on environment variables. - // This matches the initialization of ToolDir in go/build, - // except for using GOROOT rather than runtime.GOROOT(). -- build.ToolDir = filepath.Join(GOROOT, "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH) -+ s := os.Getenv("GOTOOLDIR") -+ if s == "" { -+ build.ToolDir = filepath.Join(GOROOT, "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH) -+ } else { -+ build.ToolDir = s -+ } - } - - func findGOROOT() string { -diff --git a/src/cmd/go/internal/work/build.go b/src/cmd/go/internal/work/build.go -index 85df0b3..7b9a69e 100644 ---- a/src/cmd/go/internal/work/build.go -+++ b/src/cmd/go/internal/work/build.go -@@ -1337,7 +1337,7 @@ func (b *Builder) build(a *Action) (err error) { - } - - var cgoExe string -- if a.cgo != nil && a.cgo.Target != "" { -+ if a.cgo != nil && a.cgo.Target != "" && os.Getenv("GOTOOLDIR") == "" { - cgoExe = a.cgo.Target - } else { - cgoExe = base.Tool("cgo") -diff --git a/src/go/build/build.go b/src/go/build/build.go -index fd89871..e16145b 100644 ---- a/src/go/build/build.go -+++ b/src/go/build/build.go -@@ -1588,7 +1588,7 @@ func init() { - } - - // ToolDir is the directory containing build tools. --var ToolDir = filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH) -+var ToolDir = envOr("GOTOOLDIR", filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)) - - // IsLocalImport reports whether the import path is - // a local import path, like ".", "..", "./foo", or "../foo". --- -2.7.4 - diff --git a/meta/recipes-devtools/go/go-1.9/0005-cmd-go-make-GOROOT-precious-by-default.patch b/meta/recipes-devtools/go/go-1.9/0005-cmd-go-make-GOROOT-precious-by-default.patch deleted file mode 100644 index 6e93bcb6ce..0000000000 --- a/meta/recipes-devtools/go/go-1.9/0005-cmd-go-make-GOROOT-precious-by-default.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 44f961975dac6cf464a77b5f6dd0c47cc192c4fd Mon Sep 17 00:00:00 2001 -From: Matt Madison -Date: Wed, 13 Sep 2017 08:19:52 -0700 -Subject: [PATCH 5/7] cmd/go: make GOROOT precious by default - -For OE builds, we never want packages that have -already been installed into the build root to be -modified, so prevent the go build tool from checking -if they should be rebuilt. - -Also add an environment variable to override this -behavior, just for building the Go runtime. - -Upstream-Status: Pending - -Signed-off-by: Matt Madison ---- - src/cmd/go/internal/load/pkg.go | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/src/cmd/go/internal/load/pkg.go b/src/cmd/go/internal/load/pkg.go -index 60de666..2660d3f 100644 ---- a/src/cmd/go/internal/load/pkg.go -+++ b/src/cmd/go/internal/load/pkg.go -@@ -1530,6 +1530,13 @@ func isStale(p *Package) (bool, string) { - return true, "build ID mismatch" - } - -+ // For OE builds, make anything in GOROOT non-stale, -+ // to prevent a package build from overwriting the -+ // build root. -+ if p.Goroot && os.Getenv("GOROOT_OVERRIDE") != "1" { -+ return false, "GOROOT-resident packages do not get rebuilt" -+ } -+ - // Package is stale if a dependency is. - for _, p1 := range p.Internal.Deps { - if p1.Stale { --- -2.7.4 - diff --git a/meta/recipes-devtools/go/go-1.9/0006-make.bash-add-GOTOOLDIR_BOOTSTRAP-environment-variab.patch b/meta/recipes-devtools/go/go-1.9/0006-make.bash-add-GOTOOLDIR_BOOTSTRAP-environment-variab.patch deleted file mode 100644 index f0f564044b..0000000000 --- a/meta/recipes-devtools/go/go-1.9/0006-make.bash-add-GOTOOLDIR_BOOTSTRAP-environment-variab.patch +++ /dev/null @@ -1,36 +0,0 @@ -From aae74d1045ca03306ba4159206ee3bac72bcdfbb Mon Sep 17 00:00:00 2001 -From: Matt Madison -Date: Wed, 13 Sep 2017 08:23:23 -0700 -Subject: [PATCH 6/7] make.bash: add GOTOOLDIR_BOOTSTRAP environment variable - -For cross-canadian builds, we need to use the native -GOTOOLDIR during the bootstrap phase, so provide a way -to pass that setting into the build script. - -Upstream-Status: Pending - -Signed-off-by: Matt Madison ---- - src/make.bash | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/src/make.bash b/src/make.bash -index 9553623..2e6fb05 100755 ---- a/src/make.bash -+++ b/src/make.bash -@@ -172,10 +172,11 @@ if [ "$do_host_build" = "yes" ]; then - mv cmd/dist/dist "$GOTOOLDIR"/dist - echo - -+ GOTOOLDIR_BOOTSTRAP="${GOTOOLDIR_BOOTSTRAP:-$GOTOOLDIR}" - echo "##### Building packages and commands for host, $GOHOSTOS/$GOHOSTARCH." - # CC_FOR_TARGET is recorded as the default compiler for the go tool. When building for the host, however, - # use the host compiler, CC, from `cmd/dist/dist env` instead. -- CC=$CC GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH \ -+ CC=$CC GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH GOTOOLDIR="$GOTOOLDIR_BOOTSTRAP" \ - "$GOTOOLDIR"/go_bootstrap install -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd - echo - fi --- -2.7.4 - diff --git a/meta/recipes-devtools/go/go-1.9/0007-ld-add-soname-to-shareable-objects.patch b/meta/recipes-devtools/go/go-1.9/0007-ld-add-soname-to-shareable-objects.patch deleted file mode 100644 index 6459782d81..0000000000 --- a/meta/recipes-devtools/go/go-1.9/0007-ld-add-soname-to-shareable-objects.patch +++ /dev/null @@ -1,46 +0,0 @@ -From e957c3458d53e37bf416f51d2f8bf54c195e50f5 Mon Sep 17 00:00:00 2001 -From: Matt Madison -Date: Wed, 13 Sep 2017 08:27:02 -0700 -Subject: [PATCH 7/7] ld: add soname to shareable objects - -Shared library handling in OE depends on the inclusion -of an soname header, so update the go linker to add that -header for both internal and external linking. - -Upstream-Status: Pending - -Signed-off-by: Matt Madison ---- - src/cmd/link/internal/ld/lib.go | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go -index 0234105..0b9e2d0 100644 ---- a/src/cmd/link/internal/ld/lib.go -+++ b/src/cmd/link/internal/ld/lib.go -@@ -1124,12 +1124,14 @@ func (l *Link) hostlink() { - // Pass -z nodelete to mark the shared library as - // non-closeable: a dlclose will do nothing. - argv = append(argv, "-shared", "-Wl,-z,nodelete") -+ argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile))) - } - case BuildmodeShared: - if UseRelro() { - argv = append(argv, "-Wl,-z,relro") - } - argv = append(argv, "-shared") -+ argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile))) - case BuildmodePlugin: - if Headtype == objabi.Hdarwin { - argv = append(argv, "-dynamiclib") -@@ -1138,6 +1140,7 @@ func (l *Link) hostlink() { - argv = append(argv, "-Wl,-z,relro") - } - argv = append(argv, "-shared") -+ argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile))) - } - } - --- -2.7.4 - diff --git a/meta/recipes-devtools/go/go-1.9/0008-make.bash-add-GOHOSTxx-indirection-for-cross-canadia.patch b/meta/recipes-devtools/go/go-1.9/0008-make.bash-add-GOHOSTxx-indirection-for-cross-canadia.patch deleted file mode 100644 index 0977c78350..0000000000 --- a/meta/recipes-devtools/go/go-1.9/0008-make.bash-add-GOHOSTxx-indirection-for-cross-canadia.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 03e6c339d4fb712fbb8c4ca6ef2fc7100dcdb3d7 Mon Sep 17 00:00:00 2001 -From: Matt Madison -Date: Thu, 14 Sep 2017 05:38:10 -0700 -Subject: [PATCH 8/8] make.bash: add GOHOSTxx indirection for cross-canadian - builds - -Add environment variables for specifying the host OS/arch -that we are building the compiler for, so it can differ from -the build host OS/arch. - -Upstream-Status: Pending - -Signed-off-by: Matt Madison ---- - src/make.bash | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/src/make.bash b/src/make.bash -index 2e6fb05..0bdadc6 100755 ---- a/src/make.bash -+++ b/src/make.bash -@@ -173,6 +173,8 @@ if [ "$do_host_build" = "yes" ]; then - echo - - GOTOOLDIR_BOOTSTRAP="${GOTOOLDIR_BOOTSTRAP:-$GOTOOLDIR}" -+ GOHOSTOS="${GOHOSTOS_CROSS:-$GOHOSTOS}" -+ GOHOSTARCH="${GOHOSTARCH_CROSS:-$GOHOSTARCH}" - echo "##### Building packages and commands for host, $GOHOSTOS/$GOHOSTARCH." - # CC_FOR_TARGET is recorded as the default compiler for the go tool. When building for the host, however, - # use the host compiler, CC, from `cmd/dist/dist env` instead. --- -2.7.4 - diff --git a/meta/recipes-devtools/go/go-1.9/0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch b/meta/recipes-devtools/go/go-1.9/0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch deleted file mode 100644 index aa5fcfdd23..0000000000 --- a/meta/recipes-devtools/go/go-1.9/0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch +++ /dev/null @@ -1,47 +0,0 @@ -From aae44527c8065d54f6acaf87c82cba1ac96fae59 Mon Sep 17 00:00:00 2001 -From: Ian Lance Taylor -Date: Fri, 18 Aug 2017 17:46:03 -0700 -Subject: [PATCH] cmd/go: -buildmode=pie forces external linking mode on all - systems - -The go tool assumed that -buildmode=pie implied internal linking on -linux-amd64. However, that was changed by CL 36417 for issue #18968. - -Fixes #21452 - -Change-Id: I8ed13aea52959cc5c53223f4c41ba35329445545 -Reviewed-on: https://go-review.googlesource.com/57231 -Run-TryBot: Ian Lance Taylor -TryBot-Result: Gobot Gobot -Reviewed-by: Avelino -Reviewed-by: Rob Pike ---- -Upstream-Status: Backport -Signed-off-by: Khem Raj - - src/cmd/go/internal/load/pkg.go | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -diff --git a/src/cmd/go/internal/load/pkg.go b/src/cmd/go/internal/load/pkg.go -index 2660d3f..d40773b 100644 ---- a/src/cmd/go/internal/load/pkg.go -+++ b/src/cmd/go/internal/load/pkg.go -@@ -954,11 +954,12 @@ func (p *Package) load(stk *ImportStack, bp *build.Package, err error) *Package - - if cfg.BuildContext.CgoEnabled && p.Name == "main" && !p.Goroot { - // Currently build modes c-shared, pie (on systems that do not -- // support PIE with internal linking mode), plugin, and -- // -linkshared force external linking mode, as of course does -+ // support PIE with internal linking mode (currently all -+ // systems: issue #18968)), plugin, and -linkshared force -+ // external linking mode, as of course does - // -ldflags=-linkmode=external. External linking mode forces - // an import of runtime/cgo. -- pieCgo := cfg.BuildBuildmode == "pie" && (cfg.BuildContext.GOOS != "linux" || cfg.BuildContext.GOARCH != "amd64") -+ pieCgo := cfg.BuildBuildmode == "pie" - linkmodeExternal := false - for i, a := range cfg.BuildLdflags { - if a == "-linkmode=external" { --- -2.14.1 - diff --git a/meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch b/meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch deleted file mode 100644 index 83fd78c3d7..0000000000 --- a/meta/recipes-devtools/go/go-1.9/0010-make.bash-override-CC-when-building-dist-and-go_boot.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 21d83dd9499e5be30eea28dd7034d1ea2a01c838 Mon Sep 17 00:00:00 2001 -From: Matt Madison -Date: Tue, 14 Nov 2017 07:38:42 -0800 -Subject: [PATCH 10/10] make.bash: override CC when building dist and - go_bootstrap - -For cross-canadian builds, dist and go_bootstrap -run on the build host, so CC needs to point to the -build host's C compiler. Add a BUILD_CC environment -for this, falling back to $CC if not present. - -Upstream-Status: Pending - -Signed-off-by: Matt Madison ---- - src/make.bash | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/make.bash b/src/make.bash -index 0bdadc6..f199349 100755 ---- a/src/make.bash -+++ b/src/make.bash -@@ -131,7 +131,7 @@ if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; then - exit 1 - fi - rm -f cmd/dist/dist --GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist -+CC=${BUILD_CC:-${CC}} GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" "$GOROOT_BOOTSTRAP/bin/go" 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) -@@ -167,7 +167,7 @@ elif [ "$1" = "--host-only" ]; then - fi - - if [ "$do_host_build" = "yes" ]; then -- ./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap -+ CC=${BUILD_CC:-${CC}} ./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap - # Delay move of dist tool to now, because bootstrap may clear tool directory. - mv cmd/dist/dist "$GOTOOLDIR"/dist - echo --- -2.7.4 - diff --git a/meta/recipes-devtools/go/go-1.9/0011-use-GOBUILDMODE-to-set-buildmode.patch b/meta/recipes-devtools/go/go-1.9/0011-use-GOBUILDMODE-to-set-buildmode.patch deleted file mode 100644 index da93dc5c14..0000000000 --- a/meta/recipes-devtools/go/go-1.9/0011-use-GOBUILDMODE-to-set-buildmode.patch +++ /dev/null @@ -1,40 +0,0 @@ -From b928fafab1d9425aae9341806bd2f6178ba1da1f Mon Sep 17 00:00:00 2001 -From: Hongxu Jia -Date: Fri, 26 Oct 2018 16:32:50 +0800 -Subject: [PATCH] use GOBUILDMODE to set buildmode - -While building go itself, the go build system does not support -to set `-buildmode=pie' from environment. - -Add GOBUILDMODE to support it which make PIE executables the default -build mode, as PIE executables are required as of Yocto - -Refers: https://groups.google.com/forum/#!topic/golang-dev/gRCe5URKewI -Upstream-Status: Denied [upstream choose antoher solution: `17a256b -cmd/go: -buildmode=pie for android/arm'] - -Signed-off-by: Hongxu Jia ---- - src/cmd/go/internal/work/build.go | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/src/cmd/go/internal/work/build.go b/src/cmd/go/internal/work/build.go -index b276de5..1683e7e 100644 ---- a/src/cmd/go/internal/work/build.go -+++ b/src/cmd/go/internal/work/build.go -@@ -211,7 +211,11 @@ func AddBuildFlags(cmd *base.Command) { - - cmd.Flag.Var((*base.StringsFlag)(&buildAsmflags), "asmflags", "") - cmd.Flag.Var(buildCompiler{}, "compiler", "") -- cmd.Flag.StringVar(&cfg.BuildBuildmode, "buildmode", "default", "") -+ if bm := os.Getenv("GOBUILDMODE"); bm != "" { -+ cmd.Flag.StringVar(&cfg.BuildBuildmode, "buildmode", bm, "") -+ } else { -+ cmd.Flag.StringVar(&cfg.BuildBuildmode, "buildmode", "default", "") -+ } - cmd.Flag.Var((*base.StringsFlag)(&buildGcflags), "gcflags", "") - cmd.Flag.Var((*base.StringsFlag)(&buildGccgoflags), "gccgoflags", "") - cmd.Flag.StringVar(&cfg.BuildContext.InstallSuffix, "installsuffix", "", "") --- -2.7.4 - diff --git a/meta/recipes-devtools/go/go-1.9/set-external-linker.patch b/meta/recipes-devtools/go/go-1.9/set-external-linker.patch deleted file mode 100644 index d6bd7fa39c..0000000000 --- a/meta/recipes-devtools/go/go-1.9/set-external-linker.patch +++ /dev/null @@ -1,111 +0,0 @@ -Change the dynamic linker hardcoding to use musl when not using glibc -this should be applied conditional to musl being the system C library - -Upstream-Status: Inappropriate [Real Fix should be portable across libcs] - -Signed-off-by: Khem Raj - -Index: go/src/cmd/link/internal/amd64/obj.go -=================================================================== ---- go.orig/src/cmd/link/internal/amd64/obj.go -+++ go/src/cmd/link/internal/amd64/obj.go -@@ -67,7 +67,7 @@ func Init() { - ld.Thearch.Append64 = ld.Append64l - ld.Thearch.TLSIEtoLE = tlsIEtoLE - -- ld.Thearch.Linuxdynld = "/lib64/ld-linux-x86-64.so.2" -+ ld.Thearch.Linuxdynld = "/lib/ld-musl-x86_64.so.1" - ld.Thearch.Freebsddynld = "/libexec/ld-elf.so.1" - ld.Thearch.Openbsddynld = "/usr/libexec/ld.so" - ld.Thearch.Netbsddynld = "/libexec/ld.elf_so" -Index: go/src/cmd/link/internal/arm/obj.go -=================================================================== ---- go.orig/src/cmd/link/internal/arm/obj.go -+++ go/src/cmd/link/internal/arm/obj.go -@@ -63,7 +63,7 @@ func Init() { - ld.Thearch.Append32 = ld.Append32l - ld.Thearch.Append64 = ld.Append64l - -- ld.Thearch.Linuxdynld = "/lib/ld-linux.so.3" // 2 for OABI, 3 for EABI -+ ld.Thearch.Linuxdynld = "/lib/ld-musl-armhf.so.1" - ld.Thearch.Freebsddynld = "/usr/libexec/ld-elf.so.1" - ld.Thearch.Openbsddynld = "/usr/libexec/ld.so" - ld.Thearch.Netbsddynld = "/libexec/ld.elf_so" -Index: go/src/cmd/link/internal/arm64/obj.go -=================================================================== ---- go.orig/src/cmd/link/internal/arm64/obj.go -+++ go/src/cmd/link/internal/arm64/obj.go -@@ -62,7 +62,7 @@ func Init() { - ld.Thearch.Append32 = ld.Append32l - ld.Thearch.Append64 = ld.Append64l - -- ld.Thearch.Linuxdynld = "/lib/ld-linux-aarch64.so.1" -+ ld.Thearch.Linuxdynld = "/lib/ld-musl-aarch64.so.1" - - ld.Thearch.Freebsddynld = "XXX" - ld.Thearch.Openbsddynld = "XXX" -Index: go/src/cmd/link/internal/mips/obj.go -=================================================================== ---- go.orig/src/cmd/link/internal/mips/obj.go -+++ go/src/cmd/link/internal/mips/obj.go -@@ -77,7 +77,7 @@ func Init() { - ld.Thearch.Append64 = ld.Append64b - } - -- ld.Thearch.Linuxdynld = "/lib/ld.so.1" -+ ld.Thearch.Linuxdynld = "/lib/ld-musl-mipsle.so.1" - - ld.Thearch.Freebsddynld = "XXX" - ld.Thearch.Openbsddynld = "XXX" -Index: go/src/cmd/link/internal/mips64/obj.go -=================================================================== ---- go.orig/src/cmd/link/internal/mips64/obj.go -+++ go/src/cmd/link/internal/mips64/obj.go -@@ -75,7 +75,7 @@ func Init() { - ld.Thearch.Append64 = ld.Append64b - } - -- ld.Thearch.Linuxdynld = "/lib64/ld64.so.1" -+ ld.Thearch.Linuxdynld = "/lib64/ld-musl-mips64le.so.1" - - ld.Thearch.Freebsddynld = "XXX" - ld.Thearch.Openbsddynld = "XXX" -Index: go/src/cmd/link/internal/ppc64/obj.go -=================================================================== ---- go.orig/src/cmd/link/internal/ppc64/obj.go -+++ go/src/cmd/link/internal/ppc64/obj.go -@@ -77,7 +77,7 @@ func Init() { - } - - // TODO(austin): ABI v1 uses /usr/lib/ld.so.1 -- ld.Thearch.Linuxdynld = "/lib64/ld64.so.1" -+ ld.Thearch.Linuxdynld = "/lib/ld-musl-powerpc64le.so.1" - - ld.Thearch.Freebsddynld = "XXX" - ld.Thearch.Openbsddynld = "XXX" -Index: go/src/cmd/link/internal/s390x/obj.go -=================================================================== ---- go.orig/src/cmd/link/internal/s390x/obj.go -+++ go/src/cmd/link/internal/s390x/obj.go -@@ -62,7 +62,7 @@ func Init() { - ld.Thearch.Append32 = ld.Append32b - ld.Thearch.Append64 = ld.Append64b - -- ld.Thearch.Linuxdynld = "/lib64/ld64.so.1" -+ ld.Thearch.Linuxdynld = "/lib/ld-musl-s390x.so.1" - - // not relevant for s390x - ld.Thearch.Freebsddynld = "XXX" -Index: go/src/cmd/link/internal/x86/obj.go -=================================================================== ---- go.orig/src/cmd/link/internal/x86/obj.go -+++ go/src/cmd/link/internal/x86/obj.go -@@ -63,7 +63,7 @@ func Init() { - ld.Thearch.Append32 = ld.Append32l - ld.Thearch.Append64 = ld.Append64l - -- ld.Thearch.Linuxdynld = "/lib/ld-linux.so.2" -+ ld.Thearch.Linuxdynld = "/lib/ld-musl-i386.so.1" - ld.Thearch.Freebsddynld = "/usr/libexec/ld-elf.so.1" - ld.Thearch.Openbsddynld = "/usr/libexec/ld.so" - ld.Thearch.Netbsddynld = "/usr/libexec/ld.elf_so"