perl: build with perlcross instead of qemu
PATCH 1/1 perl: build with perlcross instead of qemu
The perlcross project makes it possible to properly cross-compile perl. It creates a host-miniperl that is configured for the target and uses that to cross-compile the perl modules.
Unfortunately there are still a few hacks needed to make it work. Proper fixes can be developed and upstreamed later.
Since there is no longer a dependency on qemu, it works on all architectures again.
Also removed some config options:
- BR2_PACKAGE_PERL_CUSTOM_INSTALL just allows a selection of modules; this can also be encoded by an empty BR2_PACKAGE_PERL_MODULES.
- BR2_PACKAGE_PERL_DB_FILE and BR2_PACKAGE_PERL_GDBM_FILE can be derived automatically from the package configs.
---
This is still a bit RFC. I've tested in on a glibc x86_64, on a minimal internal powerpc and a glibc ARM. I haven't tested with any of the autobuilder configurations, but I expect it will at least be better than what we get now...
Francois, can you check if it also runs? I've only done build tests.
Peter, if Francois confirms that the perl binary actually runs and if he has no other concerns, then I'd commit this patch quickly and wait for the autobuilder fallout.
package/perl/Config.in | 40 +++---------- package/perl/perl.mk | 153 ++++++++++++++++++++---------------------------- 2 files changed, 71 insertions(+), 122 deletions(-)
package/perl/Config.in +8 -32
@@ -1,12 +1,5 @@ config BR2_PACKAGE_PERL bool "perl" - depends on !BR2_avr32 - depends on !BR2_bfin - depends on !BR2_sh2 - depends on !BR2_sh2a - depends on !BR2_sh3 - depends on !BR2_sh3eb - depends on !BR2_sh64 help Larry Wall's Practical Extraction and Report Language An interpreted scripting language, known among some as "Unix's Swiss
@@ -16,35 +9,18 @@ config BR2_PACKAGE_PERL if BR2_PACKAGE_PERL -config BR2_PACKAGE_PERL_CUSTOM_INSTALL - bool "custom install" - help - Don't use the full install target - Install only a selection of modules (like microperl). - config BR2_PACKAGE_PERL_MODULES - string "additional modules" - depends on BR2_PACKAGE_PERL_CUSTOM_INSTALL + string "custom module selection" help - List of space-separated perl modules to copy to the rootfs. - - Examples: constant.pm Getopt/Std.pm Time/Local.pm + List of space-separated perl modules (without .pm) to copy to the + rootfs. - Module dependencies are not automatic so check your needs. + Examples: constant Getopt/Std Time/Local -config BR2_PACKAGE_PERL_DB_FILE - bool "DB_File" - select BR2_PACKAGE_BERKELEYDB - help - Build the DB_File module. + Module dependencies on external libraries are not automatic so + check your needs. -config BR2_PACKAGE_PERL_GDBM_FILE - bool "GDBM_File" - select BR2_PACKAGE_GDBM - help - Build the GDBM_File module. + Leave empty for all modules (as far as the external libraries + are available). endif - -comment "perl requires an architecture supported by qemu" - depends on BR2_avr32 || BR2_bfin || BR2_sh2 || BR2_sh2a || BR2_sh3 || BR2_sh3eb || BR2_sh64
package/perl/perl.mk +63 -90
186 lines not on this page · raw message
Signature · 1 line
tg: (3d3047f..) t/perlcross (depends on: master)
PATCH 1/1 perl: build with perlcross instead of qemu
Quoted 276 lines · Arnout Vandecappelle (Essensium/Mind)
The perlcross project makes it possible to properly cross-compile perl. It creates a host-miniperl that is configured for the target and uses that to cross-compile the perl modules.
Unfortunately there are still a few hacks needed to make it work. Proper fixes can be developed and upstreamed later.
Since there is no longer a dependency on qemu, it works on all architectures again.
Also removed some config options:
-BR2_PACKAGE_PERL_CUSTOM_INSTALLjust allows a selection of modules; this can also be encoded by an emptyBR2_PACKAGE_PERL_MODULES.
-BR2_PACKAGE_PERL_DB_FILEandBR2_PACKAGE_PERL_GDBM_FILEcan be derived automatically from the package configs.---
This is still a bit RFC. I've tested in on a glibcx86_64, on a minimal internal powerpc and a glibc ARM. I haven't tested with any of the autobuilder configurations, but I expect it will at least be better than what we get now...Francois, can you check if it also runs? I've only done build tests.
Peter, if Francois confirms that the perl binary actually runs and if he has no other concerns, then I'd commit this patch quickly and wait for the autobuilder fallout.
package/perl/Config.in | 40 +++---------- package/perl/perl.mk | 153 ++++++++++++++++++++---------------------------- 2 files changed, 71 insertions(+), 122 deletions(-)package/perl/Config.in +8
-32@@ -1,12 +1,5 @@ config BR2_PACKAGE_PERL bool "perl" - depends on !BR2_avr32 - depends on !BR2_bfin - depends on !BR2_sh2 - depends on !BR2_sh2a - depends on !BR2_sh3 - depends on !BR2_sh3eb - depends on !BR2_sh64 help Larry Wall's Practical Extraction and Report Language An interpreted scripting language, known among some as "Unix's Swiss@@ -16,35 +9,18 @@ config BR2_PACKAGE_PERL if BR2_PACKAGE_PERL -config BR2_PACKAGE_PERL_CUSTOM_INSTALL - bool "custom install" - help - Don't use the full install target - Install only a selection of modules (like microperl). - config BR2_PACKAGE_PERL_MODULES - string "additional modules" - depends on BR2_PACKAGE_PERL_CUSTOM_INSTALL + string "custom module selection" help - List of space-separated perl modules to copy to the rootfs. - - Examples: constant.pm Getopt/Std.pm Time/Local.pm + List of space-separated perl modules (without .pm) to copy to the + rootfs. - Module dependencies are not automatic so check your needs. + Examples: constant Getopt/Std Time/Local -config BR2_PACKAGE_PERL_DB_FILE - bool "DB_File" - select BR2_PACKAGE_BERKELEYDB - help - Build the DB_File module. + Module dependencies on external libraries are not automatic so + check your needs. -config BR2_PACKAGE_PERL_GDBM_FILE - bool "GDBM_File" - select BR2_PACKAGE_GDBM - help - Build the GDBM_File module. + Leave empty for all modules (as far as the external libraries + are available). endif - -comment "perl requires an architecture supported by qemu" - depends on BR2_avr32 || BR2_bfin || BR2_sh2 || BR2_sh2a || BR2_sh3 || BR2_sh3eb || BR2_sh64package/perl/perl.mk +61
-88@@ -12,7 +12,26 @@ PERL_LICENSE = Artistic PERL_LICENSE_FILES = Artistic PERL_INSTALL_STAGING = YES -PERL_DEPENDENCIES = host-qemu +PERL_CROSS_VERSION = 0.7 +PERL_CROSS_SITE = http://download.berlios.de/perlcross +PERL_CROSS_SOURCE = perl-5.$(PERL_VERSION_MAJOR).0-cross-$(PERL_CROSS_VERSION).tar.gz + +# We use the perlcross hack to cross-compile perl. It should +# be extracted over the perl sources, so we don't define that +# as a separate package. Instead, it is downloaded and extracted +# together with perl + +define PERL_CROSS_DOWNLOAD + $(call DOWNLOAD,$(PERL_CROSS_SITE)/$(PERL_CROSS_SOURCE)) +endef +PERL_POST_DOWNLOAD_HOOKS += PERL_CROSS_DOWNLOAD + +define PERL_CROSS_EXTRACT + $(INFLATE$(suffix $(PERL_CROSS_SOURCE))) $(DL_DIR)/$(PERL_CROSS_SOURCE) | \ + $(TAR) $(TAR_STRIP_COMPONENTS)=1 -C $(@D) $(TAR_OPTIONS) - +endef +PERL_POST_EXTRACT_HOOKS += PERL_CROSS_EXTRACT + ifeq ($(BR2_PACKAGE_BERKELEYDB),y) PERL_DEPENDENCIES += berkeleydb endif@@ -20,23 +39,31 @@ ifeq ($(BR2_PACKAGE_GDBM),y) PERL_DEPENDENCIES += gdbm endif -PERL_CONF_OPT = -des \ - -Dusecrosscompile \ - -Dtargetrun=$(QEMU_USER) \ - -Dqemulib=$(STAGING_DIR) \ - -Dar="$(TARGET_AR)" \ - -Dcc="$(TARGET_CC)" \ - -Dcpp="$(TARGET_CC)" \ - -Dld="$(TARGET_LD)" \ - -Dnm="$(TARGET_NM)" \ - -Dranlib="$(TARGET_RANLIB)" \ - -Dccflags="$(TARGET_CFLAGS)" \ - -Dldflags="$(TARGET_LDFLAGS) -lgcc_s -lm" \ - -Dlddlflags="-shared" \ - -Dlibc=$(STAGING_DIR)/lib/libc.so \ - -Duseshrplib \ - -Dprefix=/usr \ - -Uoptimize +# Normally, --mode=cross should automatically do the two steps +# below, but it doesn't work for some reason. +PERL_HOST_CONF_OPT = \ + --mode=buildmini \ + --target=$(GNU_TARGET_NAME) \ + --target-arch=$(GNU_TARGET_NAME) \ + --set-target-name=$(GNU_TARGET_NAME) + +# We have to override LD, because an external multilib toolchain ld is not +# wrapped to provide the required sysroot options. We also can't use ccache +# because the configure script doesn't support it. +PERL_CONF_OPT = \ + --mode=target \ + --target=$(GNU_TARGET_NAME) \ + --target-tools-prefix=$(TARGET_CROSS) \ + --prefix=/usr \ + -Dld="$(TARGET_CC_NOCCACHE)" \ + -A ccflags="$(TARGET_CFLAGS)" \ + -A ldflags="$(TARGET_LDFLAGS) -lm" \ + -A mydomain="" \ + -A myhostname="$(BR2_TARGET_GENERIC_HOSTNAME)" \ + -A myuname="Buildroot $(BR2_VERSION_FULL)" \ + -A osname=linux \ + -A osvers=$(LINUX_VERSION) \ + -A perlamdin=root ifeq ($(shell expr $(PERL_VERSION_MAJOR) % 2), 1) PERL_CONF_OPT += -Dusedevel@@ -46,93 +73,39 @@ ifneq ($(BR2_LARGEFILE),y) PERL_CONF_OPT += -Uuselargefiles endif +PERL_MODULES = $(call qstrip,$(BR2_PACKAGE_PERL_MODULES)) +ifneq ($(PERL_MODULES),) +PERL_CONF_OPT += --only-mod=$(subst $(space),$(comma),$(PERL_MODULES)) +endif + define PERL_CONFIGURE_CMDS - rm -f $(@D)/config.sh - (cd $(@D); ./Configure $(PERL_CONF_OPT)) - echo "# patched values" >>$(@D)/config.sh - $(SED) '/^myarchname=/d' \ - -e '/^mydomain=/d' \ - -e '/^myhostname=/d' \ - -e '/^myuname=/d' \ - -e '/^osname=/d' \ - -e '/^osvers=/d' \ - -e '/^perladmin=/d' \ - $(@D)/config.sh - echo "myarchname='$(GNU_TARGET_NAME)'" >>$(@D)/config.sh - echo "mydomain=''" >>$(@D)/config.sh - echo "myhostname='$(BR2_TARGET_GENERIC_HOSTNAME)'" >>$(@D)/config.sh - echo "myuname='Buildroot $(BR2_VERSION_FULL)'" >>$(@D)/config.sh - echo "osname='linux'" >>$(@D)/config.sh - echo "osvers='$(BR2_LINUX_KERNEL_VERSION)'" >>$(@D)/config.sh - echo "perladmin='root'" >>$(@D)/config.sh - (cd $(@D); ./Configure -S) - cp $(@D)/config.h $(@D)/xconfig.h + (cd $(@D); HOSTCC='$(HOSTCC_NOCACHE)' ./configure $(PERL_HOST_CONF_OPT)) + (cd $(@D); ./configure $(PERL_CONF_OPT)) $(SED) 's/UNKNOWN-/Buildroot $(BR2_VERSION_FULL) /' $(@D)/patchlevel.h endef +# perlcross's miniperl_top forgets base, which is required by mktables. +# Instead of patching, it's easier to just set PERL5LIB define PERL_BUILD_CMDS - echo "#!/bin/sh" > $(@D)/Cross/miniperl - echo "$(QEMU_USER) $(@D)/miniperl \"\$$@\"" >>$(@D)/Cross/miniperl - chmod +x $(@D)/Cross/miniperl - PERL_MM_OPT="PERL=$(@D)/Cross/miniperl" \ - $(MAKE) -C $(@D) all + PERL5LIB=$(@D)/dist/base/lib $(MAKE1) -C $(@D) perl modules endef define PERL_INSTALL_STAGING_CMDS - $(MAKE) INSTALL_DEPENDENCE= \ - INSTALLFLAGS= \ - DESTDIR="$(STAGING_DIR)" \ - -C $(@D) install.perl + PERL5LIB=$(@D)/dist/base/lib $(MAKE1) -C $(@D) DESTDIR="$(STAGING_DIR)" install.perl endef -PERL_RUN_PERL = $(QEMU_USER) $(@D)/perl -Ilib -PERL_ARCHNAME = $(shell $(PERL_RUN_PERL) -MConfig -e "print Config->{archname}") -PERL_LIB = $(TARGET_DIR)/usr/lib/perl5/$(PERL_VERSION) -PERL_ARCHLIB = $(PERL_LIB)/$(PERL_ARCHNAME) -PERL_MODS = $(call qstrip,$(BR2_PACKAGE_PERL_MODULES)) -# Minimal set of modules required for 'perl -V' to work -PERL_ARCH_MODS = Config.pm Config_git.pl Config_heavy.pl -PERL_BASE_MODS = strict.pm vars.pm warnings.pm warnings/register.pm - -define PERL_INSTALL_MODULES - for i in $(PERL_ARCH_MODS); do \ - $(INSTALL) -m 0644 -D $(@D)/lib/$$i $(PERL_ARCHLIB)/$$i; \ - done - for i in $(PERL_BASE_MODS); do \ - $(INSTALL) -m 0644 -D $(@D)/lib/$$i $(PERL_LIB)/$$i; \ - done - for i in $(PERL_MODS); do \ - j=`echo $$i|cut -d : -f 1` ; \ - if [ -d $(@D)/lib/$$j ] ; then \ - cp -af $(@D)/lib/$$j $(PERL_LIB) ; \ - fi ; \ - if [ -f $(@D)/lib/$$i ] ; then \ - $(INSTALL) -m 0644 -D $(@D)/lib/$$i $(PERL_LIB)/$$i; \ - fi ; \ - done - # Remove test files - find $(PERL_LIB) -type f -name *.t -exec rm -f {} \; -endef +PERL_INSTALL_TARGET_GOALS = install.perl +ifeq ($(BR2_HAVE_DOCUMENTATION),y) +PERL_INSTALL_TARGET_GOALS += install.man +endif + -ifeq ($(BR2_PACKAGE_PERL_CUSTOM_INSTALL),y) -define PERL_INSTALL_TARGET_CMDS - $(INSTALL) -m 0755 -D $(@D)/perl $(TARGET_DIR)/usr/bin/perl - $(INSTALL) -m 0755 -D $(@D)/libperl.so $(PERL_ARCHLIB)/CORE/libperl.so - $(PERL_INSTALL_MODULES) -endef -else define PERL_INSTALL_TARGET_CMDS - $(MAKE) INSTALL_DEPENDENCE= \ - INSTALLFLAGS=-p \ - DESTDIR="$(TARGET_DIR)" \ - -C $(@D) install.perl - rm -f $(PERL_ARCHLIB)/CORE/*.h - find $(PERL_ARCHLIB) -type f -name *.bs -exec rm -f {} \;
package/perl/perl.mk ifneq ($(BR2_LARGEFILE),y) · line 111
Quoted 10 lines
package/perl/perl.mk +2
-2+ PERL5LIB=$(@D)/dist/base/lib $(MAKE1) -C $(@D) DESTDIR="$(TARGET_DIR)" $(PERL_INSTALL_TARGET_GOALS) endef -endif define PERL_CLEAN_CMDS - -$(MAKE) -C $(@D) clean + -$(MAKE1) -C $(@D) clean endef $(eval $(generic-package))
Hello,
In the perlcross Makefile, if you change perl5160delta.pod to
perl5162delta.pod in three places then you can compile the newest perl-5.16.2. Tested for arm, confirmed working.
Regards,
Dan Pattison
Ethertek Circuits
PATCH 1/1 perl: build with perlcross instead of qemu
Quoted 2 lines · Dan Pattison
In the perlcross
Makefile, if you change perl5160delta.pod to perl5162delta.pod in three places then you can compile
the newest perl-5.16.2. Tested for arm, confirmed working.
Thanks, I'll try that later.
Regards,
Arnout
PS Dan, if you reply to such a long mail, it helps if you strip away some of
the quoted text. Saves people with simple mail readers a lot of scrolling.
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286540 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
PATCH 1/1 perl: build with perlcross instead of qemu
In reply to Arnout Vandecappelle (Essensium/Mind)Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Arnout" == Arnout Vandecappelle (Essensium/Mind) <[email protected]> writes:
Hi,
Arnout> Peter, if Francois confirms that the perl binary actually runs Arnout> and if he has no other concerns, then I'd commit this patch Arnout> quickly and wait for the autobuilder fallout.
I completely agree, thanks for doing this!
Signature · 1 line
Bye, Peter Korsgaard
PATCH 1/1 perl: build with perlcross instead of qemu
2012/11/9 Peter Korsgaard <[email protected]>
Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Arnout" == Arnout Vandecappelle (Essensium/Mind) <[email protected]>
writes:
Hi,
Arnout> Peter, if Francois confirms that the perl binary actually runs Arnout> and if he has no other concerns, then I'd commit this patch Arnout> quickly and wait for the autobuilder fallout.
Quoted 9 lines
I completely agree, thanks for doing this!
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
How about to include perl-cross into buildroot packages?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20121109/d206e606/attachment.html>
PATCH 1/1 perl: build with perlcross instead of qemu
Quoted 8 lines · Alexander Khryukin
2012/11/9 Peter Korsgaard <jacmet at uclibc.org <mailto:[email protected]>>
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Arnout" == Arnout Vandecappelle (Essensium/Mind) <arnout at mind.be <mailto:[email protected]>> writes:
Hi,
Quoted 7 lines
Arnout> Peter, if Francois confirms that the perl binary actually runs Arnout> and if he has no other concerns, then I'd commit this patch Arnout> quickly and wait for the autobuilder fallout.
I completely agree, thanks for doing this!
How about to include perl-cross into buildroot packages?
Doesn't make sense. perlcross has to be extracted over the perl source: it
replaces a few configuration scripts and creates a few more. There is nothing in there to install on the host or on the target.
Regards,
Arnout
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286540 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
PATCH 1/1 perl: build with perlcross instead of qemu
Quoted 3 lines · Arnout Vandecappelle
Doesn't make sense. perlcross has to be extracted over the perl source: it
replaces a few configuration scripts and creates a few more. There is nothing in there to install on the host or on the target.
First of all, thanks a lot for doing this work.
Do you have details on how perl-cross is maintained with regard to perl? I.e, is it kept reasonably updated with new perl versions, or is it a hack that works on a single perl version that will force us to stay with only this version of perl?
Thanks!
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH 1/1 perl: build with perlcross instead of qemu
Quoted 7 lines · Thomas Petazzoni
Quoted 3 lines · Arnout Vandecappelle
Doesn't make sense. perlcross has to be extracted over the perl source: it
replaces a few configuration scripts and creates a few more. There is nothing in there to install on the host or on the target.
Quoted 6 lines
First of all, thanks a lot for doing this work.
Do you have details on how perl-cross is maintained with regard to perl? I.e, is it kept reasonably updated with new perl versions, or is it a hack that works on a single perl version that will force us to stay with only this version of perl?
There are about 12 versions on the download site, one per major perl. I guess
it doesn't make much difference which perl patchlevel it is applied to (this one is actually for perl-5.16.0 but it work fine on our perl-5.16.1).
Regards,
Arnout
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286540 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
PATCH 1/1 perl: build with perlcross instead of qemu
In reply to Alexander KhryukinQuoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Alexander" == Alexander Khryukin <[email protected]> writes:
Hi,
Alexander> How about to include perl-cross into buildroot packages?
I'm doing a test build right now, and will commit if that works. Perhaps it isn't perfect yet, but certainly better than all the qemu issues we're seing right now.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 1/1 perl: build with perlcross instead of qemu
Quoted 9 lines · Peter Korsgaard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Alexander" == Alexander Khryukin<[email protected]> writes:
Hi,
Alexander> How about to include perl-cross into buildroot packages?
I'm doing a test build right now, and will commit if that works. Perhaps it isn't perfect yet, but certainly better than all the qemu issues we're seing right now.
BTW, please everybody do review this patch even after it's committed - there
could very well be some things that I missed and that can be caught with visual review. (Just look at the time that I sent the patch to know why :-)
Regards,
Arnout
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286540 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
PATCH 1/1 perl: build with perlcross instead of qemu
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Arnout" == Arnout Vandecappelle <[email protected]> writes:
Hi,
Arnout> BTW, please everybody do review this patch even after it's Arnout> committed - there could very well be some things that I missed Arnout> and that can be caught with visual review. (Just look at the Arnout> time that I sent the patch to know why :-)
Yeah, I noticed ;) Thanks for doing it.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 1/1 perl: build with perlcross instead of qemu
In reply to Arnout Vandecappelle (Essensium/Mind)Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Arnout" == Arnout Vandecappelle (Essensium/Mind) <[email protected]> writes:
Arnout> The perlcross project makes it possible to properly cross-compile Arnout> perl. It creates a host-miniperl that is configured for the target Arnout> and uses that to cross-compile the perl modules.
Committed, thanks.
Signature · 1 line
Bye, Peter Korsgaard
PATCH 1/1 perl: build with perlcross instead of qemu
In reply to Arnout Vandecappelle (Essensium/Mind)Arnout,
Quoted 10 lines · Arnout Vandecappelle (Essensium/Mind)
This is still a bit RFC. I've tested in on a glibc
x86_64, on a minimal internal powerpc and a glibc ARM. I haven't tested with any of the autobuilder configurations, but I expect it will at least be better than what we get now...Francois, can you check if it also runs? I've only done build tests.
Peter, if Francois confirms that the perl binary actually runs and if he has no other concerns, then I'd commit this patch quickly and wait for the autobuilder fallout.
This patch unfortunately breaks the build of cpanminus, which apparently still requires qemu:
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
cpanminus 1.5018 Configuring
cpanminus 1.5018 Building
/bin/bash: /home/thomas/projets/buildroot/output/host/usr/bin/qemu-arm: Aucun fichier ou dossier de ce type /bin/bash: /home/thomas/projets/buildroot/output/host/usr/bin/qemu-arm: Aucun fichier ou dossier de ce type /bin/bash: /home/thomas/projets/buildroot/output/host/usr/bin/qemu-arm: Aucun fichier ou dossier de ce type /bin/bash: /home/thomas/projets/buildroot/output/host/usr/bin/qemu-arm: Aucun fichier ou dossier de ce type /bin/bash: /home/thomas/projets/buildroot/output/host/usr/bin/qemu-arm: Aucun fichier ou dossier de ce type /bin/bash: /home/thomas/projets/buildroot/output/host/usr/bin/qemu-arm: Aucun fichier ou dossier de ce type
Quoted 1 line
Quoted 1 line
Quoted 1 line
cpanminus 1.5018 Installing to target
echo "#!/bin/sh" > /home/thomas/projets/buildroot/output/build/cpanminus-1.5018/run_perl
echo "PERL5LIB=/home/thomas/projets/buildroot/output/target/usr/lib/perl5/site_perl/5.16.1/:/home/thomas/projets/buildroot/output/target/usr/lib/perl5/site_perl/5.16.1:/home/thomas/projets/buildroot/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/perl5/5.16.1/:/home/thomas/projets/buildroot/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/perl5/5.16.1 /home/thomas/projets/buildroot/output/host/usr/bin/qemu-arm /home/thomas/projets/buildroot/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/bin/perl \"\$@\"" >>/home/thomas/projets/buildroot/output/build/cpanminus-1.5018/run_perl
chmod +x /home/thomas/projets/buildroot/output/build/cpanminus-1.5018/run_perl
PERL5LIB=/home/thomas/projets/buildroot/output/target/usr/lib/perl5/site_perl/5.16.1/:/home/thomas/projets/buildroot/output/target/usr/lib/perl5/site_perl/5.16.1:/home/thomas/projets/buildroot/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/perl5/5.16.1/:/home/thomas/projets/buildroot/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/perl5/5.16.1 PERL_MM_OPT="DESTDIR=/home/thomas/projets/buildroot/output/target PERL=/home/thomas/projets/buildroot/output/build/cpanminus-1.5018/run_perl PERL_LIB=/home/thomas/projets/buildroot/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/perl5/5.16.1 PERL_ARCHLIB=/home/thomas/projets/buildroot/output/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/perl5/5.16.1/" PERL_MB_OPT="--destdir /home/thomas/projets/buildroot/output/target" RUN_PERL="/home/thomas/projets/buildroot/output/build/cpanminus-1.5018/run_perl" /home/thomas/projets/buildroot/output/host/usr/bin/qemu-arm /home/thomas/projets/buildroot/outpu
t/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/bin/perl /home/thomas/projets/buildroot/output/build/cpanminus-1.5018/cpanm --perl=/home/thomas/projets/buildroot/output/build/cpanminus-1.5018/run_perl --notest --no-man-pages Curses::UI/bin/bash: /home/thomas/projets/buildroot/output/host/usr/bin/qemu-arm: Aucun fichier ou dossier de ce type
make: *** [/home/thomas/projets/buildroot/output/build/cpanminus-1.5018/.stamp_target_installed] Erreur 127
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH 1/1 perl: build with perlcross instead of qemu
Quoted 2 lines · Thomas Petazzoni
This patch unfortunately breaks the build of cpanminus, which apparently still requires qemu:
Of course, I didn't think of that... The solution is to install miniperl and
its wrapper in the host directory.
I'll try to take a look at it later.
Regards,
Arnout
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286540 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
PATCH 1/1 perl: build with perlcross instead of qemu
In reply to Thomas PetazzoniQuoted 2 lines · Thomas Petazzoni
This patch unfortunately breaks the build of cpanminus, which apparently still requires qemu:
Yep, it does require qemu. To make it work with perlcross, you'd need to
build a host-perl with a few extra modules (to support network downloads) - but building those modules can't be done with cross-miniperl because it has the target's settings for which headers etc. exist. The perlcross docs state:
"And thinking of possible need to install additional modules for hostperl makes my head spin."
So instead, I'll make cpanminus depend on host-qemu and try to exclude the
failing architectures.
The long term solution is probably to replace cpanminus with something
buildroot-friendly. The cross-build of the downloaded modules is probably doable with cross-miniperl.
Regards,
Arnout
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286540 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
PATCH 1/1 perl: build with perlcross instead of qemu
In reply to Arnout Vandecappelle (Essensium/Mind)2012/11/9 Arnout Vandecappelle (Essensium/Mind) <[email protected]>:
Quoted 10 lines
The perlcross project makes it possible to properly cross-compile perl. It creates a host-miniperl that is configured for the target and uses that to cross-compile the perl modules.
Unfortunately there are still a few hacks needed to make it work. Proper fixes can be developed and upstreamed later.
Since there is no longer a dependency on qemu, it works on all architectures again.
Quoted 7 lines
Also removed some config options:
-BR2_PACKAGE_PERL_CUSTOM_INSTALLjust allows a selection of modules; this can also be encoded by an emptyBR2_PACKAGE_PERL_MODULES.
-BR2_PACKAGE_PERL_DB_FILEandBR2_PACKAGE_PERL_GDBM_FILEcan be derived automatically from the package configs.
The 3 following patches are now useless :
package/perl/perl-configure-qemu.patch
package/perl/perl-make-ext.patcg
package/perl/perl-mkppport.patch
Fran?ois