diff options
-rw-r--r-- | meta/classes/go.bbclass | 4 | ||||
-rw-r--r-- | meta/recipes-devtools/go/go-runtime.inc | 5 | ||||
-rw-r--r-- | meta/recipes-devtools/go/go-target.inc | 3 |
3 files changed, 11 insertions, 1 deletions
diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass index 33502bf722..863b578e5c 100644 --- a/meta/classes/go.bbclass +++ b/meta/classes/go.bbclass | |||
@@ -37,7 +37,9 @@ GO_RPATH = "${@'-r ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink' if d.getVar('GO_D | |||
37 | GO_RPATH_class-native = "${@'-r ${STAGING_LIBDIR_NATIVE}/go/pkg/${TARGET_GOTUPLE}_dynlink' if d.getVar('GO_DYNLINK') else ''}" | 37 | GO_RPATH_class-native = "${@'-r ${STAGING_LIBDIR_NATIVE}/go/pkg/${TARGET_GOTUPLE}_dynlink' if d.getVar('GO_DYNLINK') else ''}" |
38 | GO_RPATH_LINK_class-native = "${@'-Wl,-rpath-link=${STAGING_LIBDIR_NATIVE}/go/pkg/${TARGET_GOTUPLE}_dynlink' if d.getVar('GO_DYNLINK') else ''}" | 38 | GO_RPATH_LINK_class-native = "${@'-Wl,-rpath-link=${STAGING_LIBDIR_NATIVE}/go/pkg/${TARGET_GOTUPLE}_dynlink' if d.getVar('GO_DYNLINK') else ''}" |
39 | GO_EXTLDFLAGS ?= "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} ${GO_RPATH_LINK} ${LDFLAGS}" | 39 | GO_EXTLDFLAGS ?= "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} ${GO_RPATH_LINK} ${LDFLAGS}" |
40 | GO_LDFLAGS ?= '-ldflags="${GO_RPATH} -extldflags '${GO_EXTLDFLAGS}'"' | 40 | GO_LINKMODE ?= "" |
41 | GO_LINKMODE_class-nativesdk = "--linkmode=external" | ||
42 | GO_LDFLAGS ?= '-ldflags="${GO_RPATH} ${GO_LINKMODE} -extldflags '${GO_EXTLDFLAGS}'"' | ||
41 | export GOBUILDFLAGS ?= "-v ${GO_LDFLAGS}" | 43 | export GOBUILDFLAGS ?= "-v ${GO_LDFLAGS}" |
42 | export GOPTESTBUILDFLAGS ?= "${GOBUILDFLAGS} -c" | 44 | export GOPTESTBUILDFLAGS ?= "${GOBUILDFLAGS} -c" |
43 | export GOPTESTFLAGS ?= "-test.v" | 45 | export GOPTESTFLAGS ?= "-test.v" |
diff --git a/meta/recipes-devtools/go/go-runtime.inc b/meta/recipes-devtools/go/go-runtime.inc index a074238e47..934d1aaeb9 100644 --- a/meta/recipes-devtools/go/go-runtime.inc +++ b/meta/recipes-devtools/go/go-runtime.inc | |||
@@ -45,6 +45,11 @@ do_install() { | |||
45 | done | 45 | done |
46 | } | 46 | } |
47 | 47 | ||
48 | # Remove test binaries that cannot be relocated | ||
49 | do_install_append_class-nativesdk() { | ||
50 | rm -rf ${D}${libdir}/go/src/runtime/pprof/testdata | ||
51 | } | ||
52 | |||
48 | # These testdata directories aren't needed for builds and contain binaries | 53 | # These testdata directories aren't needed for builds and contain binaries |
49 | # that can cause errors in sysroot_strip(), so just remove them. | 54 | # that can cause errors in sysroot_strip(), so just remove them. |
50 | sysroot_stage_all_append() { | 55 | sysroot_stage_all_append() { |
diff --git a/meta/recipes-devtools/go/go-target.inc b/meta/recipes-devtools/go/go-target.inc index 0d80bf0d97..b88d0166e5 100644 --- a/meta/recipes-devtools/go/go-target.inc +++ b/meta/recipes-devtools/go/go-target.inc | |||
@@ -14,6 +14,9 @@ export CC_FOR_TARGET = "${CC}" | |||
14 | export CXX_FOR_TARGET = "${CXX}" | 14 | export CXX_FOR_TARGET = "${CXX}" |
15 | export GO_TARGET_INSTALL = "cmd" | 15 | export GO_TARGET_INSTALL = "cmd" |
16 | export GO_FLAGS = "-a" | 16 | export GO_FLAGS = "-a" |
17 | GO_LDFLAGS = "" | ||
18 | GO_LDFLAGS_class-nativesdk = "-linkmode external" | ||
19 | export GO_LDFLAGS | ||
17 | 20 | ||
18 | do_configure[noexec] = "1" | 21 | do_configure[noexec] = "1" |
19 | 22 | ||