diff options
Diffstat (limited to 'meta/recipes-devtools/go/go-target.inc')
-rw-r--r-- | meta/recipes-devtools/go/go-target.inc | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/meta/recipes-devtools/go/go-target.inc b/meta/recipes-devtools/go/go-target.inc index c229ab2f8d..981c7abd31 100644 --- a/meta/recipes-devtools/go/go-target.inc +++ b/meta/recipes-devtools/go/go-target.inc @@ -1,20 +1,21 @@ DEPENDS = "virtual/${TUNE_PKGARCH}-go go-native" -DEPENDS_class-nativesdk = "virtual/${TARGET_PREFIX}go-crosssdk go-native" - -export GOHOSTOS = "${BUILD_GOOS}" -export GOHOSTARCH = "${BUILD_GOARCH}" -export GOOS = "${TARGET_GOOS}" -export GOARCH = "${TARGET_GOARCH}" -export GOARM = "${TARGET_GOARM}" -export GO386 = "${TARGET_GO386}" -export GOMIPS = "${TARGET_GOMIPS}" -export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go" -export GOROOT_FINAL = "${libdir}/go" -GO_LDFLAGS = "" -GO_LDFLAGS_class-nativesdk = "-linkmode external" -export GO_LDFLAGS - -CC_append_class-nativesdk = " ${SECURITY_NOPIE_CFLAGS}" +DEPENDS:class-nativesdk = "virtual/${TARGET_PREFIX}go 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}" +# Filter out -fdebug-prefix-map options as they clash with the GO's build system +export CGO_LDFLAGS = "${@ ' '.join(filter(lambda f: not f.startswith('-fdebug-prefix-map'), d.getVar('LDFLAGS').split())) }" + +export GOCACHE = "${B}/.cache" +export GO_LDFLAGS = "" +export GOBUILDFLAGS = "-gcflags=-trimpath=$GOPATH -asmflags=-trimpath=$GOPATH -trimpath" +CC:append:class-nativesdk = " ${SECURITY_NOPIE_CFLAGS}" do_configure[noexec] = "1" @@ -26,7 +27,6 @@ do_compile() { ./make.bash --target-only --no-banner cd ${B} } -do_compile[dirs] =+ "${GOTMPDIR} ${B}/bin ${B}/pkg" do_compile[cleandirs] += "${GOTMPDIR} ${B}/bin ${B}/pkg" do_install() { @@ -40,14 +40,14 @@ do_install() { for f in ${B}/${GO_BUILD_BINDIR}/*; do name=`basename $f` install -m 0755 $f ${D}${libdir}/go/bin/ - ln -sf ../${BASELIB}/go/bin/$name ${D}${bindir}/ + ln -sf ../${baselib}/go/bin/$name ${D}${bindir}/ done + rm -rf ${D}${libdir}/go/src } PACKAGES = "${PN} ${PN}-dev" -FILES_${PN} = "${libdir}/go/bin ${libdir}/go/pkg/tool/${TARGET_GOTUPLE} ${bindir}" -FILES_${PN}-dev = "${libdir}/go" -RDEPENDS_${PN}-dev = "perl bash" -INSANE_SKIP_${PN} = "ldflags" +FILES:${PN} = "${libdir}/go/bin ${libdir}/go/pkg/tool/${TARGET_GOTUPLE} ${bindir}" +RDEPENDS:${PN} = "go-runtime" +INSANE_SKIP:${PN} = "ldflags" BBCLASSEXTEND = "nativesdk" |