Skip to contentSkip to conversation

go: Drop GOBUILDMODE

PATCH New Khem Raj 1 participant 2 messages Mar 28, 2022

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/2 go: Drop GOBUILDMODE

This is local invention which is no longer needed, pie-mode works good now a days to build go for target

---
 meta/recipes-devtools/go/go-1.18.inc          |  1 -
 ...008-use-GOBUILDMODE-to-set-buildmode.patch | 42 -------------------
 meta/recipes-devtools/go/go_1.18.bb           |  1 -
 3 files changed, 44 deletions(-)
 delete mode 100644 meta/recipes-devtools/go/go-1.18/0008-use-GOBUILDMODE-to-set-buildmode.patch
meta/recipes-devtools/go/go-1.18.inc +0 -1
index c8cc2796ea9..da61e93b1db 100644
@@ -10,7 +10,6 @@ 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 \
     file://0001-exec.go-do-not-write-linker-flags-into-buildids.patch \
     file://0001-src-cmd-dist-buildgo.go-do-not-hardcode-host-compile.patch \
 "
meta/recipes-devtools/go/go-1.18/0008-use-GOBUILDMODE-to-set-buildmode.patch deleted +0 -42

42 lines not on this page · raw message

meta/recipes-devtools/go/go_1.18.bb +0 -1
index 34dc89bb0cc..a492d7e64a1 100644
@@ -3,7 +3,6 @@ require go-target.inc
 
 inherit linuxloader
 
-export GOBUILDMODE=""
 export GO_LDSO = "${@get_linuxloader(d)}"
 export CC_FOR_TARGET = "gcc"
 export CXX_FOR_TARGET = "g++"
Signature · 1 line
2.35.1
author
#1 lore raw

PATCH 2/2 go: Disable pie in cgo for mips

This overcomes the linking errors e.g.
| /usr/lib/go/src/cmd/go/internal/base/base.go:110:(.text+0x60fef8): relocation R_MIPS_26 against a local symbol' cannot be used when making a shared object; recompile with -fPIC | /usr/lib/go/src/cmd/go/internal/base/base.go:110:(.text+0x60ff0c): relocation R_MIPS_HI16 against a local symbol' cannot be used when making a shared object; recompile with -fPIC

---
 meta/recipes-devtools/go/go_1.18.bb | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-devtools/go/go_1.18.bb +2 -0
index a492d7e64a1..98977673ee4 100644
@@ -3,6 +3,8 @@ require go-target.inc
 
 inherit linuxloader
 
+CGO_LDFLAGS:append:mips = " -no-pie"
+
 export GO_LDSO = "${@get_linuxloader(d)}"
 export CC_FOR_TARGET = "gcc"
 export CXX_FOR_TARGET = "g++"
Signature · 1 line
2.35.1