]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
go: Disable pie in cgo for mips
authorKhem Raj <raj.khem@gmail.com>
Tue, 29 Mar 2022 23:39:52 +0000 (16:39 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 19 Apr 2022 13:14:14 +0000 (14:14 +0100)
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

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-devtools/go/go_1.18.bb

index a492d7e64a1b7671ecae8dd49029d48e4cbfe1ad..98977673ee4ce8cdec2cdae53780d78198c3a0c3 100644 (file)
@@ -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++"