pkgsrc-Users archive

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

Building perl on AIX 7.1



Hello,

I'm trying to set up a pkgsrc-based environment on AIX 7.1. I'm using gcc 6.3.0 via RPM package from the AIX toolbox for bootstrapping. The idea is to compile a recent gcc next, and use that to build the other software.

I'm trying this with gcc8, but every recent version is similar in that they ultimately depend on perl5 (I guess because of the documentation).

Now this is where the process fails:
=====================================
gcc -maix64  -Wl,-R/usr/local/lib/perl5/5.32.0/powerpc64-aix-thread-multi-64all/CORE   -Wl,-b64 -Wl,-bhalt:4 -Wl,-G -Wl,-bI:../../perl.exp  -Wl,-bnoentry -lpthreads -lc -lm -L/usr/lib -Wl,-R/usr/lib -Wl,-R/usr/local/lib -L/usr/local/lib -Wl,-bE:shared.exp shared.o  -o ../../lib/auto/threads/shared/shared.so
ld: 0706-027 The -R /usr/local/lib/perl5/5.32.0/powerpc64-aix-thread-multi-64all/CORE flag is ignored.
ld: 0706-027 The -R /usr/local/lib flag is ignored.
ld: 0706-027 The -R /usr/local/lib/perl5/5.32.0/powerpc64-aix-thread-multi-64all/CORE flag is ignored.
ld: 0706-027 The -R /usr/local/lib flag is ignored.
chmod 755 ../../lib/auto/threads/shared/shared.so
LIBPATH=/usr/pkgsrc/lang/perl5/work/perl-5.32.1:/opt/freeware/lib64  ./perl -Ilib -I. -f pod/buildtoc -q
Illegal instruction (core dumped)
*** Error code 132

Stop.
bmake: stopped in /usr/pkgsrc/lang/perl5/work/perl-5.32.1
*** Error code 1

Stop.
bmake[1]: stopped in /usr/pkgsrc/lang/perl5
*** Error code 1

Stop.
bmake: stopped in /usr/pkgsrc/lang/perl5
=====================================

The question is, why is the -R option being passed on to the linker? This should be translated to -blibpath for the AIX linker, which the cmd-sink-aix-ld wrapper does, but for some reason it's not being called here.

Let's try adding -Wl,-bsvr4 - this makes the AIX linker recognize the -R for rpath setting, but it also turns on a bunch of other options like exporting all the symbols, which can cause all kinds of issues (see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89096), so this shouldn't be a permanent solution.

The build now succeeds, but only due to the side effects of the -bsvr4 linker option, because the option is being stripped from some of the link commands no matter whether I put it in LDFLAGS or CFLAGS, and the linker still complains of -R not being known.

After a bmake install, the resulting binary doesn't run:
=====================================
Could not load program perl:
        Dependent module libperl.a(libperl.o) could not be loaded.
Could not load module libperl.a(libperl.o).
System error: No such file or directory
=====================================

libperl.a is of course under /usr/local/lib/perl5/5.32.0/powerpc64-aix-thread-multi-64all/CORE which could not be rpath'ed into the binary.

Any suggestions?

Regards,
Lehel

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index