diff options
author | Alexander Kanavin <alex.kanavin@gmail.com> | 2022-01-01 12:29:56 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-01-05 17:18:15 +0000 |
commit | 0111724c3405c422730aaf1353269e3665aea6e2 (patch) | |
tree | 1fc6ca673872eceb5e97140d0c47adec538f1f3c /meta/recipes-devtools | |
parent | 51a8e28fe03c167727be99183fa82ab88ffe9876 (diff) | |
download | poky-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')
-rw-r--r-- | meta/recipes-devtools/go/go-common.inc | 2 | ||||
-rw-r--r-- | meta/recipes-devtools/go/go-runtime.inc | 7 | ||||
-rw-r--r-- | meta/recipes-devtools/go/go-target.inc | 10 |
3 files changed, 17 insertions, 2 deletions
diff --git a/meta/recipes-devtools/go/go-common.inc b/meta/recipes-devtools/go/go-common.inc index 5bbf35b787..83f8db7b39 100644 --- a/meta/recipes-devtools/go/go-common.inc +++ b/meta/recipes-devtools/go/go-common.inc | |||
@@ -23,7 +23,7 @@ INHIBIT_PACKAGE_DEBUG_SPLIT = "1" | |||
23 | SSTATE_SCAN_CMD = "true" | 23 | SSTATE_SCAN_CMD = "true" |
24 | 24 | ||
25 | export GOROOT_OVERRIDE = "1" | 25 | export GOROOT_OVERRIDE = "1" |
26 | export GOTMPDIR ?= "${WORKDIR}/go-tmp" | 26 | export GOTMPDIR ?= "${WORKDIR}/build-tmp" |
27 | GOTMPDIR[vardepvalue] = "" | 27 | GOTMPDIR[vardepvalue] = "" |
28 | export CGO_ENABLED = "1" | 28 | export CGO_ENABLED = "1" |
29 | 29 | ||
diff --git a/meta/recipes-devtools/go/go-runtime.inc b/meta/recipes-devtools/go/go-runtime.inc index 617e6b5414..a08d44dd3a 100644 --- a/meta/recipes-devtools/go/go-runtime.inc +++ b/meta/recipes-devtools/go/go-runtime.inc | |||
@@ -2,10 +2,15 @@ DEPENDS = "virtual/${TUNE_PKGARCH}-go go-native" | |||
2 | DEPENDS:class-nativesdk = "virtual/${TARGET_PREFIX}go-crosssdk" | 2 | DEPENDS:class-nativesdk = "virtual/${TARGET_PREFIX}go-crosssdk" |
3 | PROVIDES = "virtual/${TARGET_PREFIX}go-runtime" | 3 | PROVIDES = "virtual/${TARGET_PREFIX}go-runtime" |
4 | 4 | ||
5 | DEBUG_PREFIX_MAP = "\ | ||
6 | -fdebug-prefix-map=${STAGING_DIR_HOST}= \ | ||
7 | -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \ | ||
8 | " | ||
9 | |||
5 | export CGO_CFLAGS = "${CFLAGS}" | 10 | export CGO_CFLAGS = "${CFLAGS}" |
6 | export CGO_CPPFLAGS = "${CPPFLAGS}" | 11 | export CGO_CPPFLAGS = "${CPPFLAGS}" |
7 | export CGO_CXXFLAGS = "${CXXFLAGS}" | 12 | export CGO_CXXFLAGS = "${CXXFLAGS}" |
8 | export CGO_LDFLAGS = "${LDFLAGS}" | 13 | export CGO_LDFLAGS = "-Wl,-O1 ${TARGET_LINK_HASH_STYLE} ${ASNEEDED} ${SECURITY_LDFLAGS}" |
9 | export GOCACHE = "${B}/.cache" | 14 | export GOCACHE = "${B}/.cache" |
10 | 15 | ||
11 | GO_EXTLDFLAGS ?= "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} ${LDFLAGS}" | 16 | GO_EXTLDFLAGS ?= "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} ${LDFLAGS}" |
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 @@ | |||
1 | DEPENDS = "virtual/${TUNE_PKGARCH}-go go-native" | 1 | DEPENDS = "virtual/${TUNE_PKGARCH}-go go-native" |
2 | DEPENDS:class-nativesdk = "virtual/${TARGET_PREFIX}go-crosssdk go-native" | 2 | DEPENDS:class-nativesdk = "virtual/${TARGET_PREFIX}go-crosssdk go-native" |
3 | 3 | ||
4 | DEBUG_PREFIX_MAP = "\ | ||
5 | -fdebug-prefix-map=${STAGING_DIR_HOST}= \ | ||
6 | -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \ | ||
7 | " | ||
8 | |||
9 | export CGO_CFLAGS = "${CFLAGS}" | ||
10 | export CGO_CPPFLAGS = "${CPPFLAGS}" | ||
11 | export CGO_CXXFLAGS = "${CXXFLAGS}" | ||
12 | export CGO_LDFLAGS = "-Wl,-O1 ${TARGET_LINK_HASH_STYLE} ${ASNEEDED} ${SECURITY_LDFLAGS}" | ||
13 | |||
4 | export GOCACHE = "${B}/.cache" | 14 | export GOCACHE = "${B}/.cache" |
5 | GO_LDFLAGS = "" | 15 | GO_LDFLAGS = "" |
6 | GO_LDFLAGS:class-nativesdk = "-linkmode external" | 16 | GO_LDFLAGS:class-nativesdk = "-linkmode external" |