Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core Dump while building from source on AIX #20012

Closed
flynn1973 opened this issue Jul 29, 2022 · 19 comments
Closed

Core Dump while building from source on AIX #20012

flynn1973 opened this issue Jul 29, 2022 · 19 comments

Comments

@flynn1973
Copy link

flynn1973 commented Jul 29, 2022

Module:

Description

While trying to build 5.36.0 on AIX with gcc, i get the follwing exception during "make install"

LIBPATH=/opt/itsv/applperlbin/perl-5.36.0:/opt/itsv/applperlbin/perl-5.36.0  ./perl -Ilib -I. -f pod/buildtoc -q
gmake: *** [makefile:421: pod/perltoc.pod] Illegal instruction (core dumped)

As seen, it uses the fresh built perl from the sourcetree which seems not ready for this task .
If i do it manually with miniperl no exeption occurs.

root@aixbuildhostng: /opt/itsv/applperlbin/perl-5.36.0 # LIBPATH=/opt/
+itsv/applperlbin/perl-5.36.0:/opt/itsv/applperlbin/perl-5.36.0  ./min
+iperl -Ilib -I. -f pod/buildtoc -q
root@aixbuildhostng: /opt/itsv/applperlbin/perl-5.36.0 #

there is a second occurence later in the install process also runable in miniperl

LIBPATH=/opt/itsv/applperlbin/perl-5.36.0:/opt/itsv/applperlbin/perl-5.36.0  ./perl -Ilib -I. installperl --destdir=

Steps to Reproduce

build script used

#!/usr/bin/ksh

# build 64 bit perl for AIX in a not so fancy way
# Author: some asshole from outer space

export SOURCEDIR=/opt/itsv/applperlbin/perl-5.36.0
export PREFIX=/opt/itsv/applperlbin/install-5.36.0
export VERSION="5.36"
export REL="0"
export VENDORARCHPATH=${PREFIX}/lib/perl5/${VERSION}/vendor_perl
export SITEARCHPATH=${PREFIX}/lib/perl5/${VERSION}/site_perl
export ARCHLIBPATH=${PREFIX}/lib/perl5/${VERSION}

export LANG=en_US

export OBJECT_MODE=64
export PATH=/opt/freeware/bin:$PATH
export LD="/usr/bin/ld"
export AR="/usr/bin/ar"
export ARFLAGS="-X64"
export NM="/usr/bin/nm"
export NMFLAGS="-X64 -B"
export MAKE="gmake"

export CC="gcc"

export CFLAGS="-maix64 -O2"

echo "GCC version=`$CC --version | head -1`"

build_perl()
{
set -x
ulimit -a

echo "CC=" $CC
echo "CFLAGS=" $CFLAGS
echo "LD=" $LD
echo "LDFLAGS=" $LDFLAGS
echo "AR=" $AR
echo "ARFLAGS=" $ARFLAGS


./Configure -des \
        -Dprefix=$PREFIX \
        -Dversion="${VERSION}.${REL}" \
        -Dmyhostname=uscss-nostromo \
        -Darchname=ppc-aix \
        -Dcf_by='Weyland Corp' \
        -Dcc="$CC" \
        -Dccflags="$CFLAGS -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -I/opt/freeware/include" \
        -Dlddlflags="$LDDLFLAGS" \
        -Dldflags="$LDFLAGS" \
        -Duseshrplib \
        -Dshrpldflags='$LDFLAGS -H512 -T512 -bhalt:4 -bM:SRE -bE:perl.exp' \
        -Dar="$AR" \
        -Dfull_ar="$AR" \
        -Darflags="$ARFLAGS" \
        -Dnm="$NM $NMFLAGS" \
        -Dinstallprefix=$PREFIX \
        -Dvendorprefix=$PREFIX \
        -Dvendorlib=${PREFIX}/perl5/vendor_perl \
        -Dvendorarch=$VENDORARCHPATH \
        -Dsiteprefix=$PREFIX \
        -Dsitelib=${PREFIX}/perl5/site_perl \
        -Dsitearch=$SITEARCHPATH \
        -Dprivlib=${PREFIX}/perl5/${VERSION} \
        -Darchlib=$ARCHLIBPATH \
        -Dusethreads \
        -Duseithreads \
        -Duselargefiles \
        -Dd_semctl_semun \
        -Di_syslog \
        -Dman3ext=3 \
        -Duseperlio \
        -Dinstallusrbinperl=n \
        -Ubincompat5005 \
        -Uversiononly \
        -Dscriptdir=${PREFIX}/bin \
        $*

$MAKE  --trace --print-directory -j 8
/usr/sbin/slibclean

}

echo "BUILD ENVIRONMENT:"
/usr/bin/env | /usr/bin/sort | grep -v _proxy | grep -v SSH_

ulimit -a
ulimit -d unlimited
ulimit -m unlimited
ulimit -a

export LDFLAGS="-Wl,-s"
export LDFLAGS="$LDFLAGS -Wl,-lpthreads"
export LDFLAGS="$LDFLAGS -Wl,-brtl -Wl,-bdynamic"

# for modules:
export LDDLFLAGS="-G -bI:\$(PERL_INC)/perl.exp -bE:\$(BASEEXT).exp -bnoentry -lc -lm"

# build 64bit mode
(
  cd $SOURCEDIR
  gmake realclean
  rm config.sh
  export OBJECT_MODE=64
  export LIBS64="-L/opt/freeware/lib64 -L/usr/lib64 -L/opt/freeware/lib -L/usr/lib"
  export CFLAGS="${CFLAGS} ${LIBS64}"
  export CXXFLAGS="${CFLAGS}"

  #perl ld
  export LDFLAGS="-Wl,-b64"
  export LDFLAGS="$LDFLAGS $LIBS64"
  export LDFLAGS="$LDFLAGS -Wl,-blibpath:${ARCHLIBPATH}/CORE:/opt/freeware/lib/64:/opt/freeware/lib:/usr/lib:/lib"
  #no -bmaxdata for 64bit
  export LDFLAGS="$LDFLAGS"

  export LDDLFLAGS="$LDDLFLAGS $LIBS64"

# with -Duse64bitall
# What is the size of a pointer (in bytes)? [4]
#*** You have chosen a maximally 64-bit build,
#*** but your pointers are only 4 bytes wide.
#*** Please rerun Configure without -Duse64bitall.
#*** Since you have quads, you could possibly try with -Duse64bitint.


  export LIBPATH=`pwd`

  build_perl -Duse64bitint
  cd ..
)

cd $SOURCEDIR
$MAKE DESTDIR=${PREFIX} install
mkdir -p ${PREFIX}/bin
/opt/freeware/bin/install -m 755 utils/pl2pm ${PREFIX}/bin/pl2pm
cd ..

Expected behavior

i expect a working perl installation

Perl configuration

