pkgsrc-Users archive

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

Re: Building perl on AIX 7.1



On 5/11/21 5:58 AM, Lehel Bernadt wrote:
On Mon, May 10, 2021 at 01:44:50PM +0200, Joerg Sonnenberger wrote:

You have to look into the wrapper log to see what command is actually
run as there is quite a bit of translation happening on AIX.


I set WRAPPER_DEBUG=yes and ran the whole thing again.

The only useful info I could gather from the logs is that the gcc wrapper does not call the ld wrapper which should do the option translation, but the system gcc itself.

So expecting to have linker option -R translated to -blibpath is hopeless, I needed to make -Wl,-R work. I sniffed around in files/Policy.sh because that's were perl's configure script is set up, and I found this:

=====================================
# XCOFF targets need the path specified where libperl.a resides.
if $test "@OBJECT_FMT@" = "XCOFF"; then
         ldflags="@COMPILER_RPATH_FLAG@\${shrpdir} \$ldflags"
         lddlflags="@COMPILER_RPATH_FLAG@\${shrpdir} \$lddlflags"
fi
=====================================

This is AIX specific, but COMPILER_RPATH_FLAG is not set up anywhere. So I exported it as "-Wl,-bsvr4 -Wl,-R", and the build ran successfully without the "-R flag is ingored" messages! Unfortunately the perl binary still didn't run. Turns out it is built using $(CLDFLAGS) $(CCDLFLAGS) ... So after some trial and error, I came up with this change:

=====================================
--- files/Policy.sh.orig        2021-05-10 09:51:35.000000000 -0500
+++ files/Policy.sh     2021-05-10 09:31:30.000000000 -0500
@@ -89,6 +89,7 @@
   if $test "@OBJECT_FMT@" = "XCOFF"; then
         ldflags="@COMPILER_RPATH_FLAG@\${shrpdir} \$ldflags"
         lddlflags="@COMPILER_RPATH_FLAG@\${shrpdir} \$lddlflags"
+       ccdlflags="@COMPILER_RPATH_FLAG@\${shrpdir} \$ccdlflags"
   fi

   # Set pkgsrc defaults for library and header search paths:
=====================================

Now I have a working perl binary.
It's not the end though, as I have similar hurdles with the other dependencies so I don't have a working gcc yet.

FWIW - I had similar problems with perl on AIX 7.1 last year. This thread has the details of some of that...

http://mail-index.netbsd.org/tech-pkg/2020/09/17/msg023807.html

I was building with the gcc from the IBM-provided RPMS for AIX. My temporary solution was this...

LDFLAGS="-Wl,-s -Wl,-lpthreads -Wl,-brtl -Wl,-bdynamic -Wl,-b64 -Wl,-blibpath:/opt/pkg/lib/perl5/5.32.0/powerpc64-aix-thread-multi-64all/CORE:/opt/pkg/lib:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib64:/usr/lib:/lib" bmake


... but there were enough other problems with pkgsrc on AIX that caused me to throw in the towel.

If you're actively working on this and would like to collaborate I would be very interested in helping out.

--
Louis


Home | Main Index | Thread Index | Old Index