Bug 60301

Summary: Cannot exchange libtool bundled with apr with a newer one
Product: Tomcat Native Reporter: Michael Osipov <1983-01-06>
Component: LibraryAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 1.2.10   
Target Milestone: ---   
Hardware: HP   
OS: HP-UX   

Description Michael Osipov 2016-10-24 13:42:25 UTC
Note: I have selected HP-UX because my problem is on HP-UX but this is probably the case on all Unix platforms with different compilers.

My configuration:

tcnative 1.2.10:
$ uname -a
HP-UX blnn724x B.11.31 U ia64 HP-UX
$ export CC=/opt/aCC/bin/aCC
$ $CC --version
aCC: HP C/aC++ B3910B A.06.25.01 [May 17 2010]

$ ./build/buildcheck.sh
buildconf: checking installation...
buildconf: python version 2.7.12 (ok)
buildconf: autoconf version 2.69 (ok)
buildconf: libtool version 2.4.6 (ok)

$ /usr/local/apr/bin/apr-1-config --version
1.5.1

$./configure --with-ssl=/opt/openssl --with-apr=/usr/local/apr --with-java-home=/opt/java8 --prefix=/tmp/tcnative --libdir=/tmp/tcnative/lib/hpux32

$gmake
...
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=link  /opt/aCC/bin/aCC -Ae -Ae +Z -mt  -O -I/usr/local/include -I/usr/contrib/X11R6/include -DHAVE_CONFIG_H  -DHPUX11 -D_REENTRANT -D_HPUX_SOURCE -D_LARGEFILE64_SOURCE  -O -I/usr/local/include -I/usr/contrib/X11R6/include -g -DHAVE_OPENSSL   -I/tmp/tomcat-native-1.2.10-src/native/include -I/opt/java8/include -I/opt/java8/include/hpux -I/opt/openssl/include  -I/usr/local/apr/include/apr-1   -version-info 2:10:2   -Wl,+b -Wl,/usr/local/lib/hpux32 -L/usr/local/lib/hpux32 -L/usr/contrib/X11R6/lib -o libtcnative-1.la -rpath /tmp/tcnative/lib/hpux32 src/address.lo src/bb.lo src/dir.lo src/error.lo src/file.lo src/info.lo src/jnilib.lo src/lock.lo src/misc.lo src/mmap.lo src/multicast.lo src/network.lo src/os.lo src/poll.lo src/pool.lo src/proc.lo src/shm.lo src/ssl.lo src/sslcontext.lo src/sslinfo.lo src/sslnetwork.lo src/sslutils.lo src/stdlib.lo src/thread.lo src/user.lo os/unix/system.lo os/unix/uxpipe.lo -L/opt/openssl/lib -Wl,+b: -lssl -lcrypto  /usr/local/apr/lib/libapr-1.la -lrt -lm  -lpthread
(Bundled) cc: warning 922: "-b" is unsupported in the bundled compiler, ignored.
(Bundled) cc: warning 922: "-O" is unsupported in the bundled compiler, ignored.
(Bundled) cc: warning 922: "-O" is unsupported in the bundled compiler, ignored.
ld: (Warning) Unsatisfied symbol "main" in file /usr/lib/hpux32/libc.so.1
1 warning.
gmake[1]: Leaving directory '/tmp/tomcat-native-1.2.10-src/native'

As you can see, several warnings are issued. APR has been obtained from the HP-UX Porting Archive [1].
The reason for this is the apr-rules.mk copied to build/rules.mk which has LIBTOOL statically set. The bundled libtool is older than the one on my system which does produce a valid output:

/usr/local/bin/libtool --silent --mode=link  /opt/aCC/bin/aCC -Ae -Ae +Z -mt  -O -I/usr/local/include -I/usr/contrib/X11R6/include -DHAVE_CONFIG_H  -DHPUX11 -D_REENTRANT -D_HPUX_SOURCE -D_LARGEFILE64_SOURCE  -O -I/usr/local/include -I/usr/contrib/X11R6/include -g -DHAVE_OPENSSL   -I/tmp/tomcat-native-1.2.10-src/native/include -I/opt/java8/include -I/opt/java8/include/hpux -I/opt/openssl/include  -I/usr/local/apr/include/apr-1   -version-info 2:10:2   -Wl,+b -Wl,/usr/local/lib/hpux32 -L/usr/local/lib/hpux32 -L/usr/contrib/X11R6/lib -o libtcnative-1.la -rpath /tmp/tcnative/lib/hpux32 src/address.lo src/bb.lo src/dir.lo src/error.lo src/file.lo src/info.lo src/jnilib.lo src/lock.lo src/misc.lo src/mmap.lo src/multicast.lo src/network.lo src/os.lo src/poll.lo src/pool.lo src/proc.lo src/shm.lo src/ssl.lo src/sslcontext.lo src/sslinfo.lo src/sslnetwork.lo src/sslutils.lo src/stdlib.lo src/thread.lo src/user.lo os/unix/system.lo os/unix/uxpipe.lo -L/opt/openssl/lib -Wl,+b: -lssl -lcrypto  /usr/local/apr/lib/libapr-1.la -lrt -lm  -lpthread
gmake[1]: Leaving directory '/tmp/tomcat-native-1.2.10-src/native'

At best, in Makefile.in one could compare LIBTOOL passed to ./configure against the one from APR and reset it.

This is similar to: 60290
Comment 1 Mark Thomas 2017-08-23 21:13:20 UTC
Fixed for 1.2.13 onwards.