root@aixbuildhostng: /opt/itsv/applperlbin/perl-5.36.0 # LIBPATH=/opt/itsv/applperlbin/perl-5.36.0:/opt/itsv/applperlbin/perl-5.36.0  ./perl -Ilib -I. -V
Summary of my perl5 (revision 5 version 36 subversion 0) configuration:

  Platform:
    osname=aix
    osvers=7.1.0.0
    archname=ppc-aix-thread-multi-64all
    uname='aix aixbuildhostng 1 7 00fb1a6d4c00 powerpc aix '
    config_args='-des -Dprefix=/opt/itsv/applperlbin/install-5.36.0 -Dversion=5.36 -Dmyhostname=uscss-nostromo -Darchname=ppc-aix -Dcf_by=Weyland Corp -Dcc=gcc -Dccflags=-maix64 -O2 -L/opt/freeware/lib64 -L/usr/lib64 -L/opt/freeware/lib -L/usr/lib -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -I/opt/freeware/include -Dlddlflags=-G -bI:$(PERL_INC)/perl.exp -bE:$(BASEEXT).exp -bnoentry -lc -lm -L/opt/freeware/lib64 -L/usr/lib64 -L/opt/freeware/lib -L/usr/lib -Dldflags=-Wl,-b64 -L/opt/freeware/lib64 -L/usr/lib64 -L/opt/freeware/lib -L/usr/lib -Wl,-blibpath:/opt/itsv/applperlbin/install-5.36.0/lib/perl5/5.36/CORE:/opt/freeware/lib/64:/opt/freeware/lib:/usr/lib:/lib -Duseshrplib -Dshrpldflags=-H512 -T512 -bhalt:4 -bM:SRE -bE:perl.exp -Dar=/usr/bin/ar -Dfull_ar=/usr/bin/ar -Darflags=-X64 -Dnm=/usr/bin/nm -X64 -B -Dinstallprefix=/opt/itsv/applperlbin/install-5.36.0 -Dvendorprefix=/opt/itsv/applperlbin/install-5.36.0 -Dvendorlib=/opt/itsv/applperlbin/install-5.36.0/share/perl5/vendor_perl -Dvendorarch=/opt/itsv/applperlbin/install-5.36.0/lib/perl5/5.36/vendor_perl -Dsiteprefix=/opt/itsv/applperlbin/install-5.36.0 -Dsitelib=/opt/itsv/applperlbin/install-5.36.0/share/perl5/site_perl -Dsitearch=/opt/itsv/applperlbin/install-5.36.0/lib/perl5/5.36/site_perl -Dprivlib=/opt/itsv/applperlbin/install-5.36.0/perl5/5.36 -Darchlib=/opt/itsv/applperlbin/install-5.36.0/lib/perl5/5.36 -Dusethreads -Duseithreads -Duselargefiles -Dd_semctl_semun -Di_syslog -Dman3ext=3 -Duseperlio -Dinstallusrbinperl=n -Ubincompat5005 -Uversiononly -Dscriptdir=/opt/itsv/applperlbin/install-5.36.0/bin -Duse64bitint'
    hint=recommended
    useposix=true
    d_sigaction=define
    useithreads=define
    usemultiplicity=define
    use64bitint=define
    use64bitall=define
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=define
  Compiler:
    cc='gcc -maix64'
    ccflags ='-D_THREAD_SAFE -maix64 -O2 -L/opt/freeware/lib64 -L/usr/lib64 -L/opt/freeware/lib -L/usr/lib -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -I/opt/freeware/include -DNEED_PTHREAD_INIT -fwrapv -maix64 -DUSE_64_BIT_ALL -D_FORTIFY_SOURCE=2'
    optimize='-O'
    cppflags='-D_THREAD_SAFE -maix64 -O2 -L/opt/freeware/lib64 -L/usr/lib64 -L/opt/freeware/lib -L/usr/lib -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -I/opt/freeware/include -DNEED_PTHREAD_INIT -fwrapv'
    ccversion=''
    gccversion='8.3.0'
    gccosandvers=''
    intsize=4
    longsize=8
    ptrsize=8
    doublesize=8
    byteorder=87654321
    doublekind=4
    d_longlong=define
    longlongsize=8
    d_longdbl=define
    longdblsize=8
    longdblkind=0
    ivtype='long'
    ivsize=8
    nvtype='double'
    nvsize=8
    Off_t='off_t'
    lseeksize=8
    alignbytes=8
    prototype=define
  Linker and Libraries:
    ld='gcc -maix64'
    ldflags =' -Wl,-b64 -L/opt/freeware/lib64 -L/usr/lib64 -L/opt/freeware/lib -L/usr/lib -Wl,-blibpath:/opt/itsv/applperlbin/install-5.36.0/lib/perl5/5.36/CORE:/opt/freeware/lib/64:/opt/freeware/lib:/usr/lib:/lib -Wl,-b64'
    libpth=/opt/freeware/lib /usr/lib /usr/ccs/lib /usr/lib64
    libs=-lpthread -lbind -lnsl -lgdbm -ldbm -ldb -ldl -lld -lm -lcrypt -lpthreads -lc
    perllibs=-lpthread -lbind -lnsl -ldl -lld -lm -lcrypt -lpthreads -lc
    libc=/lib/libc.a
    so=a
    useshrplib=true
    libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_aix.xs
    dlext=so
    d_dlsymun=undef
    ccdlflags='-Xlinker -bE:/opt/itsv/applperlbin/install-5.36.0/lib/perl5/5.36/CORE/perl.exp'
    cccdlflags=' '
    lddlflags='  -Wl,-b64 -Wl,-G -Wl,-bI:$(PERL_INC)/perl.exp -Wl,-bE:$(BASEEXT).exp -Wl,-bnoentry -lpthreads -lc -lm -L/opt/freeware/lib64 -L/usr/lib64 -L/opt/freeware/lib -L/usr/lib'


Characteristics of this binary (from libperl):
  Compile-time options:
    HAS_TIMES
    MULTIPLICITY
    PERLIO_LAYERS
    PERL_COPY_ON_WRITE
    PERL_DONT_CREATE_GVSV
    PERL_MALLOC_WRAP
    PERL_OP_PARENT
    PERL_PRESERVE_IVUV
    USE_64_BIT_ALL
    USE_64_BIT_INT
    USE_ITHREADS
    USE_LARGE_FILES
    USE_LOCALE
    USE_LOCALE_COLLATE
    USE_LOCALE_CTYPE
    USE_LOCALE_NUMERIC
    USE_LOCALE_TIME
    USE_PERLIO
    USE_PERL_ATOF
    USE_REENTRANT_API
    USE_THREAD_SAFE_LOCALE
  Built under aix
  Compiled at Jul 28 2022 13:48:49
  @INC:
    lib
    .
    /opt/itsv/applperlbin/install-5.36.0/lib/perl5/5.36/site_perl
    /opt/itsv/applperlbin/install-5.36.0/share/perl5/site_perl
    /opt/itsv/applperlbin/install-5.36.0/lib/perl5/5.36/vendor_perl
    /opt/itsv/applperlbin/install-5.36.0/share/perl5/vendor_perl
    /opt/itsv/applperlbin/install-5.36.0/lib/perl5/5.36
    /opt/itsv/applperlbin/install-5.36.0/perl5/5.36
@Leont
Copy link
Contributor

Leont commented Jul 29, 2022

Can you get us a backtrace with some debugger?

@flynn1973
Copy link
Author

yep, will do it monday

@hvds
Copy link
Contributor

hvds commented Jul 29, 2022

If that is not enough to make things obvious, other useful data points would be whether it also crashes if built without optimization, and the results from make minitest.

@flynn1973
Copy link
Author

truss output:

