Subject: linking with externally generated objects

From: Nikos Mavrogiannopoulos <[email-masked]>
Date: Mon, 11 Apr 2011 19:18:23 +0200

Hello,
 I use yasm to generate some objects and I want to include
them into a (static) library using libtool. I use automake
that in the end runs libtool as:
../../../libtool  --tag=CC   --mode=link gcc -std=gnu99
-fdiagnostics-show-option -g -O2 -maes -mpclmul   -o libintel.la
aes-x86.lo x64_do_rdtsc.o x64_iaesx64.o  -ldl -lpthread

The x64_do_rdtsc.o x64_iaesx64.o are the yasm generated files. libtool
then reports:
*** Warning: Linking the shared library libintel.la against the non-libtool
*** objects  x64_do_rdtsc.o x64_iaesx64.o is not portable!
libtool: link: rm -fr  .libs/libintel.a .libs/libintel.la
libtool: link: ar cru .libs/libintel.a .libs/aes-x86.o
libtool: link: ranlib .libs/libintel.a

and doesn't include the yasm generated files at all! This doesn't
seem correct. I attach a patch that fixes the issue for me
although I don't know whether I really fix the underlying issue.

regards,
Nikos
--- libtool.orig	2011-04-11 19:12:54.000000000 +0200
+++ libtool	2011-04-11 19:13:11.000000000 +0200
@@ -7698,6 +7698,7 @@
 	  $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
 	  $ECHO "*** objects $objs is not portable!"
 	  libobjs+=" $objs"
+	  libobjs_save+=" $objs"
 	fi
       fi