mirror of
https://git.yoctoproject.org/poky
synced 2026-05-08 05:09:24 +00:00
go: correctly set debug-prefix-map and build directory
Go has its own system for creating temporary build sub-directories with randomized names, and setting up debug-prefix-map on the fly to prevent those directories leaking into target binaries. OE's own settings were clashing with it, so this change carefully avoids the two stepping on each other. Additionally, the top level build directory cannot be named 'go-something'. (From OE-Core rev: 9985b17a30bb9b9f1bc82a44662687db5cead66e) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
51a8e28fe0
commit
0111724c34
@@ -67,7 +67,7 @@ GO_INSTALL_FILTEROUT ?= "${GO_IMPORT}/vendor/"
|
||||
|
||||
B = "${WORKDIR}/build"
|
||||
export GOPATH = "${B}"
|
||||
export GOTMPDIR ?= "${WORKDIR}/go-tmp"
|
||||
export GOTMPDIR ?= "${WORKDIR}/build-tmp"
|
||||
GOTMPDIR[vardepvalue] = ""
|
||||
|
||||
python go_do_unpack() {
|
||||
|
||||
@@ -23,7 +23,7 @@ INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
|
||||
SSTATE_SCAN_CMD = "true"
|
||||
|
||||
export GOROOT_OVERRIDE = "1"
|
||||
export GOTMPDIR ?= "${WORKDIR}/go-tmp"
|
||||
export GOTMPDIR ?= "${WORKDIR}/build-tmp"
|
||||
GOTMPDIR[vardepvalue] = ""
|
||||
export CGO_ENABLED = "1"
|
||||
|
||||
|
||||
@@ -2,10 +2,15 @@ DEPENDS = "virtual/${TUNE_PKGARCH}-go go-native"
|
||||
DEPENDS:class-nativesdk = "virtual/${TARGET_PREFIX}go-crosssdk"
|
||||
PROVIDES = "virtual/${TARGET_PREFIX}go-runtime"
|
||||
|
||||
DEBUG_PREFIX_MAP = "\
|
||||
-fdebug-prefix-map=${STAGING_DIR_HOST}= \
|
||||
-fdebug-prefix-map=${STAGING_DIR_NATIVE}= \
|
||||
"
|
||||
|
||||
export CGO_CFLAGS = "${CFLAGS}"
|
||||
export CGO_CPPFLAGS = "${CPPFLAGS}"
|
||||
export CGO_CXXFLAGS = "${CXXFLAGS}"
|
||||
export CGO_LDFLAGS = "${LDFLAGS}"
|
||||
export CGO_LDFLAGS = "-Wl,-O1 ${TARGET_LINK_HASH_STYLE} ${ASNEEDED} ${SECURITY_LDFLAGS}"
|
||||
export GOCACHE = "${B}/.cache"
|
||||
|
||||
GO_EXTLDFLAGS ?= "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} ${LDFLAGS}"
|
||||
|
||||
@@ -1,6 +1,16 @@
|
||||
DEPENDS = "virtual/${TUNE_PKGARCH}-go go-native"
|
||||
DEPENDS:class-nativesdk = "virtual/${TARGET_PREFIX}go-crosssdk go-native"
|
||||
|
||||
DEBUG_PREFIX_MAP = "\
|
||||
-fdebug-prefix-map=${STAGING_DIR_HOST}= \
|
||||
-fdebug-prefix-map=${STAGING_DIR_NATIVE}= \
|
||||
"
|
||||
|
||||
export CGO_CFLAGS = "${CFLAGS}"
|
||||
export CGO_CPPFLAGS = "${CPPFLAGS}"
|
||||
export CGO_CXXFLAGS = "${CXXFLAGS}"
|
||||
export CGO_LDFLAGS = "-Wl,-O1 ${TARGET_LINK_HASH_STYLE} ${ASNEEDED} ${SECURITY_LDFLAGS}"
|
||||
|
||||
export GOCACHE = "${B}/.cache"
|
||||
GO_LDFLAGS = ""
|
||||
GO_LDFLAGS:class-nativesdk = "-linkmode external"
|
||||
|
||||
Reference in New Issue
Block a user