root@aixbuildhostng: /opt/itsv/applperlbin/perl-5.36.0 # LIBPATH=/opt/itsv/applperlbin/perl-5.36.0 truss -faedl -o /tmp/perl_trace.out ./perl -Ilib -I. -f pod/buildtoc -q
root@aixbuildhostng: /opt/itsv/applperlbin/perl-5.36.0 # cat /tmp/perl_trace.out
Trace Started at: Mon Aug  1 10:06:19 2022
27263178: 25231573: 0.0000:        execve("./perl", 0x2FF22AB0, 0x2FF22ACC)  argc: 6
27263178: 25231573:  argv: ./perl -Ilib -I. -f pod/buildtoc -q
27263178: 25231573:  envp: SHELL=/usr/bin/bash LC__FASTMSG=true HISTSIZE=2000
27263178: 25231573:  ODMDIR=/etc/objrepos HISTTIMEFORMAT=%F %T | AUTHSTATE=compat
27263178: 25231573:  EDITOR=vi ENV=/root/.kshrc PWD=/opt/itsv/applperlbin/perl-5.36.0
27263178: 25231573:  LOGNAME=root TZ=Europe/Vienna HOME=/root LANG=C AIXTHREAD_SCOPE=S
27263178: 25231573:  NMON=Bc SSH_CONNECTION=172.17.8.4 44346 172.17.14.50 22 TERM=xterm
27263178: 25231573:  USER=root CURL_CA_BUNDLE=/etc/itsv-ca-bundle.crt LOGIN=root SHLVL=1
27263178: 25231573:  LOCPATH=/usr/lib/nls/loc EXTENDED_HISTORY=ON
27263178: 25231573:  MAILMSG=[YOU HAVE NEW MAIL] PS1=root@aixbuildhostng: $PWD #
27263178: 25231573:  SSH_CLIENT=172.17.8.4 44346 22
27263178: 25231573:  PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java8_64/jre/bin:/opt/freeware/bin:/opt/freeware/sbin:.:/usr/lib/instl:/usr/local/bin:/opt/freeware/bin:/usr/es/sbin/cluster:/usr/es/sbin/cluster/utilities:/usr/es/sbin/cluster/cspoc
27263178: 25231573:  HISTFILESIZE=2000 MAIL=/usr/spool/mail/root SSH_TTY=/dev/pts/10
27263178: 25231573:  OLDPWD=/opt/itsv/applperlbin _=/usr/bin/truss
27263178: 25231573:  NLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.cat
27263178: 25231573:  LIBPATH=/opt/itsv/applperlbin/perl-5.36.0
27263178: 25231573: 0.0184:        kusla(2, 0x09FFFFFFF0001170) Err#1  EPERM
27263178: 25231573: 0.0186:        read_sysconfig(0x09001000A005BBE8, 0x0000000000000010, 0x0000000000000000, 0x00000000B0010010, 0x00000001100001A0, 0xBADC0FFEE0DDF00D, 0x0000000006010000, 0x09001000A0091DE8) = 0x0000000000000000
27263178: 25231573: 0.0189:        sbrk(0x0000000000000000) = 0x0000000110000A00
27263178: 25231573: 0.0190:        vmgetinfo(0x0FFFFFFFFFFFF000, 7, 16) = 0
27263178: 25231573: 0.0192:        sbrk(0x0000000000000000) = 0x0000000110000A00
27263178: 25231573: 0.0194:        __libc_sbrk(0x0000000000010020) = 0x0000000110000A00
27263178: 25231573: 0.0196:        thread_init(0x090000000052A7E0, 0x09001000A014A4C8) =
27263178: 25231573: 0.0198:        sbrk(0x0000000000000000) = 0x0000000110010A20
27263178: 25231573: 0.0199:        vmgetinfo(0x0FFFFFFFFFFFF648, 7, 16) = 0
27263178: 25231573: 0.0201:        smcr_procattr(0, 1, 0x0FFFFFFFFFFFF640) Err#109 ENOSYS
27263178: 25231573: 0.0203:        getrpid(-1, -1, 648535941213081960) = 27263178
27263178: 25231573: 0.0204:        _getpid()            = 27263178
27263178: 25231573: 0.0206:        getprocs64(0x0000000110003110, 5024, 0x0000000000000000, 0, 0x0FFFFFFFFFFFF638, 1) = 1
27263178: 25231573: 0.0208:        appulimit(1005, 0)   = 0x0FFFFFFFF6000000
27263178: 25231573: 0.0209:        _thread_self()               = 25231573
27263178: 25231573: 0.0211:        thread_setmystate(0x0000000000000000, 0x0FFFFFFFFFFFF160) = 0
27263178: 25231573: 0.0212:        thread_setmystate(0x0FFFFFFFFFFFEDC0, 0x0FFFFFFFFFFFF148) = 0
27263178: 25231573: 0.0214:        _sigaction(3, 0x0FFFFFFFFFFFF530, 0x0FFFFFFFFFFFF560) = 0
27263178: 25231573: 0.0215:        _sigaction(4, 0x0FFFFFFFFFFFF530, 0x0FFFFFFFFFFFF560) = 0
27263178: 25231573: 0.0216:        _sigaction(5, 0x0FFFFFFFFFFFF530, 0x0FFFFFFFFFFFF560) = 0
27263178: 25231573: 0.0217:        _sigaction(6, 0x0FFFFFFFFFFFF530, 0x0FFFFFFFFFFFF560) = 0
27263178: 25231573: 0.0219:        _sigaction(7, 0x0FFFFFFFFFFFF530, 0x0FFFFFFFFFFFF560) = 0
27263178: 25231573: 0.0220:        _sigaction(8, 0x0FFFFFFFFFFFF530, 0x0FFFFFFFFFFFF560) = 0
27263178: 25231573: 0.0221:        _sigaction(10, 0x0FFFFFFFFFFFF530, 0x0FFFFFFFFFFFF560) = 0
27263178: 25231573: 0.0222:        _sigaction(11, 0x0FFFFFFFFFFFF530, 0x0FFFFFFFFFFFF560) = 0
27263178: 25231573: 0.0224:        _sigaction(12, 0x0FFFFFFFFFFFF530, 0x0FFFFFFFFFFFF560) = 0
27263178: 25231573: 0.0225:        _sigaction(36, 0x0FFFFFFFFFFFF530, 0x0FFFFFFFFFFFF560) = 0
27263178: 25231573: 0.0226:        _sigaction(39, 0x0FFFFFFFFFFFF530, 0x0FFFFFFFFFFFF560) = 0
27263178: 25231573: 0.0228:        kloadquery(238, 0x0FFFFFFFFFFFF570, 24) = 0
27263178: 25231573: 0.0236:        sigprocmask(2, 0x09001000A01CFBC8, 0x0FFFFFFFFFFFF670) = 0
27263178: 25231573: 0.0237:        _sigaction(8, 0x0FFFFFFFFFFFF7A0, 0x0FFFFFFFFFFFF7D0) = 0
27263178: 25231573: 0.0238:        thread_setmystate(0x0FFFFFFFFFFFF270, 0x0000000000000000) = 0
27263178: 25231573: 0.0240:        __libc_sbrk(0x0000000000010020) = 0x0000000110010A20
27263178: 25231573: 0.0243:        getuidx(2)           = 0
27263178: 25231573: 0.0244:        getuidx(1)           = 0
27263178: 25231573: 0.0245:        getgidx(2)           = 0
27263178: 25231573: 0.0246:        getgidx(1)           = 0
27263178: 25231573: 0.0248:        kopen("/dev/urandom", 040000000) = 3
27263178: 25231573: 0.0250:        kfcntl(3, F_GETFD, 0x00000001100056D8) = 1
27263178: 25231573: 0.0251:        kread(3, "129A V1C", 4) = 4
27263178: 25231573: 0.0252:        close(3)             = 0
27263178: 25231573: 0.0254:        getuidx(2)           = 0
27263178: 25231573: 0.0255:        getuidx(1)           = 0
27263178: 25231573: 0.0256:        getgidx(2)           = 0
27263178: 25231573: 0.0257:        getgidx(1)           = 0
27263178: 25231573: 0.0261:        __libc_sbrk(0x0000000000010020) = 0x0000000110020A40
27263178: 25231573: 0.0263:        kopen("/dev/urandom", 040000000) = 3
27263178: 25231573: 0.0264:        kread(3, "B20F1BAD", 4) = 4
27263178: 25231573: 0.0265:        close(3)             = 0
27263178: 25231573: 0.0268:        getuidx(4)           = 0
27263178: 25231573: 0.0269:        getuidx(2)           = 0
27263178: 25231573: 0.0270:        getuidx(1)           = 0
27263178: 25231573: 0.0271:        getgidx(4)           = 0
27263178: 25231573: 0.0272:        getgidx(2)           = 0
27263178: 25231573: 0.0273:        getgidx(1)           = 0
27263178: 25231573: 0.0274:        getuidx(4)           = 0
27263178: 25231573: 0.0275:        getuidx(2)           = 0
27263178: 25231573: 0.0277:        getuidx(1)           = 0
27263178: 25231573: 0.0278:        getgidx(4)           = 0
27263178: 25231573: 0.0279:        getgidx(2)           = 0
27263178: 25231573: 0.0280:        getgidx(1)           = 0
27263178: 25231573: 0.0281:        getuidx(4)           = 0
27263178: 25231573: 0.0282:        getuidx(2)           = 0
27263178: 25231573: 0.0283:        getuidx(1)           = 0
27263178: 25231573: 0.0284:        getgidx(4)           = 0
27263178: 25231573: 0.0285:        getgidx(2)           = 0
27263178: 25231573: 0.0286:        getgidx(1)           = 0
27263178: 25231573: 0.0287:        getuidx(4)           = 0
27263178: 25231573: 0.0288:        getuidx(2)           = 0
27263178: 25231573: 0.0289:        getuidx(1)           = 0
27263178: 25231573: 0.0290:        getgidx(4)           = 0
27263178: 25231573: 0.0291:        getgidx(2)           = 0
27263178: 25231573: 0.0292:        getgidx(1)           = 0
27263178: 25231573: 0.0294:        getuidx(4)           = 0
27263178: 25231573: 0.0295:        getuidx(2)           = 0
27263178: 25231573: 0.0296:        getuidx(1)           = 0
27263178: 25231573: 0.0297:        getgidx(4)           = 0
27263178: 25231573: 0.0298:        getgidx(2)           = 0
27263178: 25231573: 0.0299:        getgidx(1)           = 0
27263178: 25231573: 0.0300:        getuidx(4)           = 0
27263178: 25231573: 0.0301:        getuidx(2)           = 0
27263178: 25231573: 0.0302:        getuidx(1)           = 0
27263178: 25231573: 0.0303:        getgidx(4)           = 0
27263178: 25231573: 0.0304:        getgidx(2)           = 0
27263178: 25231573: 0.0305:        getgidx(1)           = 0
27263178: 25231573: 0.0307:        getuidx(4)           = 0
27263178: 25231573: 0.0308:        getuidx(2)           = 0
27263178: 25231573: 0.0309:        getuidx(1)           = 0
27263178: 25231573: 0.0310:        getgidx(4)           = 0
27263178: 25231573: 0.0311:        getgidx(2)           = 0
27263178: 25231573: 0.0312:        getgidx(1)           = 0
27263178: 25231573: 0.0313:        getuidx(4)           = 0
27263178: 25231573: 0.0314:        getuidx(2)           = 0
27263178: 25231573: 0.0315:        getuidx(1)           = 0
27263178: 25231573: 0.0316:        getgidx(4)           = 0
27263178: 25231573: 0.0317:        getgidx(2)           = 0
27263178: 25231573: 0.0318:        getgidx(1)           = 0
27263178: 25231573: 0.0320:        getuidx(4)           = 0
27263178: 25231573: 0.0321:        getuidx(2)           = 0
27263178: 25231573: 0.0322:        getuidx(1)           = 0
27263178: 25231573: 0.0323:        getgidx(4)           = 0
27263178: 25231573: 0.0324:        getgidx(2)           = 0
27263178: 25231573: 0.0325:        getgidx(1)           = 0
27263178: 25231573: 0.0326:        getuidx(4)           = 0
27263178: 25231573: 0.0327:        getuidx(2)           = 0
27263178: 25231573: 0.0328:        getuidx(1)           = 0
27263178: 25231573: 0.0329:        getgidx(4)           = 0
27263178: 25231573: 0.0330:        getgidx(2)           = 0
27263178: 25231573: 0.0331:        getgidx(1)           = 0
27263178: 25231573: 0.0332:        getuidx(4)           = 0
27263178: 25231573: 0.0334:        getuidx(2)           = 0
27263178: 25231573: 0.0335:        getuidx(1)           = 0
27263178: 25231573: 0.0336:        getgidx(4)           = 0
27263178: 25231573: 0.0337:        getgidx(2)           = 0
27263178: 25231573: 0.0338:        getgidx(1)           = 0
27263178: 25231573: 0.0339:        getuidx(4)           = 0
27263178: 25231573: 0.0340:        getuidx(2)           = 0
27263178: 25231573: 0.0341:        getuidx(1)           = 0
27263178: 25231573: 0.0342:        getgidx(4)           = 0
27263178: 25231573: 0.0343:        getgidx(2)           = 0
27263178: 25231573: 0.0344:        getgidx(1)           = 0
27263178: 25231573: 0.0346:        getuidx(4)           = 0
27263178: 25231573: 0.0347:        getuidx(2)           = 0
27263178: 25231573: 0.0348:        getuidx(1)           = 0
27263178: 25231573: 0.0349:        getgidx(4)           = 0
27263178: 25231573: 0.0350:        getgidx(2)           = 0
27263178: 25231573: 0.0351:        getgidx(1)           = 0
27263178: 25231573: 0.0352:        kload("/usr/lib/nls/loc/C C C C C C__64", 128, "/opt/itsv/applperlbin/perl-5.36.0") = 0
27263178: 25231573: 0.0355:        kload("/usr/lib/nls/loc/C C C C C C", 128, "/opt/itsv/applperlbin/perl-5.36.0") = 0
27263178: 25231573: 0.0356:        getuidx(4)           = 0
27263178: 25231573: 0.0358:        getuidx(2)           = 0
27263178: 25231573: 0.0359:        getuidx(1)           = 0
27263178: 25231573: 0.0360:        getgidx(4)           = 0
27263178: 25231573: 0.0361:        getgidx(2)           = 0
27263178: 25231573: 0.0362:        getgidx(1)           = 0
27263178: 25231573: 0.0363:        getuidx(4)           = 0
27263178: 25231573: 0.0364:        getuidx(2)           = 0
27263178: 25231573: 0.0365:        getuidx(1)           = 0
27263178: 25231573: 0.0366:        getgidx(4)           = 0
27263178: 25231573: 0.0367:        getgidx(2)           = 0
27263178: 25231573: 0.0368:        getgidx(1)           = 0
27263178: 25231573: 0.0369:        getuidx(4)           = 0
27263178: 25231573: 0.0371:        getuidx(2)           = 0
27263178: 25231573: 0.0372:        getuidx(1)           = 0
27263178: 25231573: 0.0373:        getgidx(4)           = 0
27263178: 25231573: 0.0374:        getgidx(2)           = 0
27263178: 25231573: 0.0375:        getgidx(1)           = 0
27263178: 25231573: 0.0376:        getuidx(4)           = 0
27263178: 25231573: 0.0377:        getuidx(2)           = 0
27263178: 25231573: 0.0378:        getuidx(1)           = 0
27263178: 25231573: 0.0379:        getgidx(4)           = 0
27263178: 25231573: 0.0380:        getgidx(2)           = 0
27263178: 25231573: 0.0381:        getgidx(1)           = 0
27263178: 25231573: 0.0382:        getuidx(4)           = 0
27263178: 25231573: 0.0383:        getuidx(2)           = 0
27263178: 25231573: 0.0384:        getuidx(1)           = 0
27263178: 25231573: 0.0386:        getgidx(4)           = 0
27263178: 25231573: 0.0387:        getgidx(2)           = 0
27263178: 25231573: 0.0388:        getgidx(1)           = 0
27263178: 25231573: 0.0389:        getuidx(4)           = 0
27263178: 25231573: 0.0390:        getuidx(2)           = 0
27263178: 25231573: 0.0391:        getuidx(1)           = 0
27263178: 25231573: 0.0392:        getgidx(4)           = 0
27263178: 25231573: 0.0393:        getgidx(2)           = 0
27263178: 25231573: 0.0394:        getgidx(1)           = 0
27263178: 25231573: 0.0397:        getuidx(4)           = 0
27263178: 25231573: 0.0398:        getuidx(2)           = 0
27263178: 25231573: 0.0399:        getuidx(1)           = 0
27263178: 25231573: 0.0400:        getgidx(4)           = 0
27263178: 25231573: 0.0401:        getgidx(2)           = 0
27263178: 25231573: 0.0402:        getgidx(1)           = 0
27263178: 25231573: 0.0404:        __libc_sbrk(0x0000000000010020) = 0x0000000110030A60
27263178: 25231573: 0.0407:        statx("lib/5.36.0/ppc-aix-thread-multi-64all", 0x0FFFFFFFFFFFF190, 176, 0) Err#2  ENOENT
27263178: 25231573: 0.0408:        statx("lib/5.36.0", 0x0FFFFFFFFFFFF190, 176, 0) Err#2  ENOENT
27263178: 25231573: 0.0410:        statx("lib/ppc-aix-thread-multi-64all", 0x0FFFFFFFFFFFF190, 176, 0) Err#2  ENOENT
27263178: 25231573: 0.0411:        statx("./5.36.0/ppc-aix-thread-multi-64all", 0x0FFFFFFFFFFFF190, 176, 0) Err#2  ENOENT
27263178: 25231573: 0.0412:        statx("./5.36.0", 0x0FFFFFFFFFFFF190, 176, 0) Err#2  ENOENT
27263178: 25231573: 0.0414:        statx("./ppc-aix-thread-multi-64all", 0x0FFFFFFFFFFFF190, 176, 0) Err#2  ENOENT
27263178: 25231573: 0.0416:        kfcntl(0, F_SETFD, 0x0000000000000000) = 0
27263178: 25231573: 0.0417:        kioctl(0, 22528, 0x0000000000000000, 0x0000000000000000) = 0
27263178: 25231573: 0.0418:        lseek(0, 0, 1)               = 1295400
27263178: 25231573: 0.0420:        kfcntl(1, F_SETFD, 0x0000000000000000) = 0
27263178: 25231573: 0.0421:        kioctl(1, 22528, 0x0000000000000000, 0x0000000000000000) = 0
27263178: 25231573: 0.0422:        lseek(1, 0, 1)               = 1295400
27263178: 25231573: 0.0424:        kfcntl(2, F_SETFD, 0x0000000000000000) = 0
27263178: 25231573: 0.0425:        kioctl(2, 22528, 0x0000000000000000, 0x0000000000000000) = 0
27263178: 25231573: 0.0426:        lseek(2, 0, 1)               = 1295400
27263178: 25231573: 0.0428:        kopen("pod/buildtoc", 040000000) = 3
27263178: 25231573: 0.0429:        kfcntl(3, F_GETFD, 0x00000001100056D8) = 1
27263178: 25231573: 0.0431:        kioctl(3, 22528, 0x0000000000000000, 0x0000000000000000) Err#25 ENOTTY
27263178: 25231573: 0.0432:        lseek(3, 0, 1)               = 0
27263178: 25231573: 0.0433:        fstatx(3, 0x0FFFFFFFFFFFF730, 176, 0) = 0
27263178: 25231573: 0.0434:        getuidx(2)           = 0
27263178: 25231573: 0.0435:        getuidx(1)           = 0
27263178: 25231573: 0.0436:        getgidx(2)           = 0
27263178: 25231573: 0.0438:        getgidx(1)           = 0
27263178: 25231573: 0.0439:        sigprocmask(2, 0x09001000A01CFBC8, 0x0FFFFFFFFFFFF250) = 0
27263178: 25231573: 0.0440:        _sigaction(20, 0x0000000000000000, 0x0FFFFFFFFFFFF310) = 0
27263178: 25231573: 0.0441:        thread_setmystate(0x0FFFFFFFFFFFEE50, 0x0000000000000000) = 0
27263178: 25231573: 0.0445:        __libc_sbrk(0x0000000000010020) = 0x0000000110040A80
27263178: 25231573: 0.0449:        kread(3, " # ! / u s r / b i n / p".., 8192) = 7861
27263178: 25231573: 0.0454:        statx("lib/strict.pmc", 0x0FFFFFFFFFFFE430, 176, 0) Err#2  ENOENT
27263178: 25231573: 0.0456:        statx("lib/strict.pm", 0x0FFFFFFFFFFFE430, 176, 0) = 0
27263178: 25231573: 0.0457:        kopen("lib/strict.pm", 040000000) = 4
27263178: 25231573: 0.0459:        kioctl(4, 22528, 0x0000000000000000, 0x0000000000000000) Err#25 ENOTTY
27263178: 25231573: 0.0460:        lseek(4, 0, 1)               = 0
27263178: 25231573: 0.0461:        __libc_sbrk(0x0000000000010020) = 0x0000000110050AA0
27263178: 25231573: 0.0463:        kread(4, " p a c k a g e   s t r i".., 8192) = 4783
27263178: 25231573: 0.0475:        lseek(4, 1605, 0)    = 1605
27263178: 25231573: 0.0476:        lseek(4, 0, 1)               = 1605
27263178: 25231573: 0.0477:        close(4)             = 0
27263178: 25231573: 0.0479:        statx("lib/File/Spec.pmc", 0x0FFFFFFFFFFFE430, 176, 0) Err#2  ENOENT
27263178: 25231573: 0.0480:        statx("lib/File/Spec.pm", 0x0FFFFFFFFFFFE430, 176, 0) = 0
27263178: 25231573: 0.0482:        kopen("lib/File/Spec.pm", 040000000) = 4
27263178: 25231573: 0.0483:        kioctl(4, 22528, 0x0000000000000000, 0x0000000000000000) Err#25 ENOTTY
27263178: 25231573: 0.0485:        lseek(4, 0, 1)               = 0
27263178: 25231573: 0.0486:        kread(4, " p a c k a g e   F i l e".., 8192) = 8192
27263178: 25231573: 0.0489:        __libc_sbrk(0x0000000000010020) = 0x0000000110060AC0
27263178: 25231573: 0.0490:        lseek(4, 556, 0)     = 556
27263178: 25231573: 0.0491:        lseek(4, 0, 1)               = 556
27263178: 25231573: 0.0493:        close(4)             = 0
27263178: 25231573: 0.0494:        statx("lib/File/Spec/Unix.pmc", 0x0FFFFFFFFFFFE430, 176, 0) Err#2  ENOENT
27263178: 25231573: 0.0496:        statx("lib/File/Spec/Unix.pm", 0x0FFFFFFFFFFFE430, 176, 0) = 0
27263178: 25231573: 0.0497:        kopen("lib/File/Spec/Unix.pm", 040000000) = 4
27263178: 25231573: 0.0499:        kioctl(4, 22528, 0x0000000000000000, 0x0000000000000000) Err#25 ENOTTY
27263178: 25231573: 0.0500:        lseek(4, 0, 1)               = 0
27263178: 25231573: 0.0501:        kread(4, " p a c k a g e   F i l e".., 8192) = 8192
27263178: 25231573: 0.0503:        statx("lib/Cwd.pmc", 0x0FFFFFFFFFFFD5D0, 176, 0) Err#2  ENOENT
27263178: 25231573: 0.0504:        statx("lib/Cwd.pm", 0x0FFFFFFFFFFFD5D0, 176, 0) = 0
27263178: 25231573: 0.0506:        kopen("lib/Cwd.pm", 040000000) = 5
27263178: 25231573: 0.0507:        kioctl(5, 22528, 0x0000000000000000, 0x0000000000000000) Err#25 ENOTTY
27263178: 25231573: 0.0508:        lseek(5, 0, 1)               = 0
27263178: 25231573: 0.0510:        kread(5, " p a c k a g e   C w d ;".., 8192) = 8192
27263178: 25231573: 0.0512:        statx("lib/Exporter.pmc", 0x0FFFFFFFFFFFC770, 176, 0) Err#2  ENOENT
27263178: 25231573: 0.0513:        statx("lib/Exporter.pm", 0x0FFFFFFFFFFFC770, 176, 0) = 0
27263178: 25231573: 0.0515:        kopen("lib/Exporter.pm", 040000000) = 6
27263178: 25231573: 0.0516:        kioctl(6, 22528, 0x0000000000000000, 0x0000000000000000) Err#25 ENOTTY
27263178: 25231573: 0.0517:        lseek(6, 0, 1)               = 0
27263178: 25231573: 0.0519:        kread(6, " p a c k a g e   E x p o".., 8192) = 8192
27263178: 25231573: 0.0520:        __libc_sbrk(0x0000000000010020) = 0x0000000110070AE0
27263178: 25231573: 0.0527:        __libc_sbrk(0x0000000000010020) = 0x0000000110080B00
27263178: 25231573: 0.0532:        __libc_sbrk(0x0000000000010020) = 0x0000000110090B20
27263178: 25231573: 0.0536:        lseek(6, 2335, 0)    = 2335
27263178: 25231573: 0.0537:        lseek(6, 0, 1)               = 2335
27263178: 25231573: 0.0538:        close(6)             = 0
27263178: 25231573: 0.0548:        __libc_sbrk(0x0000000000010020) = 0x00000001100A0B40
27263178: 25231573: 0.0555:        __libc_sbrk(0x0000000000010020) = 0x00000001100B0B60
27263178: 25231573: 0.0557:        kread(5, " o r   $ d d   ! =   $ p".., 8192) = 8192
27263178: 25231573: 0.0565:        __libc_sbrk(0x0000000000010020) = 0x00000001100C0B80
27263178: 25231573: 0.0574:        __libc_sbrk(0x0000000000010020) = 0x00000001100D0BA0
27263178: 25231573: 0.0582:        kread(5, " f u n c t i o n s   t o".., 8192) = 4893
27263178: 25231573: 0.0584:        lseek(5, 17025, 0)   = 17025
27263178: 25231573: 0.0586:        lseek(5, 0, 1)               = 17025
27263178: 25231573: 0.0587:        close(5)             = 0
27263178: 25231573: 0.0589:        getuidx(2)           = 0
27263178: 25231573: 0.0590:        getuidx(1)           = 0
27263178: 25231573: 0.0591:        getgidx(2)           = 0
27263178: 25231573: 0.0592:        getgidx(1)           = 0
27263178: 25231573: 0.0593:        statx("lib/XSLoader.pmc", 0x0FFFFFFFFFFFD5D0, 176, 0) Err#2  ENOENT
27263178: 25231573: 0.0595:        statx("lib/XSLoader.pm", 0x0FFFFFFFFFFFD5D0, 176, 0) = 0
27263178: 25231573: 0.0596:        kopen("lib/XSLoader.pm", 040000000) = 5
27263178: 25231573: 0.0598:        kioctl(5, 22528, 0x0000000000000000, 0x0000000000000000) Err#25 ENOTTY
27263178: 25231573: 0.0599:        lseek(5, 0, 1)               = 0
27263178: 25231573: 0.0600:        __libc_sbrk(0x0000000000010020) = 0x00000001100E0BC0
27263178: 25231573: 0.0602:        kread(5, " #   G e n e r a t e d  ".., 8192) = 8192
27263178: 25231573: 0.0609:        lseek(5, 4114, 0)    = 4114
27263178: 25231573: 0.0611:        lseek(5, 0, 1)               = 4114
27263178: 25231573: 0.0612:        close(5)             = 0
27263178: 25231573: 0.0614:        statx("lib/auto/Cwd/Cwd.so", 0x000000011000E5B8, 176, 0) = 0
27263178: 25231573: 0.0616:        statx("lib/auto/Cwd/Cwd.bs", 0x000000011000E5B8, 176, 0) Err#2  ENOENT
27263178: 25231573: 0.0620:        kload("lib/auto/Cwd/Cwd.so", 16842880, "/opt/itsv/applperlbin/perl-5.36.0") = 648518346072921608
27263178:     Received signal #4, SIGILL [default]
27263178: *** process killed ***

