Subject: libtool ignoring parameters in link mode ?

From: Marc Espie <[email-masked]>
Date: Wed, 11 Jul 2012 11:28:32 +0200

This behavior verified in old libtool-1.5 and in most recent libtool-2.4...

I'm pretty sure that's  not intentional design. Maybe it is, but
undocumented.

I've seen several instances of bogus build infrastructures doing
wacky things such as

libtool link cc -o somelib --export-symbols a.def ...

or
libtool link cc -o prog a.c a.o

in both cases, this 'works': in the end link command, the extra
stuff simply gets ignored.
So in the first case, --export-symbols which is a mispelled -export-symbols
gets ignored.
And in the second case, the extra copy of the c file gets ignored.

I'm pretty much surprised, I thought that in general, whatever you passed
to libtool that it didn't know about it would just pass it along to the
linker stage.

At the very least, I believe that simply ignoring  those extra arguments
is very dangerous...   in the first case, you end up having a library that
exports every symbol where you thought you only were exporting some symbols!