in reply to Re^7: Perl for ARMv7le
in thread Perl for ARMv7le

Its seems like i was passing wrong parm values to the configure scripts, so it always considered as native build rather than the cross build. I made some changes to the parms and it was able to generate the make file for cross build

./configure -Dsysroot=/opt/qnx6 -Dcc=arm-unknown-nto-qnx6.6.0eabi-gcc --target-tools-prefix=arm-unknown-nto-qnx6.6.0eabi- --target=arm-unknown-nto-qnx6.6.0eabi --host=arm-unknown-nto-qnx6.6.0eabi -Dprefix=$HOME/localperl

The make run fine for some time and end up having following error , where it says undefined references to certain functions

chmod 644 "PPPort.bs"
arm-unknown-nto-qnx6.6.0eabi-gcc --sysroot=/opt/qnx660/target/qnx6 -Wl,-E -o perl perlmain.o libperl.a
written lib/Config.pod
make2: Leaving directory `/home/cross/perl-5.24.0'
libperl.a(pp.o): In function `Perl_pp_crypt': pp.c:(.text+0xffd8): warning: The 'crypt' function has been deprecated in libc. Link against liblogin for extended algorithm support.
libperl.a(toke.o): In function `Perl_scan_num':
toke.c:(.text+0x27b82): undefined reference to `pow'
libperl.a(util.o): In function `Perl_drand48_r':
util.c:(.text+0xa36e): undefined reference to `ldexp'
libperl.a(sv.o): In function `S_hextract':
sv.c:(.text+0x13ca0): undefined reference to `frexp'
.
.
time64.c:(.text+0x3482): undefined reference to `floor'
time64.c:(.text+0x349c): undefined reference to `ceil'
time64.c:(.text+0x3522): undefined reference to `fmod'
time64.c:(.text+0x359c): undefined reference to `floor'
time64.c:(.text+0x37e6): undefined reference to `ceil'
collect2: error: ld returned 1 exit status
make: *** perl Error 1

could it be because i might have referenced wrong path for libraries in -Dsysroot option?

Replies are listed 'Best First'.
Re^9: Perl for ARMv7le
by Corion (Patriarch) on Dec 21, 2016 at 14:58 UTC

    It might be the wrong path or it might be that you need additional libraries for your environment. A good place to put them is in the hints/qnx.sh in your case. Maybe something like libm or some other math library is missing:

    toke.c:(.text+0x27b82): undefined reference to `pow'

      all the missing functions are from the math.h and the sysroot has the correct path to header files.

      also checked the hints/qnx.sh, even it has the correct path included in it. however i see its referencing hints/linux.pl right before the error

      INSTALLDIRS=perl INSTALLMAN1DIR=none INSTALLMAN3DIR=none \ PERL_CORE=1 LIBPERL_A=libperl.a PERL_CORE=1 PERL="../../miniperl_top"
      Processing hints file hints/linux.pl
      CONFIG key 'osname' does not exist in Config.pm
      Generating a Unix-style Makefile
      Writing Makefile for threads
      cd dist/threads-shared/ && ../../miniperl_top -I../../lib Makefile.PL \
      INSTALLDIRS=perl INSTALLMAN1DIR=none INSTALLMAN3DIR=none \ PERL_CORE=1 LIBPERL_A=libperl.a PERL_CORE=1
      PERL="../../miniperl_top"
      Processing hints file hints/linux.pl
      CONFIG key 'osname' does not exist in Config.pm
      Generating a Unix-style Makefile

      not sure why its referencing linux.pl, but for a quick test i overrided the linux.pl with qnx.pl, but ended running into same error

        The header files are not the problem, but the (missing) linked object files. I don't know where math.o or libm.lib or whatever its name is lives on your system. Consider consulting with your vendor on that.