something is missing in lib/auto/Cwd/. no idead what Cwd.bs is.

root@aixbuildhostng: /opt/itsv/applperlbin/perl-5.36.0/lib/auto/Cwd # ls
.exists  Cwd.so
root@aixbuildhostng: /opt/itsv/applperlbin/perl-5.36.0/lib/auto/Cwd # ldd Cwd.so
Cwd.so needs:
         /usr/lib/libc.a(shr_64.o)
         /unix
         /usr/lib/libcrypt.a(shr_64.o)
root@aixbuildhostng: /opt/itsv/applperlbin/perl-5.36.0/lib/auto/Cwd # file Cwd.so
Cwd.so: 64-bit XCOFF executable or object module not stripped

@flynn1973
Copy link
Author

make minitest failed one test

t/op/sprintf2 .................. # Failed test 1704 - sprintf( "%.54g", 0.3 ) renders correctly at op/sprintf2.t line 1197
#      got "0.2999999999999999888977697537484345958"
# expected eq "0.299999999999999988897769753748434595763683319091796875"

@flynn1973
Copy link
Author

building without optimization changes nothing

@flynn1973
Copy link
Author

just in case, built a debug-perl and let it run in dbx...output in file

debug_perl_dbx.txt

@bram-perl
Copy link

building without optimization changes nothing

