Re: [PATCH 51/73] db: Use cross libtool

Khem Raj
2016-01-22T17:09:09Z

On Fri, Jan 22, 2016 at 4:41 AM, Burton, Ross <ross.burton@intel.com> wrote:
>
> On 17 January 2016 at 11:36, Khem Raj <raj.khem@gmail.com> wrote:
>>
>> db is not reconfigured like usual autotools based components so it
>> generates its own libtool, and this libtool is not equipped to do cross
>> builds, e.g. when building using clang on musl, it misdirects linker to
>> use libstdc++.so from build host instead of target, the reason being it
>> does not understand sysroot.
>>
>> Use cross libtool instead to build the target versions
>>
>> Fixes errors like below
>>
>> | libtool: link: arm-oe-linux-musleabi-ranlib .libs/libdb-6.0.a
>> |
>>
>> /a/builder/mnt/build-oe/tmp-musl/sysroots/x86_64-linux/usr/bin/arm-oe-linux-musleabi/arm-oe-linux-musleabi-ld:
>> error: /usr/lib/libstdc++.so: incompatible target
>
>
> This fails to build on the autobuilder in poky-lsb configurations (which
> turns on securityflags.inc):
>
> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-world-lsb/build/build/tmp/sysroots/qemux86/usr/lib/libc_nonshared.a(elf-init.oS):
> In function `__libc_csu_init':
> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-world-lsb/build/build/tmp/work/i586-poky-linux/glibc/2.22-r0/git/csu/elf-init.c:87:
> undefined reference to `__init_array_start'
> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-world-lsb/build/build/tmp/sysroots/x86_64-linux/usr/libexec/i586-poky-linux/gcc/i586-poky-linux/5.3.0/ld:
> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-world-lsb/build/build/tmp/sysroots/qemux86/usr/lib/libc_nonshared.a(elf-init.oS):
> relocation R_386_GOTOFF against undefined hidden symbol `__init_array_start'

You can drop this one from this patch set I will submit it another
time after finding the cause and fix.
I need to reproduce it locally here. I think the issue might be that
the makefiles are calling linker directly which works
in common cases but not when -pie is used. Do you have full errors log
somewhere to look into ?

> can not be used when making a shared object
> /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-world-lsb/build/build/tmp/sysroots/x86_64-linux/usr/libexec/i586-poky-linux/gcc/i586-poky-linux/5.3.0/ld:
> final link failed: Bad value
> collect2: error: ld returned 1 exit status
> Makefile:884: recipe for target 'libdb_cxx-6.0.la' failed
>
> Ross