While trying to build the earmv6hf package of lang/perl5 on a amd64 system, configure breaks because a test program fails compilation:
=> Bootstrap dependency digest>=20211023: found digest-20220214
===> Skipping vulnerability checks.
===> Configuring for perl-5.34.1
/usr/bin/find /usr/pkgsrc/lang/perl5/work.earmv6hf/perl-5.34.1 -name "*.orig" -type f -exec rm -f {} \;
=> Replacing Perl interpreter in cpan/Config-Perl-V/V.pm cpan/Getopt-Long/lib/Getopt/Long.pm cpan/version/lib/version.pm dist/ExtUtils-ParseXS/lib/ExtUtils/xsubpp ext/ExtUtils-Miniperl/lib/ExtUtils/Miniperl.pm ext/File-DosGlob/lib/File/DosGlob.pm lib/unicore/mktables.
INFO: [replace-interpreter] Nothing changed in cpan/Config-Perl-V/V.pm.
INFO: [replace-interpreter] Nothing changed in cpan/Getopt-Long/lib/Getopt/Long.pm.
INFO: [replace-interpreter] Nothing changed in cpan/version/lib/version.pm.
INFO: [replace-interpreter] Nothing changed in dist/ExtUtils-ParseXS/lib/ExtUtils/xsubpp.
INFO: [replace-interpreter] Nothing changed in ext/ExtUtils-Miniperl/lib/ExtUtils/Miniperl.pm.
INFO: [replace-interpreter] Nothing changed in ext/File-DosGlob/lib/File/DosGlob.pm.
INFO: [replace-interpreter] Nothing changed in lib/unicore/mktables.
First let's make sure your kit is complete. Checking...
Would you like to see the instructions? [n]
Locating common programs...
Checking compatibility between /usr/pkgsrc/lang/perl5/work.earmv6hf/.tools/bin/echo and builtin echo (if any)...
Symbolic links are supported.
Checking how to test for symbolic links...
You can test for symbolic links with 'test -h'.
Checking for cross-compile
No targethost for running compiler tests against defined, running locally
Good, your tr supports [:lower:] and [:upper:] to convert case.
Using [:upper:] and [:lower:] to convert case.
aix esix4 lynxos sco_2_3_2
aix_3 fps midnightbsd sco_2_3_3
aix_4 freebsd minix sco_2_3_4
altos486 freemint mips solaris_2
amigaos gnu mirbsd stellar
atheos gnukfreebsd mpc sunos_4_0
aux_3 gnuknetbsd ncr_tower sunos_4_1
bitrig greenhills netbsd super-ux
bsdos haiku newsos4 svr4
catamount hpux nonstopux svr5
convexos i386 openbsd ti1500
cxux interix opus ultrix_4
cygwin irix_4 os2 umips
darwin irix_5 os390 unicos
dcosx irix_6 os400 unicosmk
dec_osf irix_6_0 posix-bc unisysdynix
dos_djgpp irix_6_1 qnx utekv
dragonfly isc riscos uwin
dynix isc_2 sco vos
dynixptx linux-android sco_2_3_0
epix linux sco_2_3_1
Which of these apply, if any? [Policy netbsd]
Operating system name? [netbsd]
Operating system version? [9.99.96]
Installation prefix to use? (~name ok) [/usr/pkg]
AFS does not seem to be running...
What installation prefix should I use for installing files? (~name ok)
[/usr/pkg]
Build a threading Perl? [y]
Use which C compiler? [armv6--netbsdelf-eabihf-gcc]
Checking for GNU cc in disguise and/or its version number...
Now, how can we feed standard input to your C preprocessor...
Directories to use for library searches? [/lib /usr/lib /usr/pkg/lib]
What is the file extension used for shared libraries? [so]
Make shared library basenames unique? [n]
Build Perl for SOCKS? [n]
Try to use long doubles if available? [n]
Checking for optional libraries...
What libraries to us#include <stdio.h>
int main() { printf("Ok\n"); return(0); }
I used the command:
armv6--netbsdelf-eabihf-gcc -o try -O2 -fPIC -D_FORTIFY_SOURCE=2 -pthread -I/usr/include -O2 -fPIC -D_FORTIFY_SOURCE=2 -pthread -I/usr/include -I/usr/pkg/include -pthread -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib -L/usr/pkg/lib try.c -lm -lcrypt -lpthread
./try
and I got the following output:
sh: Cannot execute ELF binary ./try
The program compiled OK, but exited with status 2.
You have a problem. Shall I abort Configure [y]
Ok. Stopping Configure.
*** Error code 1
Stop.
make[1]: stopped in /usr/pkgsrc/lang/perl5
*** Error code 1
Stop.
make: stopped in /usr/pkgsrc/lang/perl5
e? [-lm -lcrypt -lpthread]
What optimizer/debugger flag should be used?
[-O2 -fPIC -D_FORTIFY_SOURCE=2 -pthread -I/usr/include]
Any additional cc flags?
[-O2 -fPIC -D_FORTIFY_SOURCE=2 -pthread -I/usr/include -I/usr/pkg/include]
Let me guess what the preprocessor flags are...
Any additional ld flags (NOT including libraries)?
[ -pthread -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib -L/usr/pkg/lib]
Checking your choice of C compiler and flags for coherency...
I've tried to compile and run the following simple program:
#include <stdio.h>
int main() { printf("Ok\n"); return(0); }
I used the command:
armv6--netbsdelf-eabihf-gcc -o try -O2 -fPIC -D_FORTIFY_SOURCE=2 -pthread -I/usr/include -O2 -fPIC -D_FORTIFY_SOURCE=2 -pthread -I/usr/include -I/usr/pkg/include -pthread -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/pkg/lib -L/usr/pkg/lib try.c -lm -lcrypt -lpthread
./try
and I got the following output:
sh: Cannot execute ELF binary ./try
The program compiled OK, but exited with status 2.
You have a problem. Shall I abort Configure [y]
Ok. Stopping Configure.
*** Error code 1
Stop.
make[1]: stopped in /usr/pkgsrc/lang/perl5
*** Error code 1
Stop.
make: stopped in /usr/pkgsrc/lang/perl5
Unfortunately, configure doesn't show what's going on, and I can't find it in any log file, so I recreated this test, which results in compiler errors because the test refers to files /usr/lib/crt0.o, /usr/lib/crtbegin.o and /usr/lib/libm.so.0 which are x86_64 and should be earmv6hf.
I can succesfully finish the test by symlinking to the correct files which are in /usr/obj/destdir.evbarm/usr/lib and adding the option -L /usr/obj/destdir.evbarm/lib to the gcc command.
My question is, how do I tell make that it should use the earmv6hf versions of the dynamic libraries for such tests, so I can build the perl5 package on a PC?
In the output above is mentioned:
No targethost for running compiler tests against defined, running locally
, which obviously has to do with this...