Revamp the Go support
v8 cover Revamp the Go support
This improves the Go support on OE-Core.
We are trying to port as much as possible work done by Matt on meta-golang back to OE-Core and also to avoid carrying old releases as there is no need to support more versions of Go toolchain.
This fixes issues in existing support as well as add support for SDK generation which supports Go.
Changes in v9:
- new patch
- new patch
- new patch
- new patch
- new patch
- new patch
- new patch
- new patch
Matt Madison (7):
go-runtime: extend to nativesdk builds goarch.bbclass: identify archs with Go dynamic linking support go-1.8: add patch for set soname in ELF shared objects
go-runtime: build the Go runtime as a shared library go.bbclass: add support linking against shared runtime goarch.bbclass: set ARM_INSTRUCTION_SET to "arm"
go: update to go 1.9
Otavio Salvador (2):
go.bbclass: Add "ldflags" to QA skip list
go.bbclass: Add ptest support
meta/classes/go.bbclass | 75 ++++++++++++++++++++--
meta/classes/goarch.bbclass | 11 ++++
meta/recipes-devtools/go/go-1.8.inc | 21 ------
.../go/go-1.8/armhf-elf-header.patch | 23 -------
.../go/go-1.8/fix-cc-handling.patch | 50 ---------------
.../go/go-1.8/fix-target-cc-for-build.patch | 17 -----
meta/recipes-devtools/go/go-1.8/gotooldir.patch | 30 ---------
.../go/go-1.8/make-goroot-precious.patch | 21 ------
meta/recipes-devtools/go/go-1.8/syslog.patch | 62 ------------------
meta/recipes-devtools/go/go-1.9.inc | 18 ++++++
.../0001-make.bash-quote-CC_FOR_TARGET.patch | 32 +++++++++
...CC-and-CXX-environment-variable-construct.patch | 67 +++++++++++++++++++
...h-better-separate-host-and-target-builds.patch} | 52 +++++++++++----
...w-GOTOOLDIR-to-be-overridden-in-the-envir.patch | 68 ++++++++++++++++++++
...05-cmd-go-make-GOROOT-precious-by-default.patch | 41 ++++++++++++
...d-GOTOOLDIR_BOOTSTRAP-environment-variab.patch} | 26 ++++++--
.../0007-ld-add-soname-to-shareable-objects.patch | 46 +++++++++++++
meta/recipes-devtools/go/go-cross-canadian.inc | 1 +
...ss-canadian_1.8.bb => go-cross-canadian_1.9.bb} | 0
meta/recipes-devtools/go/go-cross.inc | 2 +-
.../go/{go-cross_1.8.bb => go-cross_1.9.bb} | 0
.../go/{go-crosssdk_1.8.bb => go-crosssdk_1.9.bb} | 0
meta/recipes-devtools/go/go-dep_0.3.0.bb | 2 -
meta/recipes-devtools/go/go-native.inc | 2 +-
.../go/{go-native_1.8.bb => go-native_1.9.bb} | 0
meta/recipes-devtools/go/go-runtime.inc | 27 +++++++-
.../go/{go-runtime_1.8.bb => go-runtime_1.9.bb} | 0
meta/recipes-devtools/go/{go_1.8.bb => go_1.9.bb} | 0
28 files changed, 443 insertions(+), 251 deletions(-)
delete mode 100644 meta/recipes-devtools/go/go-1.8.inc
delete mode 100644 meta/recipes-devtools/go/go-1.8/armhf-elf-header.patch
delete mode 100644 meta/recipes-devtools/go/go-1.8/fix-cc-handling.patch
delete mode 100644 meta/recipes-devtools/go/go-1.8/fix-target-cc-for-build.patch
delete mode 100644 meta/recipes-devtools/go/go-1.8/gotooldir.patch
delete mode 100644 meta/recipes-devtools/go/go-1.8/make-goroot-precious.patch
delete mode 100644 meta/recipes-devtools/go/go-1.8/syslog.patch
create mode 100644 meta/recipes-devtools/go/go-1.9.inc
create mode 100644 meta/recipes-devtools/go/go-1.9/0001-make.bash-quote-CC_FOR_TARGET.patch
create mode 100644 meta/recipes-devtools/go/go-1.9/0002-cmd-go-fix-CC-and-CXX-environment-variable-construct.patch
rename meta/recipes-devtools/go/{go-1.8/split-host-and-target-build.patch => go-1.9/0003-make.bash-better-separate-host-and-target-builds.patch} (60%)
create mode 100644 meta/recipes-devtools/go/go-1.9/0004-cmd-go-allow-GOTOOLDIR-to-be-overridden-in-the-envir.patch
create mode 100644 meta/recipes-devtools/go/go-1.9/0005-cmd-go-make-GOROOT-precious-by-default.patch
rename meta/recipes-devtools/go/{go-1.8/set-gotooldir-during-bootstrap.patch => go-1.9/0006-make.bash-add-GOTOOLDIR_BOOTSTRAP-environment-variab.patch} (55%)
create mode 100644 meta/recipes-devtools/go/go-1.9/0007-ld-add-soname-to-shareable-objects.patch
rename meta/recipes-devtools/go/{go-cross-canadian_1.8.bb => go-cross-canadian_1.9.bb} (100%)
rename meta/recipes-devtools/go/{go-cross_1.8.bb => go-cross_1.9.bb} (100%)
rename meta/recipes-devtools/go/{go-crosssdk_1.8.bb => go-crosssdk_1.9.bb} (100%)
rename meta/recipes-devtools/go/{go-native_1.8.bb => go-native_1.9.bb} (100%)
rename meta/recipes-devtools/go/{go-runtime_1.8.bb => go-runtime_1.9.bb} (100%)
rename meta/recipes-devtools/go/{go_1.8.bb => go_1.9.bb} (100%)Signature · 1 line
2.14.1
PATCH v8 1/9 go-runtime: extend to nativesdk builds
From: Matt Madison <[email protected]>
Missed this when addding SDK support.
---
Changes in v9:
- new patch
meta/recipes-devtools/go/go-runtime.inc | 3 +++ 1 file changed, 3 insertions(+)
meta/recipes-devtools/go/go-runtime.inc +3 -0
@@ -1,4 +1,5 @@ DEPENDS = "virtual/${TARGET_PREFIX}go go-native" +DEPENDS_class-nativesdk = "virtual/${TARGET_PREFIX}go-crosssdk" PROVIDES = "virtual/${TARGET_PREFIX}go-runtime" export GOHOSTOS = "${BUILD_GOOS}"
@@ -56,3 +57,5 @@ INSANE_SKIP_${PN}-dev = "staticdev ldflags file-rdeps arch" INHIBIT_PACKAGE_STRIP = "1" INHIBIT_PACKAGE_DEBUG_SPLIT = "1" + +BBCLASSEXTEND = "nativesdk"
Signature · 1 line
2.14.1
PATCH v8 2/9 goarch.bbclass: identify archs with Go dynamic linking support
In reply to Otavio SalvadorFrom: Matt Madison <[email protected]>
Go only supports shared libraries for some architectures, so add a variable for use elsewhere that gets a non-null value only for those architectures.
---
Changes in v9:
- new patch
meta/classes/goarch.bbclass | 10 ++++++++++ 1 file changed, 10 insertions(+)
meta/classes/goarch.bbclass +10 -0
@@ -11,6 +11,16 @@ TARGET_GOARM = "${@go_map_arm(d.getVar('TARGET_ARCH'), d.getVar('TUNE_FEATURES') TARGET_GOTUPLE = "${TARGET_GOOS}_${TARGET_GOARCH}" GO_BUILD_BINDIR = "${@['bin/${HOST_GOTUPLE}','bin'][d.getVar('BUILD_GOTUPLE') == d.getVar('HOST_GOTUPLE')]}" +# Go supports dynamic linking on a limited set of architectures. +# See the supportsDynlink function in go/src/cmd/compile/internal/gc/main.go +GO_DYNLINK = "" +GO_DYNLINK_arm = "1" +GO_DYNLINK_aarch64 = "1" +GO_DYNLINK_x86 = "1" +GO_DYNLINK_x86-64 = "1" +GO_DYNLINK_powerpc64 = "1" +GO_DYNLINK_class-native = "" + # define here because everybody inherits this class # COMPATIBLE_HOST_linux-gnux32 = "null"
Signature · 1 line
2.14.1
PATCH v8 3/9 go-1.8: add patch for set soname in ELF shared objects
In reply to Otavio SalvadorFrom: Matt Madison <[email protected]>
The go link tool does not set the soname by default, which prevents package.bbclass's shlibs processing from seeing shared libraries built with go.
This patch passes appropriate options to go's linker and the external linker to set the soname.
---
Changes in v9:
- new patch
meta/recipes-devtools/go/go-1.8.inc | 1 + ...06-linker-add-soname-to-shareable-objects.patch | 44 ++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 meta/recipes-devtools/go/go-1.8/0006-linker-add-soname-to-shareable-objects.patch
meta/recipes-devtools/go/go-1.8.inc +1 -0
@@ -16,6 +16,7 @@ SRC_URI += "\ file://gotooldir.patch \ file://make-goroot-precious.patch \ file://set-gotooldir-during-bootstrap.patch \ + file://0006-linker-add-soname-to-shareable-objects.patch \ " SRC_URI[main.md5sum] = "64e9380e07bba907e26a00cf5fcbe77e" SRC_URI[main.sha256sum] = "5f5dea2447e7dcfdc50fa6b94c512e58bfba5673c039259fd843f68829d99fa6"
meta/recipes-devtools/go/go-1.8/0006-linker-add-soname-to-shareable-objects.patch new file +44 -0
44 lines not on this page · raw message
Signature · 1 line
2.14.1
PATCH v8 4/9 go-runtime: build the Go runtime as a shared library
In reply to Otavio SalvadorFrom: Matt Madison <[email protected]>
If the target architecture supports, it build the Go runtime as a shared library in addition to building the static libraries.
---
Changes in v9:
- new patch
meta/recipes-devtools/go/go-runtime.inc | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-)
meta/recipes-devtools/go/go-runtime.inc +22 -2
@@ -24,6 +24,9 @@ do_compile() { mkdir ${GOBIN} cd src GO_FLAGS="" ./make.bash + if [ -n "${GO_DYNLINK}" ]; then + GO_FLAGS="-buildmode=shared" GO_LDFLAGS="-extldflags \"${LDFLAGS}\"" ./make.bash + fi cd ${B} }
@@ -49,8 +52,25 @@ sysroot_stage_all_append() { } ALLOW_EMPTY_${PN} = "1" -FILES_${PN}-dev = "${libdir}/go/src ${libdir}/go/pkg/include" -FILES_${PN}-staticdev = "${libdir}/go/pkg/${TARGET_GOTUPLE} ${libdir}/go/pkg/${TARGET_GOTUPLE}" +FILES_${PN} = "${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*${SOLIBSDEV}" +FILES_${PN}-dev = "${libdir}/go/src ${libdir}/go/pkg/include \ + ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*.shlibname \ + ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*.shlibname \ + ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*.shlibname \ + ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*.shlibname \ + ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*/*.shlibname \ + ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*/*/*.shlibname \ + ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*/*/*/*.shlibname \ +" +FILES_${PN}-staticdev = "${libdir}/go/pkg/${TARGET_GOTUPLE} \ + ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*.a \ + ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*.a \ + ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*.a \ + ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*.a \ + ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*/*.a \ + ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*/*/*.a \ + ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink/*/*/*/*/*/*/*.a \ +" # The testdata directories in the source tree include some binaries for various # architectures, scripts, and .a files INSANE_SKIP_${PN}-dev = "staticdev ldflags file-rdeps arch"
Signature · 1 line
2.14.1
PATCH v8 5/9 go.bbclass: add support linking against shared runtime
In reply to Otavio SalvadorFrom: Matt Madison <[email protected]>
For architectures that support it, use the -linkshared build option to build packages against the shared Go runtime.
---
Changes in v9:
- new patch
meta/classes/go.bbclass | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
meta/classes/go.bbclass +9 -2
@@ -31,7 +31,14 @@ DEPENDS_GOLANG_class-nativesdk = "virtual/${TARGET_PREFIX}go-crosssdk virtual/${ DEPENDS_append = " ${DEPENDS_GOLANG}" -export GOBUILDFLAGS ?= "-v" +GO_LINKSHARED ?= "${@'-linkshared' if d.getVar('GO_DYNLINK') else ''}" +GO_RPATH_LINK = "${@'-Wl,-rpath-link=${STAGING_DIR_TARGET}${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink' if d.getVar('GO_DYNLINK') else ''}" +GO_RPATH = "${@'-r ${libdir}/go/pkg/${TARGET_GOTUPLE}_dynlink' if d.getVar('GO_DYNLINK') else ''}" +GO_RPATH_class-native = "${@'-r ${STAGING_LIBDIR_NATIVE}/go/pkg/${TARGET_GOTUPLE}_dynlink' if d.getVar('GO_DYNLINK') else ''}" +GO_RPATH_LINK_class-native = "${@'-Wl,-rpath-link=${STAGING_LIBDIR_NATIVE}/go/pkg/${TARGET_GOTUPLE}_dynlink' if d.getVar('GO_DYNLINK') else ''}" +GO_EXTLDFLAGS ?= "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} ${GO_RPATH_LINK} ${LDFLAGS}" +GO_LDFLAGS ?= '-ldflags="${GO_RPATH} -extldflags '${GO_EXTLDFLAGS}'"' +export GOBUILDFLAGS ?= "-v ${GO_LDFLAGS}" GOBUILDFLAGS_prepend_task-compile = "${GO_PARALLEL_BUILD} " export GO = "${HOST_PREFIX}go"
@@ -81,7 +88,7 @@ go_do_configure() { go_do_compile() { ${GO} env if [ -n "${GO_INSTALL}" ]; then - ${GO} install ${GOBUILDFLAGS} `go_list_packages` + ${GO} install ${GO_LINKSHARED} ${GOBUILDFLAGS} `go_list_packages` fi } do_compile[cleandirs] = "${B}/bin ${B}/pkg"
Signature · 1 line
2.14.1
PATCH v8 6/9 go.bbclass: Add "ldflags" to QA skip list
In reply to Otavio SalvadorCurrently every Go package will end with GNU_HASH in the ELF binary however adding it to every recipe is cumbersome so instead we handle that here.
---
Changes in v9: None
meta/classes/go.bbclass | 2 ++ meta/recipes-devtools/go/go-dep_0.3.0.bb | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-)
meta/classes/go.bbclass +2 -0
@@ -109,3 +109,5 @@ EXPORT_FUNCTIONS do_unpack do_configure do_compile do_install FILES_${PN}-dev = "${libdir}/go/src" FILES_${PN}-staticdev = "${libdir}/go/pkg" + +INSANE_SKIP_${PN} += "ldflags"
meta/recipes-devtools/go/go-dep_0.3.0.bb +0 -2
@@ -13,6 +13,4 @@ inherit go GO_INSTALL = "${GO_IMPORT}/cmd/dep" -INSANE_SKIP_${PN} += "ldflags" - RDEPENDS_${PN}-dev += "bash"
Signature · 1 line
2.14.1
PATCH v8 7/9 go.bbclass: Add ptest support
In reply to Otavio SalvadorThis adds ptest support for Go packages so its unittest content is packaged and integrated onto the test framework.
---
Changes in v9:
- new patch
meta/classes/go.bbclass | 62 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 60 insertions(+), 2 deletions(-)
meta/classes/go.bbclass +60 -2
@@ -1,4 +1,4 @@ -inherit goarch +inherit goarch ptest def get_go_parallel_make(d): pm = (d.getVar('PARALLEL_MAKE') or '').split()
@@ -39,6 +39,8 @@ GO_RPATH_LINK_class-native = "${@'-Wl,-rpath-link=${STAGING_LIBDIR_NATIVE}/go/pk GO_EXTLDFLAGS ?= "${HOST_CC_ARCH}${TOOLCHAIN_OPTIONS} ${GO_RPATH_LINK} ${LDFLAGS}" GO_LDFLAGS ?= '-ldflags="${GO_RPATH} -extldflags '${GO_EXTLDFLAGS}'"' export GOBUILDFLAGS ?= "-v ${GO_LDFLAGS}" +export GOPTESTBUILDFLAGS ?= "${GOBUILDFLAGS} -c" +export GOPTESTFLAGS ?= "-test.v" GOBUILDFLAGS_prepend_task-compile = "${GO_PARALLEL_BUILD} " export GO = "${HOST_PREFIX}go"
@@ -81,6 +83,13 @@ go_list_packages() { egrep -v '${GO_INSTALL_FILTEROUT}' } +go_list_package_tests() { + ${GO} list -f '{{.ImportPath}} {{.TestGoFiles}}' ${GOBUILDFLAGS} ${GO_INSTALL} | \ + grep -v '\[\]$' | \ + egrep -v '${GO_INSTALL_FILTEROUT}' | \ + awk '{ print $1 }' +} + go_do_configure() { ln -snf ${S}/src ${B}/ }
@@ -93,9 +102,19 @@ go_do_compile() { } do_compile[cleandirs] = "${B}/bin ${B}/pkg" +do_compile_ptest() { + rm -f ${B}/.go_compiled_tests.list + go_list_package_tests | while read pkg; do + cd ${B}/src/$pkg + ${GO} test ${GOPTESTBUILDFLAGS} $pkg + find . -mindepth 1 -maxdepth 1 -type f -name '*.test' -exec echo $pkg/{} \; | \ + sed -e's,/\./,/,'>> ${B}/.go_compiled_tests.list + done +} + go_do_install() { install -d ${D}${libdir}/go/src/${GO_IMPORT} - tar -C ${S}/src/${GO_IMPORT} -cf - --exclude-vcs . | \ + tar -C ${S}/src/${GO_IMPORT} -cf - --exclude-vcs --exclude '*.test' . | \ tar -C ${D}${libdir}/go/src/${GO_IMPORT} --no-same-owner -xf - tar -C ${B} -cf - pkg | tar -C ${D}${libdir}/go --no-same-owner -xf -
@@ -105,9 +124,48 @@ go_do_install() { fi } +do_install_ptest_base() { +set -x + test -f "${B}/.go_compiled_tests.list" || exit 0 + tests="" + while read test; do + tests="$tests${tests:+ }${test%.test}" + testdir=`dirname $test` + install -d ${D}${PTEST_PATH}/$testdir + install -m 0755 ${B}/src/$test ${D}${PTEST_PATH}/$test + if [ -d "${B}/src/$testdir/testdata" ]; then + cp --preserve=mode,timestamps -R "${B}/src/$testdir/testdata" ${D}${PTEST_PATH}/$testdir + fi + done < ${B}/.go_compiled_tests.list + if [ -n "$tests" ]; then + install -d ${D}${PTEST_PATH} + cat >${D}${PTEST_PATH}/run-ptest <<EOF +#!/bin/sh +ANYFAILED=0 +for t in $tests; do + testdir=\`dirname \$t.test\` + if ( cd "${PTEST_PATH}/\$testdir"; "${PTEST_PATH}/\$t.test" ${GOPTESTFLAGS} | tee /dev/fd/9 | grep -q "^FAIL" ) 9>&1; then + ANYFAILED=1 + fi +done +if [ \$ANYFAILED -ne 0 ]; then + echo "FAIL: ${PN}" + exit 1 +fi +echo "PASS: ${PN}" +exit 0 +EOF + chmod +x ${D}${PTEST_PATH}/run-ptest + else + rm -rf ${D}${PTEST_PATH} + fi +set +x +} + EXPORT_FUNCTIONS do_unpack do_configure do_compile do_install FILES_${PN}-dev = "${libdir}/go/src" FILES_${PN}-staticdev = "${libdir}/go/pkg" INSANE_SKIP_${PN} += "ldflags" +INSANE_SKIP_${PN}-ptest += "ldflags"
Signature · 1 line
2.14.1
PATCH v8 8/9 goarch.bbclass: set ARM_INSTRUCTION_SET to "arm"
In reply to Otavio SalvadorFrom: Matt Madison <[email protected]>
Go does not play well with thumb, so ensure that the toolchain and any packages use arm, not thumb, instructions.
---
Changes in v9:
- new patch
meta/classes/goarch.bbclass | 1 + 1 file changed, 1 insertion(+)
meta/classes/goarch.bbclass +1 -0
@@ -27,6 +27,7 @@ COMPATIBLE_HOST_linux-gnux32 = "null" COMPATIBLE_HOST_linux-muslx32 = "null" COMPATIBLE_HOST_powerpc = "null" COMPATIBLE_HOST_powerpc64 = "null" +ARM_INSTRUCTION_SET = "arm" def go_map_arch(a, d): import re
Signature · 1 line
2.14.1
PATCH v8 9/9 go: update to go 1.9
In reply to Otavio SalvadorFrom: Matt Madison <[email protected]>
* Rebased patches
- dropped armhf-elf patch, should no longer be needed
- dropped syslog patch which should not have been imported to begin with
- reworked other patches as needed for the updated code base
* Updated native, cross, cross-canadian .inc files to remove some testdata directories that contain .a files that strip chokes on during sysroot staging
---
Changes in v9:
- new patch
meta/recipes-devtools/go/go-1.8.inc | 22 -------
.../go/go-1.8/armhf-elf-header.patch | 23 --------
.../go/go-1.8/fix-cc-handling.patch | 50 ----------------
.../go/go-1.8/fix-target-cc-for-build.patch | 17 ------
meta/recipes-devtools/go/go-1.8/gotooldir.patch | 30 ----------
.../go/go-1.8/make-goroot-precious.patch | 21 -------
meta/recipes-devtools/go/go-1.8/syslog.patch | 62 --------------------
meta/recipes-devtools/go/go-1.9.inc | 18 ++++++
.../0001-make.bash-quote-CC_FOR_TARGET.patch | 32 ++++++++++
...CC-and-CXX-environment-variable-construct.patch | 67 +++++++++++++++++++++
...h-better-separate-host-and-target-builds.patch} | 52 +++++++++++++----
...w-GOTOOLDIR-to-be-overridden-in-the-envir.patch | 68 ++++++++++++++++++++++
...05-cmd-go-make-GOROOT-precious-by-default.patch | 41 +++++++++++++
...d-GOTOOLDIR_BOOTSTRAP-environment-variab.patch} | 26 +++++++--
.../0007-ld-add-soname-to-shareable-objects.patch} | 20 ++++---
meta/recipes-devtools/go/go-cross-canadian.inc | 1 +
...ss-canadian_1.8.bb => go-cross-canadian_1.9.bb} | 0
meta/recipes-devtools/go/go-cross.inc | 2 +-
.../go/{go-cross_1.8.bb => go-cross_1.9.bb} | 0
.../go/{go-crosssdk_1.8.bb => go-crosssdk_1.9.bb} | 0
meta/recipes-devtools/go/go-native.inc | 2 +-
.../go/{go-native_1.8.bb => go-native_1.9.bb} | 0
.../go/{go-runtime_1.8.bb => go-runtime_1.9.bb} | 0
meta/recipes-devtools/go/{go_1.8.bb => go_1.9.bb} | 0
24 files changed, 301 insertions(+), 253 deletions(-)
delete mode 100644 meta/recipes-devtools/go/go-1.8.inc
delete mode 100644 meta/recipes-devtools/go/go-1.8/armhf-elf-header.patch
delete mode 100644 meta/recipes-devtools/go/go-1.8/fix-cc-handling.patch
delete mode 100644 meta/recipes-devtools/go/go-1.8/fix-target-cc-for-build.patch
delete mode 100644 meta/recipes-devtools/go/go-1.8/gotooldir.patch
delete mode 100644 meta/recipes-devtools/go/go-1.8/make-goroot-precious.patch
delete mode 100644 meta/recipes-devtools/go/go-1.8/syslog.patch
create mode 100644 meta/recipes-devtools/go/go-1.9.inc
create mode 100644 meta/recipes-devtools/go/go-1.9/0001-make.bash-quote-CC_FOR_TARGET.patch
create mode 100644 meta/recipes-devtools/go/go-1.9/0002-cmd-go-fix-CC-and-CXX-environment-variable-construct.patch
rename meta/recipes-devtools/go/{go-1.8/split-host-and-target-build.patch => go-1.9/0003-make.bash-better-separate-host-and-target-builds.patch} (60%)
create mode 100644 meta/recipes-devtools/go/go-1.9/0004-cmd-go-allow-GOTOOLDIR-to-be-overridden-in-the-envir.patch
create mode 100644 meta/recipes-devtools/go/go-1.9/0005-cmd-go-make-GOROOT-precious-by-default.patch
rename meta/recipes-devtools/go/{go-1.8/set-gotooldir-during-bootstrap.patch => go-1.9/0006-make.bash-add-GOTOOLDIR_BOOTSTRAP-environment-variab.patch} (55%)
rename meta/recipes-devtools/go/{go-1.8/0006-linker-add-soname-to-shareable-objects.patch => go-1.9/0007-ld-add-soname-to-shareable-objects.patch} (68%)
rename meta/recipes-devtools/go/{go-cross-canadian_1.8.bb => go-cross-canadian_1.9.bb} (100%)
rename meta/recipes-devtools/go/{go-cross_1.8.bb => go-cross_1.9.bb} (100%)
rename meta/recipes-devtools/go/{go-crosssdk_1.8.bb => go-crosssdk_1.9.bb} (100%)
rename meta/recipes-devtools/go/{go-native_1.8.bb => go-native_1.9.bb} (100%)
rename meta/recipes-devtools/go/{go-runtime_1.8.bb => go-runtime_1.9.bb} (100%)
rename meta/recipes-devtools/go/{go_1.8.bb => go_1.9.bb} (100%)meta/recipes-devtools/go/go-1.8.inc deleted +0 -22
@@ -1,22 +0,0 @@ -require go-common.inc - -GOMINOR = "3" -GO_BASEVERSION = "1.8" -PV .= ".${GOMINOR}" -FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/go-${GO_BASEVERSION}:" - -LIC_FILES_CHKSUM = "file://LICENSE;md5=5d4950ecb7b26d2c5e4e7b4e0dd74707" - -SRC_URI += "\ - file://armhf-elf-header.patch \ - file://syslog.patch \ - file://fix-target-cc-for-build.patch \ - file://fix-cc-handling.patch \ - file://split-host-and-target-build.patch \ - file://gotooldir.patch \ - file://make-goroot-precious.patch \ - file://set-gotooldir-during-bootstrap.patch \ - file://0006-linker-add-soname-to-shareable-objects.patch \ -" -SRC_URI[main.md5sum] = "64e9380e07bba907e26a00cf5fcbe77e" -SRC_URI[main.sha256sum] = "5f5dea2447e7dcfdc50fa6b94c512e58bfba5673c039259fd843f68829d99fa6"
meta/recipes-devtools/go/go-1.8/armhf-elf-header.patch deleted +0 -23
@@ -1,23 +0,0 @@ -Encode arm EABI ( hard/soft ) calling convention in ELF header - -Signed-off-by: Khem Raj <[email protected]> -Upstream-Status: Pending -Index: go/src/cmd/link/internal/ld/elf.go -=================================================================== ---- go.orig/src/cmd/link/internal/ld/elf.go -+++ go/src/cmd/link/internal/ld/elf.go -@@ -950,7 +950,13 @@ func Elfinit(ctxt *Link) { - case sys.ARM, sys.MIPS: - if SysArch.Family == sys.ARM { - // we use EABI on linux/arm, freebsd/arm, netbsd/arm. -- if Headtype == obj.Hlinux || Headtype == obj.Hfreebsd || Headtype == obj.Hnetbsd { -+ if Headtype == obj.Hlinux { -+ if obj.GOARM == 7 { -+ ehdr.flags = 0x5000402 // has entry point, Version5 EABI, hard float -+ } else { -+ ehdr.flags = 0x5000202 // has entry point, Version5 EABI, soft float -+ } -+ } else if Headtype == obj.Hfreebsd || Headtype == obj.Hnetbsd { - // We set a value here that makes no indication of which - // float ABI the object uses, because this is information - // used by the dynamic linker to compare executables and
meta/recipes-devtools/go/go-1.8/fix-cc-handling.patch deleted +0 -50
50 lines not on this page · raw message
meta/recipes-devtools/go/go-1.8/fix-target-cc-for-build.patch deleted +0 -17
@@ -1,17 +0,0 @@ -Put Quotes around CC_FOR_TARGET since it can be mutliple words e.g. in OE - -Signed-off-by: Khem Raj <[email protected]> -Upstream-Status: Pending -Index: go/src/make.bash -=================================================================== ---- go.orig/src/make.bash 2015-07-29 13:28:11.334031696 -0700 -+++ go/src/make.bash 2015-07-29 13:36:55.814465630 -0700 -@@ -158,7 +158,7 @@ - fi - - echo "##### Building packages and commands for $GOOS/$GOARCH." --CC=$CC_FOR_TARGET "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd -+CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd - echo - - rm -f "$GOTOOLDIR"/go_bootstrap
meta/recipes-devtools/go/go-1.8/gotooldir.patch deleted +0 -30
@@ -1,30 +0,0 @@ -Define tooldir in relation to GOTOOLDIR env var - -Signed-off-by: Khem Raj <[email protected]> -Upstream-Status: Pending -Index: go/src/go/build/build.go -=================================================================== ---- go.orig/src/go/build/build.go -+++ go/src/go/build/build.go -@@ -1388,7 +1388,7 @@ func init() { - } - - // ToolDir is the directory containing build tools. --var ToolDir = filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH) -+var ToolDir = envOr("GOTOOLDIR", filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)) - - // IsLocalImport reports whether the import path is - // a local import path, like ".", "..", "./foo", or "../foo". -Index: go/src/cmd/go/build.go -=================================================================== ---- go.orig/src/cmd/go/build.go -+++ go/src/cmd/go/build.go -@@ -1312,7 +1312,7 @@ func (b *builder) build(a *action) (err - } - - cgoExe := tool("cgo") -- if a.cgo != nil && a.cgo.target != "" { -+ if a.cgo != nil && a.cgo.target != "" && os.Getenv("GOTOOLDIR") == "" { - cgoExe = a.cgo.target - } - outGo, outObj, err := b.cgo(a.p, cgoExe, obj, pcCFLAGS, pcLDFLAGS, cgofiles, gccfiles, cxxfiles, a.p.MFiles)
meta/recipes-devtools/go/go-1.8/make-goroot-precious.patch deleted +0 -21
@@ -1,21 +0,0 @@ -Prevent GOROOT-resident packages from being rebuilt - -Signed-off-by: Matt Madison <[email protected]> -Upstream-Status: Pending - ---- go.orig/src/cmd/go/pkg.go -+++ go/src/cmd/go/pkg.go -@@ -1496,6 +1496,13 @@ func isStale(p *Package) (bool, string) - return true, "build ID mismatch" - } - -+ // For OE builds, make anything in GOROOT non-stale, -+ // to prevent a package build from overwriting the -+ // build root. -+ if p.Goroot && os.Getenv("GOROOT_OVERRIDE") != "1" { -+ return false, "GOROOT-resident packages do not get rebuilt" -+ } -+ - // Package is stale if a dependency is. - for _, p1 := range p.deps { - if p1.Stale {
meta/recipes-devtools/go/go-1.8/syslog.patch deleted +0 -62
62 lines not on this page · raw message
meta/recipes-devtools/go/go-1.9.inc new file +18 -0
@@ -0,0 +1,18 @@ +require go-common.inc + +GO_BASEVERSION = "1.9" +FILESEXTRAPATHS_prepend := "${FILE_DIRNAME}/go-${GO_BASEVERSION}:" + +LIC_FILES_CHKSUM = "file://LICENSE;md5=5d4950ecb7b26d2c5e4e7b4e0dd74707" + +SRC_URI += "\ + file://0001-make.bash-quote-CC_FOR_TARGET.patch \ + file://0002-cmd-go-fix-CC-and-CXX-environment-variable-construct.patch \ + file://0003-make.bash-better-separate-host-and-target-builds.patch \ + file://0004-cmd-go-allow-GOTOOLDIR-to-be-overridden-in-the-envir.patch \ + file://0005-cmd-go-make-GOROOT-precious-by-default.patch \ + file://0006-make.bash-add-GOTOOLDIR_BOOTSTRAP-environment-variab.patch \ + file://0007-ld-add-soname-to-shareable-objects.patch \ +" +SRC_URI[main.md5sum] = "da2d44ea384076efec43ee1f8b7d45d2" +SRC_URI[main.sha256sum] = "a4ab229028ed167ba1986825751463605264e44868362ca8e7accc8be057e993"
meta/recipes-devtools/go/go-1.9/0001-make.bash-quote-CC_FOR_TARGET.patch new file +32 -0
@@ -0,0 +1,32 @@ +From d24734ad44006791fd48fc45ea34fe608ff672fb Mon Sep 17 00:00:00 2001 +From: Matt Madison <[email protected]> +Date: Wed, 13 Sep 2017 08:04:23 -0700 +Subject: [PATCH 1/7] make.bash: quote CC_FOR_TARGET + +For OE cross-builds, $CC_FOR_TARGET has more than +one word and needs to be quoted. + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <[email protected]> +Signed-off-by: Matt Madison <[email protected]> +--- + src/make.bash | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/make.bash b/src/make.bash +index 71e7531..dcf3256 100755 +--- a/src/make.bash ++++ b/src/make.bash +@@ -175,7 +175,7 @@ echo "##### Building packages and commands for $GOOS/$GOARCH." + + old_bin_files=$(cd $GOROOT/bin && echo *) + +-CC=$CC_FOR_TARGET "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd ++CC="$CC_FOR_TARGET" "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd + + # Check that there are no new files in $GOROOT/bin other than go and gofmt + # and $GOOS_$GOARCH (a directory used when cross-compiling). +-- +2.7.4 +
meta/recipes-devtools/go/go-1.9/0002-cmd-go-fix-CC-and-CXX-environment-variable-construct.patch new file +67 -0
67 lines not on this page · raw message
meta/recipes-devtools/go/go-1.9/0003-make.bash-better-separate-host-and-target-builds.patch renamed from meta/recipes-devtools/go/go-1.8/split-host-and-target-build.patch +41 -11
77 lines not on this page · raw message
meta/recipes-devtools/go/go-1.9/0004-cmd-go-allow-GOTOOLDIR-to-be-overridden-in-the-envir.patch new file +68 -0
68 lines not on this page · raw message
meta/recipes-devtools/go/go-1.9/0005-cmd-go-make-GOROOT-precious-by-default.patch new file +41 -0
41 lines not on this page · raw message
meta/recipes-devtools/go/go-1.9/0006-make.bash-add-GOTOOLDIR_BOOTSTRAP-environment-variab.patch renamed from meta/recipes-devtools/go/go-1.8/set-gotooldir-during-bootstrap.patch +20 -6
@@ -1,12 +1,23 @@ -Set GOTOOLDIR during bootstrap +From aae74d1045ca03306ba4159206ee3bac72bcdfbb Mon Sep 17 00:00:00 2001 +From: Matt Madison <[email protected]> +Date: Wed, 13 Sep 2017 08:23:23 -0700 +Subject: [PATCH 6/7] make.bash: add GOTOOLDIR_BOOTSTRAP environment variable + +For cross-canadian builds, we need to use the native +GOTOOLDIR during the bootstrap phase, so provide a way +to pass that setting into the build script. -Signed-off-by: Matt Madison <[email protected]> Upstream-Status: Pending -Index: go/src/make.bash -=================================================================== ---- go.orig/src/make.bash -+++ go/src/make.bash +Signed-off-by: Matt Madison <[email protected]> +--- + src/make.bash | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/make.bash b/src/make.bash +index 9553623..2e6fb05 100755 +--- a/src/make.bash ++++ b/src/make.bash @@ -172,10 +172,11 @@ if [ "$do_host_build" = "yes" ]; then mv cmd/dist/dist "$GOTOOLDIR"/dist echo
@@ -20,3 +31,6 @@ Index: go/src/make.bash "$GOTOOLDIR"/go_bootstrap install -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd echo fi +-- +2.7.4 +
meta/recipes-devtools/go/go-1.9/0007-ld-add-soname-to-shareable-objects.patch renamed from meta/recipes-devtools/go/go-1.8/0006-linker-add-soname-to-shareable-objects.patch +11 -9
@@ -1,22 +1,24 @@ -From 81e9e322297d83f57f02548689c71859bfce10ee Mon Sep 17 00:00:00 2001 +From e957c3458d53e37bf416f51d2f8bf54c195e50f5 Mon Sep 17 00:00:00 2001 From: Matt Madison <[email protected]> -Date: Sun, 15 Jan 2017 05:24:49 -0800 -Subject: [PATCH 6/6] linker: add soname to shareable objects +Date: Wed, 13 Sep 2017 08:27:02 -0700 +Subject: [PATCH 7/7] ld: add soname to shareable objects -Shared library handling in OE builds works better when shared -libraries are tagged with SONAMEs. +Shared library handling in OE depends on the inclusion +of an soname header, so update the go linker to add that +header for both internal and external linking. Upstream-Status: Pending + Signed-off-by: Matt Madison <[email protected]> --- src/cmd/link/internal/ld/lib.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go -index 74d79d3..6d03005 100644 +index 0234105..0b9e2d0 100644 --- a/src/cmd/link/internal/ld/lib.go +++ b/src/cmd/link/internal/ld/lib.go -@@ -1040,12 +1040,14 @@ func (l *Link) hostlink() { +@@ -1124,12 +1124,14 @@ func (l *Link) hostlink() { // Pass -z nodelete to mark the shared library as // non-closeable: a dlclose will do nothing. argv = append(argv, "-shared", "-Wl,-z,nodelete")
@@ -29,9 +31,9 @@ index 74d79d3..6d03005 100644 argv = append(argv, "-shared") + argv = append(argv, fmt.Sprintf("-Wl,-soname,%s", filepath.Base(*flagOutfile))) case BuildmodePlugin: - if Headtype == obj.Hdarwin { + if Headtype == objabi.Hdarwin { argv = append(argv, "-dynamiclib") -@@ -1054,6 +1056,7 @@ func (l *Link) hostlink() { +@@ -1138,6 +1140,7 @@ func (l *Link) hostlink() { argv = append(argv, "-Wl,-z,relro") } argv = append(argv, "-shared")
meta/recipes-devtools/go/go-cross-canadian.inc +1 -0
@@ -52,6 +52,7 @@ do_install() { (cd ${S}/src; for d in *; do \ [ -d $d ] && cp --preserve=mode,timestamps -R ${S}/src/$d ${D}${libdir}/go/src/; \ done) + rm -rf ${D}${libdir}/go/src/runtime/pprof/testdata install -d ${D}${bindir} ${D}${libdir}/go/bin for f in ${B}/bin/* do
meta/recipes-devtools/go/go-cross-canadian_1.9.bb renamed from meta/recipes-devtools/go/go-cross-canadian_1.8.bb +0 -0
meta/recipes-devtools/go/go-cross.inc +1 -1
@@ -49,7 +49,7 @@ do_install() { (cd ${S}/src; for d in *; do \ [ ! -d $d ] || cp --preserve=mode,timestamps -R ${S}/src/$d ${D}${libdir}/go/src/; \ done) - + rm -rf ${D}${libdir}/go/src/runtime/pprof/testdata install -d ${D}${bindir} ${D}${libdir}/go/bin for f in ${B}/bin/* do
meta/recipes-devtools/go/go-cross_1.9.bb renamed from meta/recipes-devtools/go/go-cross_1.8.bb +0 -0
meta/recipes-devtools/go/go-crosssdk_1.9.bb renamed from meta/recipes-devtools/go/go-crosssdk_1.8.bb +0 -0
meta/recipes-devtools/go/go-native.inc +1 -1
@@ -51,7 +51,7 @@ do_install() { (cd ${S}/src; for d in *; do \ [ -d $d ] && cp -a ${S}/src/$d ${D}${libdir}/go/src/; \ done) - + rm -rf ${D}${libdir}/go/src/runtime/pprof/testdata install -d ${D}${bindir} ${D}${libdir}/go/bin for f in ${B}/bin/* do
meta/recipes-devtools/go/go-native_1.9.bb renamed from meta/recipes-devtools/go/go-native_1.8.bb +0 -0
meta/recipes-devtools/go/go-runtime_1.9.bb renamed from meta/recipes-devtools/go/go-runtime_1.8.bb +0 -0
meta/recipes-devtools/go/go_1.9.bb renamed from meta/recipes-devtools/go/go_1.8.bb +0 -0
Signature · 1 line
2.14.1