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 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.

Attachment: signature.asc
Description: PGP signature



Home | Main Index | Thread Index | Old Index