Hello,
Using:
autoconf-2.63
automake-1.10.2
libtool-2.2.6a
I have some convenience archives linked against several modules.
I wish only required objects to be included in modules.
But libtool's usage of --whole-archive forces the whole archive to be included in the module.
I could not find any way to disable the --whole-archive injection.
In the following example, both a.c and b.c are compiled and added to module.so, although
only a.c is actually used.
Removing the -Wl,--whole-archive from compilation solves this issue.
The following is produced by libtool:
bin/sh ./libtool --tag=CC --mode=link gcc -g -O2 -avoid-version -module -shared -no-undefined -o
module.la -rpath /usr/local/lib m.lo
lib1.la
libtool: link: gcc -shared .libs/m.o -Wl,--whole-archive ./.libs/lib1.a -Wl,--no-whole-archive -Wl,-soname -Wl,module.so -o .libs/module.so
Can anyone help?
Thanks!
Alon Bar-Lev.
---
AUTOMAKE_OPTIONS = foreign 1.10
ACLOCAL_AMFLAGS = -I m4
noinst_LTLIBRARIES =
lib1.lalib_LTLIBRARIES =
module.lalib1_la_SOURCES = a.c b.c
module_la_SOURCES = m.c
module_la_LIBADD =
lib1.la
module_la_LDFLAGS = -avoid-version -module -shared -no-undefined