All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hongxu Jia <hongxu.jia@windriver.com>
To: Martin Jansa <martin.jansa@gmail.com>
Cc: Patches and discussions about the oe-core layer
	<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH] go 1.9/1.11: fix textrel qa warning for non mips arch
Date: Tue, 6 Nov 2018 17:37:24 +0800	[thread overview]
Message-ID: <37874a5c-4f3a-557f-6c18-a7ffa828f7c6@windriver.com> (raw)
In-Reply-To: <CA+chaQes8DkRGNThxJVxJYdUBr0JG7_DteLvsCq1A4SRV-E3bQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 12332 bytes --]

On 2018/11/6 下午4:31, Martin Jansa wrote:
> Hi, there are still textrel QA issues for aarch64 builds:

Hi Martin,

I could not reproduce the issue, and I also do not find it on Yocto 
autobuilder

http://errors.yoctoproject.org/Errors/Search/?query=go%3Ado_package_qa

Would you please provide the reproduce steps or local.conf detail or 
errors link?

//Hongxu

> ERROR: go-1.11.1-r0 do_package_qa: QA Issue: ELF binary '/work/aarch64/go/1.11.1-r0/packages-split/go/usr/lib/go/bin/go' has relocations in .text
> ELF binary '/work/aarch64/go/1.11.1-r0/packages-split/go/usr/lib/go/bin/go' has relocations in .text
> ELF binary '/work/aarch64/go/1.11.1-r0/packages-split/go/usr/lib/go/pkg/tool/linux_arm64/trace' has relocations in .text
> ELF binary '/work/aarch64/go/1.11.1-r0/packages-split/go/usr/lib/go/pkg/tool/linux_arm64/trace' has relocations in .text
> ELF binary '/work/aarch64/go/1.11.1-r0/packages-split/go/usr/lib/go/pkg/tool/linux_arm64/pprof' has relocations in .text
> ELF binary '/work/aarch64/go/1.11.1-r0/packages-split/go/usr/lib/go/pkg/tool/linux_arm64/pprof' has relocations in .text [textrel]
> ERROR: go-1.11.1-r0 do_package_qa: QA run found fatal errors. Please consider fixing them.
> ERROR: go-1.11.1-r0 do_package_qa: Function failed: do_package_qa
>
> On Fri, Oct 26, 2018 at 11:32 AM Hongxu Jia <hongxu.jia@windriver.com 
> <mailto:hongxu.jia@windriver.com>> wrote:
>
>     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
>
>     But mips doesn't support -buildmode=pie, so skip the QA checking for
>     mips and its variants
>
>     Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com
>     <mailto:hongxu.jia@windriver.com>>
>     ---
>      meta/recipes-devtools/go/go-1.11.inc               |  1 +
>      .../0008-use-GOBUILDMODE-to-set-buildmode.patch    | 40
>     ++++++++++++++++++++++
>      meta/recipes-devtools/go/go-1.9.inc                |  1 +
>      .../0011-use-GOBUILDMODE-to-set-buildmode.patch    | 40
>     ++++++++++++++++++++++
>      meta/recipes-devtools/go/go_1.11.bb <http://go_1.11.bb>          
>         | 12 +++++++
>      meta/recipes-devtools/go/go_1.9.bb <http://go_1.9.bb>            
>        | 16 +++++----
>      6 files changed, 104 insertions(+), 6 deletions(-)
>      create mode 100644
>     meta/recipes-devtools/go/go-1.11/0008-use-GOBUILDMODE-to-set-buildmode.patch
>      create mode 100644
>     meta/recipes-devtools/go/go-1.9/0011-use-GOBUILDMODE-to-set-buildmode.patch
>
>     diff --git a/meta/recipes-devtools/go/go-1.11.inc
>     b/meta/recipes-devtools/go/go-1.11.inc
>     index c02e468..d626514 100644
>     --- a/meta/recipes-devtools/go/go-1.11.inc
>     +++ b/meta/recipes-devtools/go/go-1.11.inc
>     @@ -15,6 +15,7 @@ SRC_URI += "\
>      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"
>     diff --git
>     a/meta/recipes-devtools/go/go-1.11/0008-use-GOBUILDMODE-to-set-buildmode.patch
>     b/meta/recipes-devtools/go/go-1.11/0008-use-GOBUILDMODE-to-set-buildmode.patch
>     new file mode 100644
>     index 0000000..88986dc
>     --- /dev/null
>     +++
>     b/meta/recipes-devtools/go/go-1.11/0008-use-GOBUILDMODE-to-set-buildmode.patch
>     @@ -0,0 +1,40 @@
>     +From 0e0c247f0caec23528889ff09d98348cba9028f1 Mon Sep 17 00:00:00
>     2001
>     +From: Hongxu Jia <hongxu.jia@windriver.com
>     <mailto:hongxu.jia@windriver.com>>
>     +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
>     <https://groups.google.com/forum/#!topic/golang-dev/gRCe5URKewI+Upstream-Status>:
>     Deny [upstream choose antoher solution: `17a256b
>     +cmd/go: -buildmode=pie for android/arm']
>     +
>     +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com
>     <mailto:hongxu.jia@windriver.com>>
>     +---
>     + 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 145b875..595d703 100644
>     +--- a/src/cmd/go/internal/work/build.go
>     ++++ b/src/cmd/go/internal/work/build.go
>     +@@ -218,7 +218,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", "", "")
>     +--
>     +2.7.4
>     +
>     diff --git a/meta/recipes-devtools/go/go-1.9.inc
>     b/meta/recipes-devtools/go/go-1.9.inc
>     index 329cee0..ba1eaa0 100644
>     --- a/meta/recipes-devtools/go/go-1.9.inc
>     +++ b/meta/recipes-devtools/go/go-1.9.inc
>     @@ -19,6 +19,7 @@ SRC_URI += "\
>      file://0008-make.bash-add-GOHOSTxx-indirection-for-cross-canadia.patch
>     \
>      file://0009-cmd-go-buildmode-pie-forces-external-linking-mode-on.patch
>     \
>      file://0010-make.bash-override-CC-when-building-dist-and-go_boot.patch
>     \
>     +        file://0011-use-GOBUILDMODE-to-set-buildmode.patch \
>      "
>      SRC_URI_append_libc-musl = " file://set-external-linker.patch"
>
>     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
>     new file mode 100644
>     index 0000000..e69ce06
>     --- /dev/null
>     +++
>     b/meta/recipes-devtools/go/go-1.9/0011-use-GOBUILDMODE-to-set-buildmode.patch
>     @@ -0,0 +1,40 @@
>     +From b928fafab1d9425aae9341806bd2f6178ba1da1f Mon Sep 17 00:00:00
>     2001
>     +From: Hongxu Jia <hongxu.jia@windriver.com
>     <mailto:hongxu.jia@windriver.com>>
>     +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
>     <https://groups.google.com/forum/#!topic/golang-dev/gRCe5URKewI+Upstream-Status>:
>     Deny [upstream choose antoher solution: `17a256b
>     +cmd/go: -buildmode=pie for android/arm']
>     +
>     +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com
>     <mailto:hongxu.jia@windriver.com>>
>     +---
>     + 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.11.bb
>     <http://go_1.11.bb> b/meta/recipes-devtools/go/go_1.11.bb
>     <http://go_1.11.bb>
>     index c67e2cb..ce3b905 100644
>     --- a/meta/recipes-devtools/go/go_1.11.bb <http://go_1.11.bb>
>     +++ b/meta/recipes-devtools/go/go_1.11.bb <http://go_1.11.bb>
>     @@ -1,2 +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.appendVar('GOBUILDMODE', 'pie')
>     +}
>     diff --git a/meta/recipes-devtools/go/go_1.9.bb <http://go_1.9.bb>
>     b/meta/recipes-devtools/go/go_1.9.bb <http://go_1.9.bb>
>     index 7da7897..c5cdfb6 100644
>     --- a/meta/recipes-devtools/go/go_1.9.bb <http://go_1.9.bb>
>     +++ b/meta/recipes-devtools/go/go_1.9.bb <http://go_1.9.bb>
>     @@ -5,6 +5,7 @@ export GO_TARGET_INSTALL = "cmd"
>      export GO_FLAGS = "-a"
>      export CC_FOR_TARGET = "${CC}"
>      export CXX_FOR_TARGET = "${CXX}"
>     +export GOBUILDMODE=""
>
>      do_compile() {
>             export GOBIN="${B}/bin"
>     @@ -16,9 +17,12 @@ do_compile() {
>             cd ${B}
>      }
>
>     -# for aarch64 ends with textrel in ${PN}
>     -# http://errors.yoctoproject.org/Errors/Details/185634/
>     -# ERROR: QA Issue: ELF binary
>     '/work/aarch64-oe-linux/go/1.9.7-r0/packages-split/go/usr/lib/go/bin/go'
>     has relocations in .text
>     -# ELF binary
>     '/work/aarch64-oe-linux/go/1.9.7-r0/packages-split/go/usr/lib/go/pkg/tool/linux_arm64/trace'
>     has relocations in .text
>     -# ELF binary
>     '/work/aarch64-oe-linux/go/1.9.7-r0/packages-split/go/usr/lib/go/pkg/tool/linux_arm64/pprof'
>     has relocations in .text [textrel]
>     -INSANE_SKIP_${PN} += "textrel"
>     +# 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.appendVar('GOBUILDMODE', 'pie')
>     +}
>     -- 
>     2.7.4
>
>     -- 
>     _______________________________________________
>     Openembedded-core mailing list
>     Openembedded-core@lists.openembedded.org
>     <mailto:Openembedded-core@lists.openembedded.org>
>     http://lists.openembedded.org/mailman/listinfo/openembedded-core
>


[-- Attachment #2: Type: text/html, Size: 18769 bytes --]

  reply	other threads:[~2018-11-06  9:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-26  9:42 [PATCH] go 1.9/1.11: fix textrel qa warning for non mips arch Hongxu Jia
2018-10-26 10:03 ` ✗ patchtest: failure for " Patchwork
2018-10-26 11:49 ` [PATCH v2] " Hongxu Jia
2018-10-29  7:52   ` Hongxu Jia
2018-10-29  8:21   ` [PATCH V3] " Hongxu Jia
2018-11-06  8:31 ` [PATCH] " Martin Jansa
2018-11-06  9:37   ` Hongxu Jia [this message]
2018-11-06 12:30   ` Martin Jansa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=37874a5c-4f3a-557f-6c18-a7ffa828f7c6@windriver.com \
    --to=hongxu.jia@windriver.com \
    --cc=martin.jansa@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.