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 Thu, May 13, 2021 at 10:57:31AM -0400, Louis Guillaume wrote:
FWIW - I had similar problems with perl on AIX 7.1 last year. This thread has the details of some of that...

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.

I am working on this, my grandiose plan is to have a uniform build environment on all the commercial Unixes we are building software on (AIX, Solaris, HP-UX), using pkgsrc.

As I wrote in my last mail, I succeeded with compiling perl in the end. I managed to build a working gcc 7.5 as well, so as a proof-of-concept AIX 7.1 seems to be OK, actually I'm struggling with AIX 6.1 and Solaris 10 right now.

Regarding the perl build, I didn't concern much about the SIGILL because I saw that the main problem is that the -R option is passed to the linker which doesn't recognize it.

There are 2 issues here:
1. Lots of software assume that when gcc is the compiler, the linker works "as usual", and accepts the -R option for setting the rpath. On AIX this only happens when the -bsvr4 option is used as well, which however turns on a bunch of other options that you don't necessarily want.

What are the possible solutions for this (at least what I've thought of):
- pkgsrc wraps the -Wl,-R gcc options specifically for AIX and turns it
  into one -Wl,-blibpath option with colon-separated paths. This should be
  the ideal solution (it's already done for ld), but requires some change in
  the pkgsrc architecture (I can't tell exactly what)

- Use -bsvr4 to make -R work, and undo the main problematic effect of this
  switch (the exporting of all symbols) with -bnoexpfull. This actually works
  most of the time, unless the software tries to build shared libraries
  without using an export file or an intelligent helper like libtool.

I went with the latter one, with exceptions for specific software. Your LDFLAGS, while it's possible to add to mk.conf specifically for perl, uses flags that are unneeded or might just postpone linking problems to runtime like -brtl.

2. Some software - like perl - uses all kinds of flags besides CFLAGS and LDFLAGS, or it tries to manipulate them. That's why my patch from the previous email is needed.

To sum it up, my relevant settings from mk.conf are:
CFLAGS+=                -maix64 -pthread
LDFLAGS+=               -maix64 -pthread -Wl,-bsvr4 -Wl,-bnoexpfull

Have you managed to build openssl by any chance? It tries to force xlc settings if it sees that "cc" is available (which is, as a pkgsrc wrapper), and it also eats my -lm flag then it complains about missing math symbols.


Attachment: signature.asc
Description: PGP signature

Home | Main Index | Thread Index | Old Index