mirror of
https://git.yoctoproject.org/poky
synced 2026-09-24 22:36:21 +02:00
go-native: remove dependency on go-bootstrap-native
The go1.4 toolchain is only required for bootstrapping go-native, and should not be used for anything else, so build it as part of the go-native build. This way, we don't have to carry around its built artifacts in the native sysroot. The go-cross and target toolchains can then just depend on go-native, using that for their 'bootstrap' toolchain. Also removed some unnecessary package-related noexec settings, since native recipes inherit nopackages. (From OE-Core rev: 9dc9d457fb9a456bc18c7789b91f40e1f6a999fe) Signed-off-by: Matt Madison <matt@madison.systems> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
7fd27e8e33
commit
4a11f8e98c
@@ -15,5 +15,5 @@ SRC_URI += "\
|
|||||||
file://split-host-and-target-build.patch \
|
file://split-host-and-target-build.patch \
|
||||||
file://gotooldir.patch \
|
file://gotooldir.patch \
|
||||||
"
|
"
|
||||||
SRC_URI[md5sum] = "64e9380e07bba907e26a00cf5fcbe77e"
|
SRC_URI[main.md5sum] = "64e9380e07bba907e26a00cf5fcbe77e"
|
||||||
SRC_URI[sha256sum] = "5f5dea2447e7dcfdc50fa6b94c512e58bfba5673c039259fd843f68829d99fa6"
|
SRC_URI[main.sha256sum] = "5f5dea2447e7dcfdc50fa6b94c512e58bfba5673c039259fd843f68829d99fa6"
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ LICENSE = "BSD-3-Clause"
|
|||||||
|
|
||||||
inherit goarch
|
inherit goarch
|
||||||
|
|
||||||
SRC_URI = "http://golang.org/dl/go${PV}.src.tar.gz"
|
SRC_URI = "http://golang.org/dl/go${PV}.src.tar.gz;name=main"
|
||||||
S = "${WORKDIR}/go"
|
S = "${WORKDIR}/go"
|
||||||
B = "${S}"
|
B = "${S}"
|
||||||
|
|
||||||
|
|||||||
@@ -1,16 +1,28 @@
|
|||||||
|
# Use immediate assingment here to get the original (/usr/lib)
|
||||||
|
# instead of the one rewritten by native.bbclass.
|
||||||
|
nonstaging_libdir := "${libdir}"
|
||||||
|
|
||||||
inherit native
|
inherit native
|
||||||
|
|
||||||
BOOTSTRAP ?= ""
|
SRC_URI_append = " http://golang.org/dl/go1.4.3.src.tar.gz;name=bootstrap;subdir=go1.4"
|
||||||
|
SRC_URI[bootstrap.md5sum] = "dfb604511115dd402a77a553a5923a04"
|
||||||
|
SRC_URI[bootstrap.sha256sum] = "9947fc705b0b841b5938c48b22dc33e9647ec0752bae66e50278df4f23f64959"
|
||||||
|
|
||||||
export GOOS = "${BUILD_GOOS}"
|
export GOOS = "${BUILD_GOOS}"
|
||||||
export GOARCH = "${BUILD_GOARCH}"
|
export GOARCH = "${BUILD_GOARCH}"
|
||||||
export GOROOT_FINAL = "${STAGING_LIBDIR_NATIVE}/go${BOOTSTRAP}"
|
CC = "${@d.getVar('BUILD_CC', True).strip()}"
|
||||||
export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go1.4"
|
|
||||||
export CGO_ENABLED = "1"
|
export CGO_ENABLED = "1"
|
||||||
|
|
||||||
do_configure[noexec] = "1"
|
do_configure() {
|
||||||
|
cd ${WORKDIR}/go1.4/go/src
|
||||||
|
CGO_ENABLED=0 GOROOT=${WORKDIR}/go1.4/go ./make.bash
|
||||||
|
}
|
||||||
|
|
||||||
do_compile() {
|
do_compile() {
|
||||||
export GOBIN="${B}/bin"
|
export GOBIN="${B}/bin"
|
||||||
|
export GOROOT_FINAL="${nonstaging_libdir}/go"
|
||||||
|
export GOROOT_BOOTSTRAP="${WORKDIR}/go1.4/go"
|
||||||
rm -rf ${GOBIN}
|
rm -rf ${GOBIN}
|
||||||
mkdir ${GOBIN}
|
mkdir ${GOBIN}
|
||||||
|
|
||||||
@@ -18,7 +30,7 @@ do_compile() {
|
|||||||
mkdir -p ${WORKDIR}/build-tmp
|
mkdir -p ${WORKDIR}/build-tmp
|
||||||
|
|
||||||
cd src
|
cd src
|
||||||
CGO_ENABLED=0 ./make.bash --host-only
|
./make.bash --host-only
|
||||||
}
|
}
|
||||||
|
|
||||||
make_wrapper() {
|
make_wrapper() {
|
||||||
@@ -26,31 +38,25 @@ make_wrapper() {
|
|||||||
cat <<END >${D}${bindir}/$2$3
|
cat <<END >${D}${bindir}/$2$3
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
here=\`dirname \$0\`
|
here=\`dirname \$0\`
|
||||||
export GOROOT="${GOROOT:-\`readlink -f \$here/../lib/go$3\`}"
|
export GOROOT="${GOROOT:-\`readlink -f \$here/../lib/go\`}"
|
||||||
\$here/../lib/go$3/bin/$1 "\$@"
|
\$here/../lib/go/bin/$1 "\$@"
|
||||||
END
|
END
|
||||||
chmod +x ${D}${bindir}/$2$3
|
chmod +x ${D}${bindir}/$2
|
||||||
}
|
}
|
||||||
|
|
||||||
do_install() {
|
do_install() {
|
||||||
install -d ${D}${libdir}/go${BOOTSTRAP}
|
install -d ${D}${libdir}/go
|
||||||
cp -a ${B}/pkg ${D}${libdir}/go${BOOTSTRAP}/
|
cp --preserve=mode,timestamps -R ${B}/pkg ${D}${libdir}/go/
|
||||||
install -d ${D}${libdir}/go${BOOTSTRAP}/src
|
install -d ${D}${libdir}/go/src
|
||||||
(cd ${S}/src; for d in *; do \
|
(cd ${S}/src; for d in *; do \
|
||||||
[ -d $d ] && cp -a ${S}/src/$d ${D}${libdir}/go${BOOTSTRAP}/src/; \
|
[ -d $d ] && cp -a ${S}/src/$d ${D}${libdir}/go/src/; \
|
||||||
done)
|
done)
|
||||||
|
|
||||||
install -d ${D}${bindir} ${D}${libdir}/go${BOOTSTRAP}/bin
|
install -d ${D}${bindir} ${D}${libdir}/go/bin
|
||||||
for f in ${B}/bin/*
|
for f in ${B}/bin/*
|
||||||
do
|
do
|
||||||
base=`basename $f`
|
base=`basename $f`
|
||||||
install -m755 $f ${D}${libdir}/go${BOOTSTRAP}/bin
|
install -m755 $f ${D}${libdir}/go/bin
|
||||||
make_wrapper $base $base ${BOOTSTRAP}
|
make_wrapper $base $base
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
do_package[noexec] = "1"
|
|
||||||
do_packagedata[noexec] = "1"
|
|
||||||
do_package_write_ipk[noexec] = "1"
|
|
||||||
do_package_write_deb[noexec] = "1"
|
|
||||||
do_package_write_rpm[noexec] = "1"
|
|
||||||
|
|||||||
@@ -1,3 +1,2 @@
|
|||||||
require ${PN}.inc
|
require ${PN}.inc
|
||||||
require go-${PV}.inc
|
require go-${PV}.inc
|
||||||
DEPENDS += "go-bootstrap-native"
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
inherit goarch
|
inherit goarch
|
||||||
DEPENDS += "go-bootstrap-native"
|
DEPENDS += "go-native"
|
||||||
|
|
||||||
# libgcc is required for the target specific libraries to build
|
# libgcc is required for the target specific libraries to build
|
||||||
# properly, but apparently not for go-cross and, more importantly,
|
# properly, but apparently not for go-cross and, more importantly,
|
||||||
@@ -17,7 +17,7 @@ export GOHOSTARCH = "${BUILD_GOARCH}"
|
|||||||
export GOOS = "${TARGET_GOOS}"
|
export GOOS = "${TARGET_GOOS}"
|
||||||
export GOARCH = "${TARGET_GOARCH}"
|
export GOARCH = "${TARGET_GOARCH}"
|
||||||
export GOARM = "${TARGET_GOARM}"
|
export GOARM = "${TARGET_GOARM}"
|
||||||
export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go1.4"
|
export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
|
||||||
export GOROOT_FINAL = "${libdir}/go"
|
export GOROOT_FINAL = "${libdir}/go"
|
||||||
export CGO_ENABLED = "1"
|
export CGO_ENABLED = "1"
|
||||||
export CC_FOR_TARGET = "${CC}"
|
export CC_FOR_TARGET = "${CC}"
|
||||||
|
|||||||
Reference in New Issue
Block a user