i digged a little deeper and i think i found the root cause.
apr_source_distributiom/build/libtool.m4
# Determine the default libpath from the value encoded in an
# empty executable.
_LT_SYS_MODULE_PATH_AIX([$1])
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
else
if test ia64 = "$host_cpu"; then
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
_LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
_LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
else
# Determine the default libpath from the value encoded in an
# empty executable.
_LT_SYS_MODULE_PATH_AIX([$1])
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
not shure how to fix this up, libtool is one of my "kryptonites", still would be nice to convince the apache guys to patch this.
------------------------------
I regret starting this entire conversation
------------------------------
Original Message:
Sent: Wed June 24, 2020 10:49 AM
From: C- -T
Subject: compile/linking troubles with aixtoolbox utilities
thank your for saving my day !
for reference, doing the following fixes up the runtime linking problems:
after configure is run:/opt/freeware/bin/sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' $BUILDPATH/httpd/srclib/apr/libtoolresult:root@aixbuildhostng: /tmp/aptest/bin # dump -X64 -ovH httpdhttpd: ***Object Module Header***# Sections Symbol Ptr # Symbols Opt Hdr Len Flags 4 0x00000000 0 120 0x100fFlags=( RELFLG EXEC LNNO LSYMS DYNLOAD DEP_SYSTEM )Timestamp = "Jun 24 16:40:12 2020"Magic = 0x1f7 (64-bit XCOFF) ***Optional Header***Tsize Dsize Bsize Tstart Dstart0x00077ad4 0x0000c59c 0x00003898 0x10000240 0x20000d14SNloader SNentry SNtext SNtoc SNdata0x0004 0x0002 0x0001 0x0002 0x0002TXTalign DATAalign TOC vstamp entry0x0007 0x0004 0x2000bcc8 0x0001 0x200061a0maxSTACK maxDATA SNbss magic modtype0x00000000 0x00000000 0x0003 0x010b 1L ***Loader Section*** Loader Header InformationVERSION# #SYMtableENT #RELOCent LENidSTR0x00000001 0x000006c1 0x000012ee 0x0000009f#IMPfilID OFFidSTR LENstrTBL OFFstrTBL0x00000007 0x0001d130 0x00009267 0x0001d1cf ***Import File Strings***INDEX PATH BASE MEMBER0 /tmp/aptest/lib:/usr/lib:/lib1 libpcre.a libpcre.so.12 libaprutil-1.so3 libexpat.a libexpat.so.14 libapr-1.so5 libpthread.a shr_xpg5_64.o6 libc.a shr_64.oroot@aixbuildhostng: /tmp/aptest/bin # ldd httpdhttpd needs: /tmp/aptest/lib/libpcre.a(libpcre.so.1) /tmp/aptest/lib/libaprutil-1.so /tmp/aptest/lib/libexpat.a(libexpat.so.1) /tmp/aptest/lib/libapr-1.so /usr/lib/libpthread.a(shr_xpg5_64.o) /usr/lib/libc.a(shr_64.o) /tmp/aptest/lib/libgcc_s.a(shr.o) /tmp/aptest/lib/libiconv.a(libiconv.so.2) /unix /usr/lib/libcrypt.a(shr_64.o)
------------------------------
I regret starting this entire conversation
Original Message:
Sent: Wed June 24, 2020 09:45 AM
From: Ayappan P
Subject: compile/linking troubles with aixtoolbox utilities
You need to look into the libtool script. For AIX Toolbox httpd build , " /opt/freeware/lib/apr-1/build/libtool " is used.
In that you need to check this " hardcode_libdir_flag_spec " value.
------------------------------
Ayappan P
Original Message:
Sent: Wed June 24, 2020 09:03 AM
From: C- -T
Subject: compile/linking troubles with aixtoolbox utilities
i tried to relink with rtl_enable but this kills the binary...
rtl_enable -X64 -o /tmp/aptest/bin/httpd_fixed /tmp/aptest/bin/httpd -blibpath:/tmp/aptest/lib:/usr/lib:/libroot@aixbuildhostng: /home/packagebuilder/apache2-itsv # dump -X64 -ovH /tmp/aptest/bin/httpd_fixed/tmp/aptest/bin/httpd_fixed: ***Object Module Header***# Sections Symbol Ptr # Symbols Opt Hdr Len Flags 4 0x00000000 0 120 0x100fFlags=( RELFLG EXEC LNNO LSYMS DYNLOAD DEP_SYSTEM )Timestamp = "Jun 24 14:53:19 2020"Magic = 0x1f7 (64-bit XCOFF) ***Optional Header***Tsize Dsize Bsize Tstart Dstart0x0007f098 0x0000dc68 0x00003890 0x00000000 0x00000000SNloader SNentry SNtext SNtoc SNdata0x0004 0x0002 0x0001 0x0002 0x0002TXTalign DATAalign TOC vstamp entry0x0007 0x0004 0x0000afb8 0x0001 0x00005490maxSTACK maxDATA SNbss magic modtype0x00000000 0x00000000 0x0003 0x010b 1L ***Loader Section*** Loader Header InformationVERSION# #SYMtableENT #RELOCent LENidSTR0x00000001 0x000006c1 0x000015c6 0x0000009f#IMPfilID OFFidSTR LENstrTBL OFFstrTBL0x00000007 0x0001feb0 0x00009267 0x0001ff4f ***Import File Strings***INDEX PATH BASE MEMBER0 /tmp/aptest/lib:/usr/lib:/lib1 libc.a shr_64.o2 libpthread.a shr_xpg5_64.o3 libapr-1.so4 libpcre.a libpcre.so.15 libaprutil-1.so6 libexpat.a libexpat.so.1root@aixbuildhostng: /home/packagebuilder/apache2-itsv # /tmp/aptest/bin/httpd_fixed -t -D DUMP_MODULESIllegal instruction
------------------------------
I regret starting this entire conversation
Original Message:
Sent: Wed June 24, 2020 06:36 AM
From: C- -T
Subject: compile/linking troubles with aixtoolbox utilities
hi,
i need to compile a self contained httpd distribution, which need stricts library search paths in the binaries. i found out that
something is messing up the resulting binaries.
i use the following build settings, mostly stolen from your httpd spec file:
export OBJECT_MODE=64export AR="/usr/bin/ar -X64"export LD="/usr/bin/ld"export RM="/usr/bin/rm -f"export CC="/usr/bin/gcc"export CXX="/usr/bin/g++"export LTFLAGS="--tag=CC --silent"export CFLAGS="-maix64 -fsigned-char -D_LARGE_FILES -O2 -I$OPENSSLSPATH/include -I/opt/freeware/include"export LDFLAGS="-L$APPATH/lib -L$OPENSSLPATH/lib -L/opt/freeware/lib64 -L/opt/freeware/lib -Wl,-blibpath:$APPATH/lib:/usr/lib:/lib"export CXXFLAGS=$CFLAGS
the resulting bins contains a messed up search path (httpd for example):
root@aixbuildhostng: /tmp/apatest/bin # dump -X64 -ovH httpdhttpd: ***Object Module Header***# Sections Symbol Ptr # Symbols Opt Hdr Len Flags 4 0x00000000 0 120 0x100fFlags=( RELFLG EXEC LNNO LSYMS DYNLOAD DEP_SYSTEM )Timestamp = "Jun 24 12:17:59 2020"Magic = 0x1f7 (64-bit XCOFF) ***Optional Header***Tsize Dsize Bsize Tstart Dstart0x00077ad4 0x0000c59c 0x00003898 0x10000240 0x20000d14SNloader SNentry SNtext SNtoc SNdata0x0004 0x0002 0x0001 0x0002 0x0002TXTalign DATAalign TOC vstamp entry0x0007 0x0004 0x2000bcc8 0x0001 0x200061a0maxSTACK maxDATA SNbss magic modtype0x00000000 0x00000000 0x0003 0x010b 1L ***Loader Section*** Loader Header InformationVERSION# #SYMtableENT #RELOCent LENidSTR0x00000001 0x000006c1 0x000012ee 0x000000c3#IMPfilID OFFidSTR LENstrTBL OFFstrTBL0x00000007 0x0001d130 0x00009267 0x0001d1f3 ***Import File Strings***INDEX PATH BASE MEMBER0 /opt/freeware/lib:/tmp/apatest/lib:/tmp/apatest/lib:/usr/lib:/lib1 libpcre.a libpcre.so.12 libaprutil-1.so3 libexpat.a libexpat.so.14 libapr-1.so5 libpthread.a shr_xpg5_64.o6 libc.a shr_64.o
Index0 should contain only "/apatest/lib:/usr/lib:/lib" IMHO. i highly supsect some auttool/libtool rubbish acting up somewhere somehow.
funnily this only concern the binaries (httpd,ab...), the modules are all correctly linked.
any hints whats going on, i'm out of ideas?
------------------------------
I regret starting this entire conversation
------------------------------