[meta-virtualization] [PATCH] Revert "runc: Don't override GOARCH or GOROOT"
Paul Barker
pbarker at toganlabs.com
Mon Oct 9 16:30:33 PDT 2017
On Tue, Oct 10, 2017 at 12:02 AM, Bruce Ashfield
<bruce.ashfield at gmail.com> wrote:
> On Mon, Oct 9, 2017 at 5:56 PM, Paul Barker <pbarker at toganlabs.com> wrote:
>> On Mon, Oct 9, 2017 at 8:54 PM, Aníbal Limón <limon.anibal at gmail.com> wrote:
>>> From: Aníbal Limón <anibal.limon at linaro.org>
>>>
>>> This reverts commit fdee07aadc1b5224a540c7e8893144207e1979cb.
>>>
>>> Causes build failures when is cross-compiling to aarch64,
>>>
>>> | CGO_ENABLED=1 aarch64-linaro-linux-go build -i -tags " cgo static_build" -ldflags "-w -extldflags -static -X main.gitCommit="9d6821d1b53908e249487741eccd567249ca1d99-dirty" -X main.version=1.0.0-rc3 " -o runc .
>>> ...
>>> | /home/anibal.limon/linaro/oe-rpb-master/build-rpb/tmp-rpb-glibc/work/aarch64-linaro-linux/runc-docker/1.0.0-rc3+gitINVALID-r0/recipe-sysroot-native/usr/lib/aarch64-linaro-linux/go/pkg/tool/linux_amd64/link: running aarch64-linaro-linux-gcc failed: exit status 1
>>> | /home/anibal.limon/linaro/oe-rpb-master/build-rpb/tmp-rpb-glibc/work/aarch64-linaro-linux/runc-docker/1.0.0-rc3+gitINVALID-r0/recipe-sysroot-native/usr/bin/aarch64-linaro-linux/../../libexec/aarch64-linaro-linux/gcc/aarch64-linaro-linux/7.1.1/ld: cannot find crt1.o: No such file or directory
>>> | /home/anibal.limon/linaro/oe-rpb-master/build-rpb/tmp-rpb-glibc/work/aarch64-linaro-linux/runc-docker/1.0.0-rc3+gitINVALID-r0/recipe-sysroot-native/usr/bin/aarch64-linaro-linux/../../libexec/aarch64-linaro-linux/gcc/aarch64-linaro-linux/7.1.1/ld: cannot find crti.o: No such file or directory
>>> | /home/anibal.limon/linaro/oe-rpb-master/build-rpb/tmp-rpb-glibc/work/aarch64-linaro-linux/runc-docker/1.0.0-rc3+gitINVALID-r0/recipe-sysroot-native/usr/bin/aarch64-linaro-linux/../../libexec/aarch64-linaro-linux/gcc/aarch64-linaro-linux/7.1.1/ld: cannot find crtbeginT.o: No such file or directory
>>> ...
>>>
>>> Signed-off-by: Aníbal Limón <anibal.limon at linaro.org>
>>> ---
>>> recipes-containers/runc/runc.inc | 3 +++
>>> 1 file changed, 3 insertions(+)
>>>
>>> diff --git a/recipes-containers/runc/runc.inc b/recipes-containers/runc/runc.inc
>>> index b1f2ba8..83d5f86 100644
>>> --- a/recipes-containers/runc/runc.inc
>>> +++ b/recipes-containers/runc/runc.inc
>>> @@ -21,6 +21,8 @@ EXTRA_OEMAKE="BUILDTAGS=''"
>>> inherit goarch
>>>
>>> do_compile() {
>>> + export GOARCH="${TARGET_GOARCH}"
>>> + export GOROOT="${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go"
>>> # Set GOPATH. See 'PACKAGERS.md'. Don't rely on
>>> # docker to download its dependencies but rather
>>> # use dependencies packaged independently.
>>> @@ -32,6 +34,7 @@ do_compile() {
>>>
>>> (cd .gopath/src/${dname}; ln -sf ../../../../../${bname} ${bname})
>>> export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go"
>>> + export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go"
>>>
>>> # Fix up symlink for go-cross compiler
>>> rm -f ${S}/src/import/vendor/src
>>
>> It seems like we have conflicting changes :( Reverting this patch will
>> break cross-compilation of runc-opencontainers for x86-64 with musl
>> libc again.
>>
>> I'll try cross-compiling both runc variants for arm, aarch64, x86 and
>> x86-64 and see if I can find a solution that works for everything.
>>
>
> Agreed.
>
> I'll hold off on any revert until I hear from your tests.
>
> For the configs I'm using everything is building with the current set
> of changes.
>
> Bruce
>
I can re-produce the failure by building runc-docker for
raspberrypi3-64. However, runc-opencontainers builds successfully for
raspberrypi3-64. So at worst we can add a do_compile_prepend() in the
recipe for runc-docker (but not the common .inc file). However, the
whole thing looks wrong, GOROOT shouldn't be pointing at the native
sysroot at all. There's probably something strange going on in the
runc-docker makefile.
I'm away for the next couple of days but will then get back to this.
Cheers,
--
Paul Barker
Togán Labs Ltd
More information about the meta-virtualization
mailing list