[OE-core] [PATCH v2] cross-canadian/libgcc: fix aarch64's multilib SDK

Khem Raj raj.khem at gmail.com
Fri Jul 27 03:30:43 UTC 2018



On 7/25/18 1:04 AM, Robert Yang wrote:
> Hi Maohui,
> 
> Thanks for sending it, I do think that oe-core needs this patch.
> 
> // Robert
> 
> On 06/26/2018 06:27 AM, Lei Maohui wrote:
>> The arm toolchain has a "-gnueabi" suffix, but aarch64 doesn't,
>> this makes multilib sdk doesn't work, there will be error as following:
>>
>> .../usr/libexec/armeb-poky-linux-gux-linux-gnueabi/7.3.0/real-ld:
>> cannot find crtbeginS.o: No such file or directo
>> .../usr/libexec/armeb-poky-linux-gux-linux-gnueabi/7.3.0/real-ld:
>> cannot find -lgcc
>> .../usr/libexec/armeb-poky-linux-gux-linux-gnueabi/7.3.0/real-ld:
>> cannot find -lgcc
>> collect2: error: ld returned 1 exit status
>>

Please test this patch with musl target preferably arm/aarch64
and also ppc/glibc by generating SDKs

>> Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
>> Signed-off-by: Lei Maohui <leimaohui at cn.fujitsu.com>
>> ---
>>   meta/recipes-devtools/gcc/libgcc-common.inc | 23
>> +++++++++++++++++------
>>   1 file changed, 17 insertions(+), 6 deletions(-)
>>
>> diff --git a/meta/recipes-devtools/gcc/libgcc-common.inc
>> b/meta/recipes-devtools/gcc/libgcc-common.inc
>> index 848a476..a49fc98 100644
>> --- a/meta/recipes-devtools/gcc/libgcc-common.inc
>> +++ b/meta/recipes-devtools/gcc/libgcc-common.inc
>> @@ -145,11 +145,22 @@ fakeroot python do_extra_symlinks() {
>>       if bb.data.inherits_class('nativesdk', d):
>>           return
>>   -    targetsys = d.getVar('BASETARGET_SYS')
>> +    base_targetsys = d.getVar('BASETARGET_SYS')
>> +    targetsys = d.getVar('TARGET_SYS')
>> +
>> +    if base_targetsys != targetsys:
>> +        dest = d.getVar('D') + d.getVar('libdir') + '/' + base_targetsys
>> +        dest_list = [dest]
>> +        # For multilib like aarch64 + arm, need 2 symlinks:
>> +        # 1) BASETARGET_SYS as usual
>> +        # 2) BASETARGET_SYS + "-gnueabi" for multilib
>> +        libce = d.getVar('LIBCEXTENSION')
>> +        abie = d.getVar('ABIEXTENSION')
>> +        if abie and libce and targetsys.endswith(libce + abie):
>> +            dest_list.append(dest + libce + abie)
>> +        src = targetsys
>> +        for dir in dest_list:
>> +            if not os.path.lexists(dir) and
>> os.path.lexists(d.getVar('D', True) + d.getVar('libdir', True)):
>> +                os.symlink(src, dir)
>>   -    if targetsys != d.getVar('TARGET_SYS'):
>> -        dest = d.getVar('D') + d.getVar('libdir') + '/' + targetsys
>> -        src = d.getVar('TARGET_SYS')
>> -        if not os.path.lexists(dest) and
>> os.path.lexists(d.getVar('D') + d.getVar('libdir')):
>> -            os.symlink(src, dest)
>>   }
>>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: OpenPGP digital signature
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20180726/a4dbc450/attachment-0002.sig>


More information about the Openembedded-core mailing list