[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: cross build support in perl 5.22.1-7



On 2016-02-08 23:18 +0200, Niko Tyni wrote:
> On Mon, Jan 25, 2016 at 11:14:10PM +0200, Niko Tyni wrote:
> 
> > If the proposed arch-dep perl-config-data package isn't useful for actual
> > cross builds, I guess we could also just store the generated config.sh
> > files in libperl5.22.  In the short term, we could easily just start
> > doing that straight away in sid to get this going.
> 
> Update: we ended up going for simplicity and ditched perl-config-data
> in favour of copying the config.sh files into the source package.
> 
> We'll see if this becomes too much of a maintenance burden; hopefully not.
> 
> So 5.22.1-7 (just uploaded) in unstable could/should be cross buildable
> on these architectures:
> 
>   * Add cross build support files for amd64, i386, powerpc, ppc64el, armel,
>     armhf, arm64, s390x, mipsel, mips64el, kfreebsd-amd64 and kfreebsd-i386.
> 
> See debian/cross/README et al.
> 
> More can be added, preferably via bug reports. I'll add the remaining
> debian-ports architectures myself for the next upload once their
> autobuilders are done with this one.
> 
> Success/failure stories welcome.

OK. So I had a new arch, botstrapped as far as perl (arm64ilp32) so it was time to try this out.

I made a new debian/cross/arm64ilp32/config.sh.static (and
config.sh.shared and config.sh.debug, and patches for those) (by using
helmut's genconfig.sh script which was very handy, combined with
copying in the missing bits from the arm64 and x32 configs, and
generating a couple of others (cppsysmbols, i_quadmath)).  I have some
(ugly! but functional) patches for genconfig.sh to make it more
complete, and I reckon it could fill in some more of the values with a
bit more effort.

So, there may be bugs in my config(s), but it(they) might be right,
and should at least be close. 

It's not clear from debian/cross/README if any special procedures are needed so I just tried:
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -aarm64ilp32
That fails with:
aarch64-linux-gnu_ilp32-gcc -c -DPERL_CORE -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fdebug-prefix-map=/=. -fstack-protector-strong -Wformat -Werror=format-security -fwrapv -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -std=c89 -O2 -g -Wall -Werror=declaration-after-statement -Wextra -Wc++-compat -Wwrite-strings generate_uudmap.c
aarch64-linux-gnu_ilp32-gcc -o generate_uudmap -Wl,-z,relro -fstack-protector-strong -L/usr/local/lib generate_uudmap.o -ldl -lm -lpthread -lc -lcrypt
./generate_uudmap uudmap.h bitcount.h mg_data.h
./generate_uudmap: 1: ./generate_uudmap: Syntax error: "(" unexpected
Makefile:340: recipe for target 'bitcount.h' failed
make[1]: *** [bitcount.h] Error 2
make[1]: Leaving directory '/tmp/buildd/perl/perl-5.24.1'
debian/rules:124: recipe for target 'perl.static' failed

It seems to me that if generate_uudmap is to be run when crossing then
it needs to be built for the BUILD arch, not the HOST arch. Am I misunderstanding what's going on here?

Is there anything special I should be doing to build a minimal perl, or to initialise the cross setup?

If I'm on the right lines, I'll prod some more. 

One confusing thing:
If I run the failed command manually I get a more 'realistic' error:
$ ./generate_uudmap uudmap.h bitcount.h mg_data.h
-bash: ./generate_uudmap: cannot execute binary file: Exec format error

which makes sense because:
$ file /tmp/buildd/perl/perl-5.24.1/generate_uudmap
/tmp/buildd/perl/perl-5.24.1/generate_uudmap: ELF 32-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64_ilp32.so.1, for GNU/Linux 3.19.0, BuildID[sha1]=720d90f0810aa2fa1897a41eb4586d1b1332221b, not stripped

So why the: 'Syntax error: "(" unexpected' above?

Wookey
-- 
Principal hats:  Linaro, Debian, Wookware, ARM
http://wookware.org/

Attachment: signature.asc
Description: Digital signature


Reply to: