[Buildroot] [PATCH 3/3] package/runc: disable for static only build

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Fri Jul 8 19:47:12 UTC 2016


On Thu,  7 Jul 2016 20:39:37 +0200, Romain Naour wrote:
> When build statically, runc try to link against Scrt1.o which is not
> provided by a toolchain for static build only.
> [...]arm-buildroot-linux-uclibcgnueabi/bin/ld: cannot find Scrt1.o: No such file or directory
> collect2: error: ld returned 1 exit status
> Add the reverse dependency on docker-containerd.
> Remove the static case handling for runc.
> Signed-off-by: Romain Naour <romain.naour at gmail.com>
> Cc: Christian Stewart <christian at paral.in>

I believe this only happens on ARM, because on ARM, Go forces the use
of -pie, for some reason:

        pie := (goarch == "arm" && goos == "linux") || goos == "android"
        if pie { // we need to use -pie for Linux/ARM to get accurate imported sym
                cgoLDFLAGS = append(cgoLDFLAGS, "-pie")

And static linking + PIE isn't supported by uClibc. But on
architectures other than ARM, I believe Go doesn't use -pie, so static
linking with uClibc should work (remains to be tested, though).

For this reason, I believe your patch is not correct as it disables Go
packages for static linking on all architectures, while only ARM is
affected by this problem.

This is yet another situation which makes me think we should add a
"BR2_TOOLCHAIN_SUPPORTS_PIE" hidden boolean.

Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering

More information about the buildroot mailing list