Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.91k stars 542 forks source link

fix cross-compilation #14892

Closed p5pRT closed 9 years ago

p5pRT commented 9 years ago

Migrated from rt.perl.org#125999 (status was 'rejected')

Searchable as RT125999$

p5pRT commented 9 years ago

From @fperrad

Created by @fperrad

The cross-compilation of Perl 5.23.2 is broken\, the part "Making utilities" can not be completed.

The following patch solves the issue\, by setting the Makefile variable RUN with a value from %Config

Signed-off-by​: Francois Perrad \francois\.perrad@​gadz\.org --- utils/Makefile.PL | 2 +- 1 file changed\, 1 insertion(+)\, 1 deletion(-)

Inline Patch ```diff diff --git a/utils/Makefile.PL b/utils/Makefile.PL index 27c371f..d3a740f 100644 --- a/utils/Makefile.PL +++ b/utils/Makefile.PL @@ -26,7 +26,7 @@ my $perl = defined $Config{usedl} ? '../miniperl' : '../perl'; print $fh <<"EOT"; PERL = $perl REALPERL = ../perl -RUN = # Used mainly cross-compilation setups. +RUN = $Config{run} EOT -- ```

2.1.4

Perl Info ``` Flags: category=core severity=medium Site configuration information for perl 5.23.2: Configured by fperrad at Sat Sep 5 10:13:00 CEST 2015. Summary of my perl5 (revision 5 version 23 subversion 2) configuration: Platform: osname=linux, osvers=4.1.3, archname=linux-gnueabihf uname='Linux buildroot 4.1.3' config_args='-des -Dusecrosscompile -Dsysroot=/home/fperrad/checkout/BR/build/a20_perl/host/usr/arm-buildroot-linux-gnueabihf/sysroot -Dtargetrun=/home/fperrad/checkout/BR/build/a20_perl/host/usr/bin/qemu-arm -Dcc=/home/fperrad/checkout/BR/build/a20_perl/host/usr/bin/arm-linux-gnueabihf-gcc -Dld=/home/fperrad/checkout/BR/build/a20_perl/host/usr/bin/arm-linux-gnueabihf-gcc -Dccflags=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -Dldflags= -lm -Dlddlflags=-shared -Dlibc=/home/fperrad/checkout/BR/build/a20_perl/host/usr/arm-buildroot-linux-gnueabihf/sysroot/lib/libc.so -Duseshrplib -Dprefix=/usr -Dmydomain= -Dmyhostname=a20-olinuxino -Dperladmin=root -Uoptimize -Dusedevel' hint=recommended, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=undef use64bitint=undef, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='/home/fperrad/checkout/BR/build/a20_perl/host/usr/bin/arm-linux-gnueabihf-gcc', ccflags ='-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os --sysroot=/home/fperrad/checkout/BR/build/a20_perl/host/usr/arm-buildroot-linux-gnueabihf/sysroot -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2', optimize=' ', cppflags='--sysroot=/home/fperrad/checkout/BR/build/a20_perl/host/usr/arm-buildroot-linux-gnueabihf/sysroot -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os --sysroot=/home/fperrad/checkout/BR/build/a20_perl/host/usr/arm-buildroot-linux-gnueabihf/sysroot -fwrapv -fno-strict-aliasing -pipe -fstack-protector-strong' ccversion='', gccversion='4.9.2 20140904 (prerelease)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234, doublekind=3 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8, longdblkind=0 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='ld', ldflags =' -lm --sysroot=/home/fperrad/checkout/BR/build/a20_perl/host/usr/arm-buildroot-linux-gnueabihf/sysroot -fstack-protector-strong' libpth=/home/fperrad/checkout/BR/build/a20_perl/host/opt/ext-toolchain/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/include-fixed /home/fperrad/checkout/BR/build/a20_perl/host/opt/ext-toolchain/bin/../lib/gcc/arm-linux-gnueabihf/4.9.2/../../../../arm-linux-gnueabihf/lib /home/fperrad/checkout/BR/build/a20_perl/host/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/lib /home/fperrad/checkout/BR/build/a20_perl/host/usr/arm-buildroot-linux-gnueabihf/sysroot/lib/../lib /home/fperrad/checkout/BR/build/a20_perl/host/usr/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/../lib /home/fperrad/checkout/BR/build/a20_perl/host/usr/arm-buildroot-linux-gnueabihf/sysroot/lib libs= perllibs= libc=/home/fperrad/checkout/BR/build/a20_perl/host/usr/arm-buildroot-linux-gnueabihf/sysroot/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.19-2014.08' Dynamic Linking: dlsrc=dl_none.xs, dlext=none, d_dlsymun=undef, ccdlflags='' cccdlflags='', lddlflags='' @INC for perl 5.23.2: /usr/lib/perl5/site_perl/5.23.2/linux-gnueabihf /usr/lib/perl5/site_perl/5.23.2 /usr/lib/perl5/5.23.2/linux-gnueabihf /usr/lib/perl5/5.23.2 . Environment for perl 5.23.2: HOME=/home/guest LANG=C LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin PERL_BADLANG (unset) SHELL=/bin/sh ```
p5pRT commented 9 years ago

From @jkeenan

On Sat Sep 05 07​:19​:57 2015\, fperrad wrote​:

