[oe] [PATCH v3] cpan_build.bbclass; added cc and ld flags to the perl Build.PL invocation

Frans Meulenbroeks fransmeulenbroeks at gmail.com
Tue Dec 28 18:23:39 UTC 2010


2010/12/27 Roman I Khimov <roman at khimov.ru>:
> В сообщении от Понедельник 27 декабря 2010 20:11:07 автор Frans Meulenbroeks написал:
>> Without these gcc would be used which resolves to /usr/bin/gcc
>> and one gets an intel exe.
>> This showed up with libparams-validate-perl and libdatetime-perl
>> The LDFLAGS are added to resolve the GNU_HASH QA error
>>
>> Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks at gmail.com>
>> ---
>>  classes/cpan_build.bbclass     |    1 +
>>  1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/classes/cpan_build.bbclass b/classes/cpan_build.bbclass
>> index d1bbc4f..070e061 100644
>> --- a/classes/cpan_build.bbclass
>> +++ b/classes/cpan_build.bbclass
>> @@ -26,6 +26,7 @@ cpan_build_do_configure () {
>>               # build for target
>>               . ${STAGING_LIBDIR}/perl/config.sh
>>               perl Build.PL --installdirs vendor \
>> +                     --config cc="${CC} ${LDFLAGS}" --config ld="${CCLD} ${LDFLAGS}"
>>  \ --destdir ${D} \
>>                       --install_path lib="${datadir}/perl5" \
>>                       --install_path arch="${libdir}/perl5" \
>>
>
> Seems strange to me. ${STAGING_LIBDIR}/perl/config.sh for example:
>
> rik at kettle:oe-arm$ cat tmp/sysroots/armv5te-angstrom-linux-gnueabi/usr/lib/perl/config.sh | grep -E "^(cc=|ld=|ldflags=)"
> cc="arm-angstrom-linux-gnueabi-gcc -march=armv5te -mtune=arm926ej-s -mthumb-interwork -mno-thumb"
> ld="arm-angstrom-linux-gnueabi-gcc -march=armv5te -mtune=arm926ej-s -mthumb-interwork -mno-thumb"
> ldflags="-L/storage/work/oe/oe-arm/tmp/sysroots/armv5te-angstrom-linux-gnueabi/usr/lib -Wl,-rpath-link,/storage/work/oe/oe-arm/tmp/sysroots/armv5te-angstrom-linux-gnueabi/usr/lib -Wl,-O1 -Wl,--hash-style=gnu"

Comparing notes: I have:

frans at linux-suse:~/oe> cat
tmp_minimal/sysroots/armv5te-oe-linux-gnueabi/usr/lib/perl/config.sh |
grep -E "^(cc=|ld=|ldflags=)"
cc="arm-oe-linux-gnueabi-gcc -march=armv5te -mtune=arm926ej-s
-mthumb-interwork -mthumb"
ld="arm-oe-linux-gnueabi-gcc -march=armv5te -mtune=arm926ej-s
-mthumb-interwork -mthumb"
ldflags="-Wl,-O1 -Wl,--hash-style=gnu"

Note the different definition of ldflags. (no -L ) and the -mthumb
versus -mno-thumb.

Btw I am using libtool 2.4 with systool support (should that matter)

>
> Same definitions in Config_heavy. It should be working without that. I've

Should I have this file in sysroots/armv5te....  ?
I only have
frans at linux-suse:~/oe/tmp_minimal/sysroots> find | grep heavy
./i686-linux/usr/lib/perl/5.10.1/Config_heavy.pl
./i686-linux/usr/lib/perl/5.10.1/utf8_heavy.pl
./i686-linux/usr/lib/perl/5.10.1/Config_heavy-target.pl
./i686-linux/usr/lib/perl/5.10.1/bytes_heavy.pl
./armv5te-oe-linux-gnueabi/usr/share/mysql/my-innodb-heavy-4G.cnf
./armv7a-oe-linux-gnueabi/usr/share/mysql/my-innodb-heavy-4G.cnf

And Config_heavy.pl says:
frans at linux-suse:~/oe/tmp_minimal/sysroots> grep -E
"^(cc=|ld=|ldflags=)" ./i686-linux/usr/lib/perl/5.10.1/Config_heavy.pl
cc='gcc '
ld='gcc '
ldflags='-L/home/frans/oe/tmp_minimal/sysroots/i686-linux/usr/lib
-Wl,-rpath-link,/home/frans/oe/tmp_minimal/sysroots/i686-linux/usr/lib
-Wl,-rpath,/home/frans/oe/tmp_minimal/sysroots/i686-linux/usr/lib
-Wl,-O1 -fstack-protector -L/usr/local/lib'


> just built it here for qemuarm (with Angstrom distro) and seems to be OK:
>
> rik at kettle:oe-arm$ ./tmp/sysroots/x86_64-linux/usr/armv5te/bin/arm-angstrom-linux-gnueabi-objdump -f tmp/work/armv5te-angstrom-linux-gnueabi/libdatetime-perl-0.61-r1/image/usr/lib/perl5/auto/DateTime/DateTime.so
>
> tmp/work/armv5te-angstrom-linux-gnueabi/libdatetime-perl-0.61-r1/image/usr/lib/perl5/auto/DateTime/DateTime.so:     file format elf32-littlearm
> architecture: arm, flags 0x00000150:
> HAS_SYMS, DYNAMIC, D_PAGED
> start address 0x00000c94
>

Will try a compile test later.

Frans




More information about the Openembedded-devel mailing list