Subject: linktime optimizations and libtool

From: Santosh Zanjurne <[email-masked]>
Date: Fri, 9 Nov 2012 16:34:56 +0530

At linker execution time, libtool doesnt use the linkflags in the actual
command invoked.  Can we fix this?

e.g.  In the following command libtools knows what are the link flags, but
it doesnt use them while actually invoking the link command.   This results
in error for Open64 compiler while using 'link time optimizations'.

/bin/sh ../libtool --tag=CC --mode=link opencc  -O0 -keep -IPA:siloed=off
-IPA:preopt=on -OPT:alias=field_sensitive -OPT:wssa=on   -o
libdroplet.la-rpath /usr/local/lib -L/usr/lib -lxml2 -lz -lm
-L/usr/lib -ljson
-L/usr/lib -L/usr/kerberos/lib -lssl -lcrypto -ldl -lz   -pthread
 -version-info 0:0:0 -no-undefined src/libdroplet_la-conn.lo
src/libdroplet_la-converters.lo src/libdroplet_la-value.lo
src/libdroplet_la-dict.lo src/libdroplet_la-droplet.lo
src/libdroplet_la-httprequest.lo src/libdroplet_la-httpreply.lo
src/libdroplet_la-pricing.lo src/libdroplet_la-profile.lo
src/libdroplet_la-req.lo src/libdroplet_la-vec.lo src/libdroplet_la-sbuf.lo
src/libdroplet_la-ntinydb.lo src/libdroplet_la-utils.lo
src/libdroplet_la-rest.lo src/libdroplet_la-sysmd.lo
src/libdroplet_la-task.lo src/libdroplet_la-async.lo
src/libdroplet_la-getdate.lo src/libdroplet_la-vfs.lo
s3/libdroplet_la-backend.lo s3/libdroplet_la-replyparser.lo
s3/libdroplet_la-reqbuilder.lo s3/libdroplet_la-s3.lo
cdmi/libdroplet_la-backend.lo cdmi/libdroplet_la-replyparser.lo
cdmi/libdroplet_la-reqbuilder.lo cdmi/libdroplet_la-crcmodel.lo
cdmi/libdroplet_la-object_id.lo cdmi/libdroplet_la-cdmi.lo
srws/libdroplet_la-backend.lo srws/libdroplet_la-replyparser.lo
srws/libdroplet_la-reqbuilder.lo srws/libdroplet_la-srws.lo
posix/libdroplet_la-posix.lo posix/libdroplet_la-backend.lo  -lm

opencc -shared  src/.libs/libdroplet_la-conn.o
src/.libs/libdroplet_la-converters.o src/.libs/libdroplet_la-value.o
src/.libs/libdroplet_la-dict.o src/.libs/libdroplet_la-droplet.o
src/.libs/libdroplet_la-httprequest.o src/.libs/libdroplet_la-httpreply.o
src/.libs/libdroplet_la-pricing.o src/.libs/libdroplet_la-profile.o
src/.libs/libdroplet_la-req.o src/.libs/libdroplet_la-vec.o
src/.libs/libdroplet_la-sbuf.o src/.libs/libdroplet_la-ntinydb.o
src/.libs/libdroplet_la-utils.o src/.libs/libdroplet_la-rest.o
src/.libs/libdroplet_la-sysmd.o src/.libs/libdroplet_la-task.o
src/.libs/libdroplet_la-async.o src/.libs/libdroplet_la-getdate.o
src/.libs/libdroplet_la-vfs.o s3/.libs/libdroplet_la-backend.o
s3/.libs/libdroplet_la-replyparser.o s3/.libs/libdroplet_la-reqbuilder.o
s3/.libs/libdroplet_la-s3.o cdmi/.libs/libdroplet_la-backend.o
cdmi/.libs/libdroplet_la-replyparser.o
cdmi/.libs/libdroplet_la-reqbuilder.o cdmi/.libs/libdroplet_la-crcmodel.o
cdmi/.libs/libdroplet_la-object_id.o cdmi/.libs/libdroplet_la-cdmi.o
srws/.libs/libdroplet_la-backend.o srws/.libs/libdroplet_la-replyparser.o
srws/.libs/libdroplet_la-reqbuilder.o srws/.libs/libdroplet_la-srws.o
posix/.libs/libdroplet_la-posix.o posix/.libs/libdroplet_la-backend.o
 -L/usr/lib -lxml2 -ljson -L/usr/kerberos/lib -lssl -lcrypto -ldl -lz -lm
-lc  -pthread -Wl,-soname -Wl,libdroplet.so.0 -o .libs/libdroplet.so.0.0.0

Regards,
Santosh