This is a bug report for perl from francois.perrad@​gadz.org\, generated with the help of perlbug 1.40 running under perl 5.23.2.

----------------------------------------------------------------- [Please describe your issue here]

The cross-compilation of Perl 5.23.2 is broken\, the part "Making utilities" can not be completed.

Francois\, can you provide an example of the cross-compilation you were attempting when you encountered this problem?

The following patch solves the issue\, by setting the Makefile variable RUN with a value from %Config

Signed-off-by​: Francois Perrad \francois\.perrad@&#8203;gadz\.org --- utils/Makefile.PL | 2 +- 1 file changed\, 1 insertion(+)\, 1 deletion(-)

diff --git a/utils/Makefile.PL b/utils/Makefile.PL index 27c371f..d3a740f 100644 --- a/utils/Makefile.PL +++ b/utils/Makefile.PL @​@​ -26\,7 +26\,7 @​@​ my $perl = defined $Config{usedl} ? '../miniperl' : '../perl'; print $fh \<\<"EOT"; PERL = $perl REALPERL = ../perl -RUN = # Used mainly cross-compilation setups. +RUN = $Config{run}

EOT

-- 2.1.4

The last time the line in question was modified was in 2012. At that time the revision was specifically to deal with a cross-compilation issue.

#####

$ git show d708ee4b | head -20 commit d708ee4b2cf817d9803f6f18f87d6ce91ca74ff4 Author​: Jess Robinson \castaway@&#8203;desert\-island\.me\.uk Date​: Sat Dec 29 21​:29​:50 2012 +0000

  Stop using $run for anything other than testing compiled tests in Configure.  
  When cross-compiling we want to run miniperl etc on the compile host\, not the test target

Inline Patch ```diff diff --git a/Makefile.SH b/Makefile.SH index 9e55e65..6bb91cc 100755 --- a/Makefile.SH +++ b/Makefile.SH @@ -302,7 +302,7 @@ STATIC_LDFLAGS = $static_ldflags LDLIBPTH = $ldlibpth # Sometimes running an executable is an adventure. -RUN = $run +RUN = # These variables may need to be manually set for non-Unix systems. ```

Hence\, there is a risk that if we apply your patch\, we will simply be back to where we were in 2012.

-- James E Keenan (jkeenan@​cpan.org)

p5pRT commented 9 years ago

The RT System itself - Status changed from 'new' to 'open'

p5pRT commented 9 years ago

From @fperrad

You are right. Please\, close the ticket.

My problem doesn't come from a new version of Perl\, but it comes from a new toolchain.

With the "good" toolchain\, the generated utils/Makefile contains PERL = ../miniperl so no need of RUN.

François

2015-09-07 12​:50 GMT+02​:00 James E Keenan via RT \perlbug\-followup@&#8203;perl\.org​:

On Sat Sep 05 07​:19​:57 2015\, fperrad wrote​:

This is a bug report for perl from francois.perrad@​gadz.org\, generated with the help of perlbug 1.40 running under perl 5.23.2.

----------------------------------------------------------------- [Please describe your issue here]

The cross-compilation of Perl 5.23.2 is broken\, the part "Making utilities" can not be completed.

Francois\, can you provide an example of the cross-compilation you were attempting when you encountered this problem?

The following patch solves the issue\, by setting the Makefile variable RUN with a value from %Config

Signed-off-by​: Francois Perrad \francois\.perrad@&#8203;gadz\.org --- utils/Makefile.PL | 2 +- 1 file changed\, 1 insertion(+)\, 1 deletion(-)

diff --git a/utils/Makefile.PL b/utils/Makefile.PL index 27c371f..d3a740f 100644 --- a/utils/Makefile.PL +++ b/utils/Makefile.PL @​@​ -26\,7 +26\,7 @​@​ my $perl = defined $Config{usedl} ? '../miniperl' : '../perl'; print $fh \<\<"EOT"; PERL = $perl REALPERL = ../perl -RUN = # Used mainly cross-compilation setups. +RUN = $Config{run}

EOT

-- 2.1.4

The last time the line in question was modified was in 2012. At that time the revision was specifically to deal with a cross-compilation issue.

#####

$ git show d708ee4b | head -20 commit d708ee4b2cf817d9803f6f18f87d6ce91ca74ff4 Author​: Jess Robinson \castaway@&#8203;desert\-island\.me\.uk Date​: Sat Dec 29 21​:29​:50 2012 +0000

Stop using $run for anything other than testing compiled tests in Configure\.

When cross\-compiling we want to run miniperl etc on the compile host\, not the test target

diff --git a/Makefile.SH b/Makefile.SH index 9e55e65..6bb91cc 100755 --- a/Makefile.SH +++ b/Makefile.SH @​@​ -302\,7 +302\,7 @​@​ STATIC_LDFLAGS = $static_ldflags LDLIBPTH = $ldlibpth

# Sometimes running an executable is an adventure. -RUN = $run +RUN =

# These variables may need to be manually set for non-Unix systems.

#####

Hence\, there is a risk that if we apply your patch\, we will simply be back to where we were in 2012.

-- James E Keenan (jkeenan@​cpan.org)

p5pRT commented 9 years ago

From @khwilliamson

Closed at the request of the OP -- Karl Williamson

p5pRT commented 9 years ago

@khwilliamson - Status changed from 'open' to 'rejected'