Just to double check: how did you do this?
You used -Doptimize=-O0?

Also: try running make test (I would expect to see more failures in that)

@flynn1973
Copy link
Author

flynn1973 commented Aug 1, 2022

no, optimization was always O2. make test dumps at same task (./perl -Ilib -I. -f pod/buildtoc -q).
edit:
a sorry you meant the build without optimization, just changed the CFLAGS to -Os.

@bram-perl
Copy link

no, optimization was always O2. make test dumps at same task (./perl -Ilib -I. -f pod/buildtoc -q). edit: a sorry you meant the build without optimization, just changed the CFLAGS to -Os.

Can you try with -O0 ? (To completely disable optimizations);
It might also be better to pass this in via ./Configure -Doptimize=-O0 rather then via CFLAGS (to prevent conflicting options; I'm not sure which one takes priority)

For the make test: can you patch the Makefile and for the test_prep target remove the $(generated_pods) part?
i.e.

diff --git a/Makefile.orig b/Makefile
index 63d0e77..dcd56f2 100644
--- a/Makefile.orig
+++ b/Makefile
@@ -806,7 +806,7 @@ _test:

 test_prep_pre: preplibrary utilities $(nonxs_ext)
 test_prep test-prep: test_prep_pre $(MINIPERL_EXE) $(unidatafiles) $(PERL_EXE) \
-       $(dynamic_ext) $(TEST_PERL_DLL) runtests $(generated_pods) common_build
+       $(dynamic_ext) $(TEST_PERL_DLL) runtests common_build
        cd t && (rm -f $(PERL_EXE); $(LNS) ../$(PERL_EXE) $(PERL_EXE))

 test_prep_reonly: $(MINIPERL_EXE) $(PERL_EXE) $(dynamic_ext_re) $(TEST_PERL_DLL)

@demerphq
Copy link
Collaborator

demerphq commented Aug 1, 2022 via email

@flynn1973
Copy link
Author

./miniperl -Ilib t/op/sprintf2.t

here you go

sprintf2_test_out.txt

@flynn1973
Copy link
Author

no, optimization was always O2. make test dumps at same task (./perl -Ilib -I. -f pod/buildtoc -q). edit: a sorry you meant the build without optimization, just changed the CFLAGS to -Os.

Can you try with -O0 ? (To completely disable optimizations); It might also be better to pass this in via ./Configure -Doptimize=-O0 rather then via CFLAGS (to prevent conflicting options; I'm not sure which one takes priority)

For the make test: can you patch the Makefile and for the test_prep target remove the $(generated_pods) part? i.e.

diff --git a/Makefile.orig b/Makefile
index 63d0e77..dcd56f2 100644
--- a/Makefile.orig
+++ b/Makefile
@@ -806,7 +806,7 @@ _test:

 test_prep_pre: preplibrary utilities $(nonxs_ext)
 test_prep test-prep: test_prep_pre $(MINIPERL_EXE) $(unidatafiles) $(PERL_EXE) \
-       $(dynamic_ext) $(TEST_PERL_DLL) runtests $(generated_pods) common_build
+       $(dynamic_ext) $(TEST_PERL_DLL) runtests common_build
        cd t && (rm -f $(PERL_EXE); $(LNS) ../$(PERL_EXE) $(PERL_EXE))

 test_prep_reonly: $(MINIPERL_EXE) $(PERL_EXE) $(dynamic_ext_re) $(TEST_PERL_DLL)

patched the Makefile, were able to run make test...but

Failed 2386 tests out of 578, -312.80% okay.

ähm...this looks awkward.

@demerphq
Copy link
Collaborator

demerphq commented Aug 1, 2022 via email

@flynn1973
Copy link
Author

./miniperl -le'print $^X -e"print q(ok),$/"'

root@aixbuildhostng: /opt/itsv/applperlbin/perl-5.36.0 # ./miniperl -le'print $^X -e"print q(ok),$/"'
ok

meanwhile i tried juggling around CFLAGS, LDFLAGS, with or without threads, various optimization settings...no change.

@flynn1973
Copy link
Author

with this minimal configuration and using xlc instead of gcc everything is going well

#!/usr/bin/ksh

# build 64 bit perl for AIX in a not so fancy way
# Author: some asshole from outer space

export SOURCEDIR=/opt/itsv/applperlbin/perl-5.36.0
export PREFIX=/opt/itsv/applperlbin/install-5.36.0

export LANG=en_US

export OBJECT_MODE=64
export PATH=/opt/freeware/bin:$PATH
export MAKE="gmake"

export CC="cc"



build_perl()
{
set -x
ulimit -a

echo "CC=" $CC
echo "CFLAGS=" $CFLAGS
echo "LD=" $LD
echo "LDFLAGS=" $LDFLAGS
echo "AR=" $AR
echo "ARFLAGS=" $ARFLAGS


./Configure -des \
        -Dprefix=$PREFIX \
        -Dcc="$CC" \
        -Dusethreads \
        -Duseithreads \
        $*

$MAKE  --trace --print-directory -j 8
/usr/sbin/slibclean

}

echo "BUILD ENVIRONMENT:"
/usr/bin/env | /usr/bin/sort | grep -v _proxy | grep -v SSH_

ulimit -a
ulimit -d unlimited
ulimit -m unlimited
ulimit -a


# build 64bit mode
(
  cd $SOURCEDIR
  gmake realclean
  rm config.sh
  export OBJECT_MODE=64


# with -Duse64bitall
# What is the size of a pointer (in bytes)? [4]
#*** You have chosen a maximally 64-bit build,
#*** but your pointers are only 4 bytes wide.
#*** Please rerun Configure without -Duse64bitall.
#*** Since you have quads, you could possibly try with -Duse64bitint.



  build_perl -Duse64bitint
  cd ..
)

cd $SOURCEDIR
$MAKE install
cd ..

root@aixbuildhostng: /opt/itsv/applperlbin/install-5.36.0/bin # ./perl -V
Summary of my perl5 (revision 5 version 36 subversion 0) configuration:

  Platform:
    osname=aix
    osvers=7.1.0.0
    archname=aix-thread-multi-64all
    uname='aix aixbuildhostng 1 7 00fb1a6d4c00 powerpc aix '
    config_args='-des -Dprefix=/opt/itsv/applperlbin/install-5.36.0 -Dcc=cc -Dusethreads -Duseithreads -Duse64bitint'
    hint=recommended
    useposix=true
    d_sigaction=define
    useithreads=define
    usemultiplicity=define
    use64bitint=define
    use64bitall=define
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=define
  Compiler:
    cc='cc -q64'
    ccflags ='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=-1 -qnoansialias -qlanglvl=extc99 -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -q64 -DUSE_64_BIT_ALL -q64'
    optimize='-O'
    cppflags='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT'
    ccversion=''
    gccversion=''
    gccosandvers=''
    intsize=4
    longsize=8
    ptrsize=8
    doublesize=8
    byteorder=87654321
    doublekind=4
    d_longlong=define
    longlongsize=8
    d_longdbl=define
    longdblsize=8
    longdblkind=0
    ivtype='long'
    ivsize=8
    nvtype='double'
    nvsize=8
    Off_t='off_t'
    lseeksize=8
    alignbytes=8
    prototype=define
  Linker and Libraries:
    ld='ld'
    ldflags ='-brtl -bdynamic -b64'
    libpth=/lib /usr/lib /usr/ccs/lib /usr/lib64
    libs=-lpthread -lbind -lnsl -ldbm -ldl -lld -lm -lcrypt -lpthreads -lc
    perllibs=-lpthread -lbind -lnsl -ldl -lld -lm -lcrypt -lpthreads -lc
    libc=/lib/libc.a
    so=a
    useshrplib=false
    libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_aix.xs
    dlext=so
    d_dlsymun=undef
    ccdlflags='  -bE:/opt/itsv/applperlbin/install-5.36.0/lib/perl5/5.36/CORE/perl.exp'
    cccdlflags=' '
    lddlflags='-b64 -bhalt:4 -G -bI:$(PERL_INC)/perl.exp -bE:$(BASEEXT).exp -bnoentry -lpthreads -lc -lm'


Characteristics of this binary (from libperl):
  Compile-time options:
    HAS_TIMES
    MULTIPLICITY
    PERLIO_LAYERS
    PERL_COPY_ON_WRITE
    PERL_DONT_CREATE_GVSV
    PERL_MALLOC_WRAP
    PERL_OP_PARENT
    PERL_PRESERVE_IVUV
    USE_64_BIT_ALL
    USE_64_BIT_INT
    USE_ITHREADS
    USE_LARGE_FILES
    USE_LOCALE
    USE_LOCALE_COLLATE
    USE_LOCALE_CTYPE
    USE_LOCALE_NUMERIC
    USE_LOCALE_TIME
    USE_PERLIO
    USE_PERL_ATOF
    USE_REENTRANT_API
    USE_THREAD_SAFE_LOCALE
  Built under aix
  Compiled at Aug  2 2022 09:40:06
  @INC:
    /opt/itsv/applperlbin/install-5.36.0/lib/perl5/5.36/site_perl
    /opt/itsv/applperlbin/install-5.36.0/perl5/site_perl
    /opt/itsv/applperlbin/install-5.36.0/lib/perl5/5.36/vendor_perl
    /opt/itsv/applperlbin/install-5.36.0/perl5/vendor_perl
    /opt/itsv/applperlbin/install-5.36.0/lib/perl5/5.36
    /opt/itsv/applperlbin/install-5.36.0/perl5/5.36

@flynn1973
Copy link
Author

wikth gcc and minimal...guess this whole topic is more or less a local problem which stems from unsane flags and options.

#!/usr/bin/ksh

# build 64 bit perl for AIX in a not so fancy way
# Author: some asshole from outer space

export SOURCEDIR=/opt/itsv/applperlbin/perl-5.36.0
export PREFIX=/opt/itsv/applperlbin/install-5.36.0

export LANG=en_US

export OBJECT_MODE=64
export PATH=/opt/freeware/bin:$PATH
export MAKE="gmake"

export CC="gcc -maix64"
export LDFLAGS="-Wl,-s -Wl,-lpthreads -Wl,-brtl -Wl,-bdynamic -Wl,-b64 -L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:${PREFIX}/lib/perl5/5.36/CORE:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib"


build_perl()
{
set -x
ulimit -a


./Configure -des \
        -Dprefix=$PREFIX \
        -Dcc="$CC" \
        -Dusethreads \
        -Duseithreads \
        -Dldflags="$LDFLAGS" \
        $*

$MAKE  --trace --print-directory -j 8
/usr/sbin/slibclean

}

echo "BUILD ENVIRONMENT:"
/usr/bin/env | /usr/bin/sort | grep -v _proxy | grep -v SSH_

ulimit -a
ulimit -d unlimited
ulimit -m unlimited
ulimit -a


# build 64bit mode
(
  cd $SOURCEDIR
  gmake realclean
  rm config.sh


# with -Duse64bitall
# What is the size of a pointer (in bytes)? [4]
#*** You have chosen a maximally 64-bit build,
#*** but your pointers are only 4 bytes wide.
#*** Please rerun Configure without -Duse64bitall.
#*** Since you have quads, you could possibly try with -Duse64bitint.



  build_perl -Duse64bitint
  cd ..
)

cd $SOURCEDIR
$MAKE install
cd ..

root@aixbuildhostng: /opt/itsv/applperlbin/install-5.36.0/bin # ./perl -V
Summary of my perl5 (revision 5 version 36 subversion 0) configuration:

  Platform:
    osname=aix
    osvers=7.1.0.0
    archname=aix-thread-multi-64all
    uname='aix aixbuildhostng 1 7 00fb1a6d4c00 powerpc aix '
    config_args='-des -Dprefix=/opt/itsv/applperlbin/install-5.36.0 -Dcc=gcc -maix64 -Dusethreads -Duseithreads -Dldflags=-Wl,-s -Wl,-lpthreads -Wl,-brtl -Wl,-bdynamic -Wl,-b64 -L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/itsv/applperlbin/install-5.36.0/lib/perl5/5.36/CORE:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib -Duse64bitint'
    hint=recommended
    useposix=true
    d_sigaction=define
    useithreads=define
    usemultiplicity=define
    use64bitint=define
    use64bitall=define
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=define
  Compiler:
    cc='gcc -maix64 -maix64'
    ccflags ='-D_THREAD_SAFE -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -fwrapv -fno-strict-aliasing -pipe -maix64 -DUSE_64_BIT_ALL -D_FORTIFY_SOURCE=2'
    optimize='-O'
    cppflags='-D_THREAD_SAFE -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -fwrapv -fno-strict-aliasing -pipe'
    ccversion=''
    gccversion='8.3.0'
    gccosandvers=''
    intsize=4
    longsize=8
    ptrsize=8
    doublesize=8
    byteorder=87654321
    doublekind=4
    d_longlong=define
    longlongsize=8
    d_longdbl=define
    longdblsize=8
    longdblkind=0
    ivtype='long'
    ivsize=8
    nvtype='double'
    nvsize=8
    Off_t='off_t'
    lseeksize=8
    alignbytes=8
    prototype=define
  Linker and Libraries:
    ld='gcc -maix64 -maix64'
    ldflags =' -Wl,-s -Wl,-lpthreads -Wl,-brtl -Wl,-bdynamic -Wl,-b64 -L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:/opt/itsv/applperlbin/install-5.36.0/lib/perl5/5.36/CORE:/opt/freeware/lib64:/opt/freeware/lib:/usr/lib:/lib -Wl,-b64'
    libpth=/opt/freeware/lib /usr/lib /usr/ccs/lib /usr/lib64
    libs=-lpthread -lbind -lnsl -lgdbm -ldbm -ldb -ldl -lld -lm -lcrypt -lpthreads -lc
    perllibs=-lpthread -lbind -lnsl -ldl -lld -lm -lcrypt -lpthreads -lc
    libc=/lib/libc.a
    so=a
    useshrplib=false
    libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_aix.xs
    dlext=so
    d_dlsymun=undef
    ccdlflags='-Xlinker -bE:/opt/itsv/applperlbin/install-5.36.0/lib/perl5/5.36/CORE/perl.exp'
    cccdlflags=' '
    lddlflags='  -Wl,-b64 -Wl,-bhalt:4 -Wl,-G -Wl,-bI:$(PERL_INC)/perl.exp -Wl,-bE:$(BASEEXT).exp -Wl,-bnoentry -lpthreads -lc -lm -L/opt/freeware/lib64 -L/opt/freeware/lib'


Characteristics of this binary (from libperl):
  Compile-time options:
    HAS_TIMES
    MULTIPLICITY
    PERLIO_LAYERS
    PERL_COPY_ON_WRITE
    PERL_DONT_CREATE_GVSV
    PERL_MALLOC_WRAP
    PERL_OP_PARENT
    PERL_PRESERVE_IVUV
    USE_64_BIT_ALL
    USE_64_BIT_INT
    USE_ITHREADS
    USE_LARGE_FILES
    USE_LOCALE
    USE_LOCALE_COLLATE
    USE_LOCALE_CTYPE
    USE_LOCALE_NUMERIC
    USE_LOCALE_TIME
    USE_PERLIO
    USE_PERL_ATOF
    USE_REENTRANT_API
    USE_THREAD_SAFE_LOCALE
  Built under aix
  Compiled at Aug  2 2022 10:24:33
  @INC:
    /opt/itsv/applperlbin/install-5.36.0/lib/perl5/5.36/site_perl
    /opt/itsv/applperlbin/install-5.36.0/perl5/site_perl
    /opt/itsv/applperlbin/install-5.36.0/lib/perl5/5.36/vendor_perl
    /opt/itsv/applperlbin/install-5.36.0/perl5/vendor_perl
    /opt/itsv/applperlbin/install-5.36.0/lib/perl5/5.36
    /opt/itsv/applperlbin/install-5.36.0/perl5/5.36

@bram-perl
Copy link

wikth gcc and minimal...guess this whole topic is more or less a local problem which stems from unsane flags and options.

Personally I would still find it interesting to know which flag/option caused it in the first place..

@flynn1973
Copy link
Author

i looked at it again, removed and readded every configure option but found out nothing. i suspect something from hints/aix.sh is messing up dynamic linking (again), had this kind of troubles in the past (perl 5.00X), but thats only some uneducated head game.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants