Up: FAQ


13.1 Why does libtool strip link flags when creating a library?

When creating a shared library, but not when compiling or creating a program, libtool drops some flags from the command line provided by the user. This is done because flags unknown to libtool may interfere with library creation or require additional support from libtool, and because omitting flags is usually the conservative choice for a successful build.

If you encounter flags that you think are useful to pass, as a work-around you can prepend flags with -Wc, or -Xcompiler to allow them to be passed through to the compiler driver (see Link mode). Another possibility is to add flags already to the compiler command at configure run time:

     ./configure CC='gcc -m64'

If you think libtool should let some flag through by default, here's how you can test such an inclusion: grab the Libtool development tree, edit the ltmain.m4sh file in the libltdl/config subdirectory to pass through the flag (search for ‘Flags to be passed through’), re-bootstrap and build with the flags in question added to LDFLAGS, CFLAGS, CXXFLAGS, etc. on the configure command line as appropriate. Run the testsuite as described in the README file and report results to the Libtool bug reporting address bug-libtool@gnu.org.