summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/go/go-target.inc
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2022-01-01 12:29:56 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-01-05 17:18:15 +0000
commit0111724c3405c422730aaf1353269e3665aea6e2 (patch)
tree1fc6ca673872eceb5e97140d0c47adec538f1f3c /meta/recipes-devtools/go/go-target.inc
parent51a8e28fe03c167727be99183fa82ab88ffe9876 (diff)
downloadpoky-0111724c3405c422730aaf1353269e3665aea6e2.tar.gz
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>
Diffstat (limited to 'meta/recipes-devtools/go/go-target.inc')
-rw-r--r--meta/recipes-devtools/go/go-target.inc10
1 files changed, 10 insertions, 0 deletions
diff --git a/meta/recipes-devtools/go/go-target.inc b/meta/recipes-devtools/go/go-target.inc
index 47b4411d54..51f1b79cc3 100644
--- a/meta/recipes-devtools/go/go-target.inc
+++ b/meta/recipes-devtools/go/go-target.inc
@@ -1,6 +1,16 @@
1DEPENDS = "virtual/${TUNE_PKGARCH}-go go-native" 1DEPENDS = "virtual/${TUNE_PKGARCH}-go go-native"
2DEPENDS:class-nativesdk = "virtual/${TARGET_PREFIX}go-crosssdk go-native" 2DEPENDS:class-nativesdk = "virtual/${TARGET_PREFIX}go-crosssdk go-native"
3 3
4DEBUG_PREFIX_MAP = "\
5 -fdebug-prefix-map=${STAGING_DIR_HOST}= \
6 -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \
7"
8
9export CGO_CFLAGS = "${CFLAGS}"
10export CGO_CPPFLAGS = "${CPPFLAGS}"
11export CGO_CXXFLAGS = "${CXXFLAGS}"
12export CGO_LDFLAGS = "-Wl,-O1 ${TARGET_LINK_HASH_STYLE} ${ASNEEDED} ${SECURITY_LDFLAGS}"
13
4export GOCACHE = "${B}/.cache" 14export GOCACHE = "${B}/.cache"
5GO_LDFLAGS = "" 15GO_LDFLAGS = ""
6GO_LDFLAGS:class-nativesdk = "-linkmode external" 16GO_LDFLAGS:class-nativesdk = "-linkmode external"