summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Vehlow <joerg.vehlow@aox.de>2022-04-11 14:35:20 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-04-19 14:42:20 +0100
commit460012e04a89e0b84fd5949c9a2229ef46e7a341 (patch)
tree5f6c88f0ece2fa68a3582ba5725b3349908efad9
parentf99183484822db34e4a87588baa041ac7c729815 (diff)
downloadpoky-460012e04a89e0b84fd5949c9a2229ef46e7a341.tar.gz
go: Always pass interpreter to linker
When gos internal linker is used, it uses hardcoded paths to the interpreter (dynamic linker). For x86_64 this hardcoded path is /lib64/ld-linux-x86-64.so.2, but yocto's default dynamic linker path is /lib64/ld-linux-x86-64.so.2. Most of the time, the internal linker is not used and binutils linker sets the correct path, but sometimes the internal linker is used and the resulting binary will not work on x86_64. To ensure the path is always correct, pass it to the linker. (From OE-Core rev: 6b54215074d7f3dbba07f096f16b9c0acf51527c) Signed-off-by: Joerg Vehlow <joerg.vehlow@aox.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/go.bbclass3
1 files changed, 2 insertions, 1 deletions
diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
index 9c4c92bffd..df8d4db26d 100644
--- a/meta/classes/go.bbclass
+++ b/meta/classes/go.bbclass
@@ -1,4 +1,5 @@
1inherit goarch 1inherit goarch
2inherit linuxloader
2 3
3GO_PARALLEL_BUILD ?= "${@oe.utils.parallel_make_argument(d, '-p %d')}" 4GO_PARALLEL_BUILD ?= "${@oe.utils.parallel_make_argument(d, '-p %d')}"
4 5
@@ -44,7 +45,7 @@ GO_LINKMODE ?= ""
44GO_LINKMODE:class-nativesdk = "--linkmode=external" 45GO_LINKMODE:class-nativesdk = "--linkmode=external"
45GO_LINKMODE:class-native = "--linkmode=external" 46GO_LINKMODE:class-native = "--linkmode=external"
46GO_EXTRA_LDFLAGS ?= "" 47GO_EXTRA_LDFLAGS ?= ""
47GO_LDFLAGS ?= '-ldflags="${GO_RPATH} ${GO_LINKMODE} ${GO_EXTRA_LDFLAGS} -extldflags '${GO_EXTLDFLAGS}'"' 48GO_LDFLAGS ?= '-ldflags="${GO_RPATH} ${GO_LINKMODE} -I ${@get_linuxloader(d)} ${GO_EXTRA_LDFLAGS} -extldflags '${GO_EXTLDFLAGS}'"'
48export GOBUILDFLAGS ?= "-v ${GO_LDFLAGS} -trimpath" 49export GOBUILDFLAGS ?= "-v ${GO_LDFLAGS} -trimpath"
49export GOPATH_OMIT_IN_ACTIONID ?= "1" 50export GOPATH_OMIT_IN_ACTIONID ?= "1"
50export GOPTESTBUILDFLAGS ?= "${GOBUILDFLAGS} -c" 51export GOPTESTBUILDFLAGS ?= "${GOBUILDFLAGS} -c"