mirror of
https://git.yoctoproject.org/poky
synced 2026-04-21 03:32:12 +02:00
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: 69128ca66991b13358f2552fcd5a7cfa6dda4952) 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> (cherry picked from commit 6b54215074d7f3dbba07f096f16b9c0acf51527c) Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io> Signed-off-by: Steve Sakoman <steve@sakoman.com>
This commit is contained in:
committed by
Steve Sakoman
parent
8d93dec85f
commit
04b2e68c4f
@@ -1,4 +1,5 @@
|
||||
inherit goarch
|
||||
inherit linuxloader
|
||||
|
||||
GO_PARALLEL_BUILD ?= "${@oe.utils.parallel_make_argument(d, '-p %d')}"
|
||||
|
||||
@@ -44,7 +45,7 @@ GO_LINKMODE ?= ""
|
||||
GO_LINKMODE:class-nativesdk = "--linkmode=external"
|
||||
GO_LINKMODE:class-native = "--linkmode=external"
|
||||
GO_EXTRA_LDFLAGS ?= ""
|
||||
GO_LDFLAGS ?= '-ldflags="${GO_RPATH} ${GO_LINKMODE} ${GO_EXTRA_LDFLAGS} -extldflags '${GO_EXTLDFLAGS}'"'
|
||||
GO_LDFLAGS ?= '-ldflags="${GO_RPATH} ${GO_LINKMODE} -I ${@get_linuxloader(d)} ${GO_EXTRA_LDFLAGS} -extldflags '${GO_EXTLDFLAGS}'"'
|
||||
export GOBUILDFLAGS ?= "-v ${GO_LDFLAGS} -trimpath"
|
||||
export GOPATH_OMIT_IN_ACTIONID ?= "1"
|
||||
export GOPTESTBUILDFLAGS ?= "${GOBUILDFLAGS} -c"
|
||||
|
||||
Reference in New Issue
Block a user