[OE-core] Go runtime host contamination

Paul Barker pbarker at toganlabs.com
Thu Oct 5 12:52:36 UTC 2017


On Thu, Sep 28, 2017 at 10:22 PM, Matt Madison <matt at madison.systems> wrote:
> On Thu, Sep 28, 2017 at 10:28 AM, Paul Barker <pbarker at toganlabs.com> wrote:
>> Hey,
>>
>> I'm trying to upgrade runc-opencontainers in meta-virtualization to
>> v1.0.0-rc4 and hitting a host contamination issue.
>>
>> Both host and target are x86-64 but I'm using glibc on the host
>> (Ubuntu 16.04) and musl on the target. I'm getting link failures
>> referring to missing symbols "__vfprintf_chk" and "__fprintf_chk" in
>> libcontainer. I'm pretty sure these symbols exist in glibc but not in
>> musl.
>>
>> The failure is occurring when trying to link libcontainer which uses
>> the go extension cgo to incorporate some c code in with the go code.
>>
>> Using a pretty dumb grep, I can see the contamination in the go-runtime package:
>>
>>     $ grep -r __fprintf_chk
>> tmp/work/core2-64-oe-linux-musl/go-runtime/1.9-r0/image/
>>     Binary file
>> tmp/work/core2-64-oe-linux-musl/go-runtime/1.9-r0/image/usr/lib/go/src/host-tools/trace
>> matches
>>     Binary file
>> tmp/work/core2-64-oe-linux-musl/go-runtime/1.9-r0/image/usr/lib/go/src/host-tools/pprof
>> matches
>>     Binary file
>> tmp/work/core2-64-oe-linux-musl/go-runtime/1.9-r0/image/usr/lib/go/pkg/linux_amd64/runtime/cgo.a
>> matches
>
> Yep, I see what's going on here.  I have a patch in the works to take
> care of it.
>

Right, with a detour via the innards of the go linker I've finally
spotted the problem here.

The recipe in question is overriding GOROOT in the do_compile stage to
point at recipe-sysroot-native.

With that fixed, and Matt's latest patch on the oe-core mailing list
applied, runc-opencontainers now builds as expected for qemux86-64.

Cheers,

-- 
Paul Barker
Togán Labs Ltd



More information about the Openembedded-core mailing list