bug-libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

libtool : .o files are ignored when mixing .lo and .o files


From: Nicolas PENINGUY
Subject: libtool : .o files are ignored when mixing .lo and .o files
Date: Sun, 21 Nov 2010 00:53:08 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.12) Gecko/20101103 Fedora/1.0-0.33.b2pre.fc14 Thunderbird/3.1.6

Dear libtool maintainers,

I ran into the following problem while trying to add some systemtap trace support to Xorg Server. An object file (stap_probes.o below) is generated using the "dtrace" utility, and then added in Makefile.am using "libexa_la_LIBADD += stap_probes.o".

During build, the following command is run (that doltlibtool thing ends up calling libtool) :

../doltlibtool --tag=CC --mode=link gcc -std=gnu99 -DHAVE_XORG_CONFIG_H -fvisibility=hidden -DXF86PM -DHAVE_DIX_CONFIG_H -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -fno-strict-aliasing -Wbad-function-cast -Wformat=2 -Wold-style-definition -Wdeclaration-after-statement -D_BSD_SOURCE -DHAS_FCHOWN -DHAS_STICKY_DIR_BIT -I/usr/include/pixman-1 -I/usr/include/freetype2 -I../include -I../include -I../Xext -I../composite -I../damageext -I../xfixes -I../Xi -I../mi -I../miext/shadow -I../miext/damage -I../render -I../randr -I../fb -fvisibility=hidden -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Wstrict-overflow -rdynamic -Os -o libexa.la exa.lo exa_classic.lo exa_migration_classic.lo exa_driver.lo exa_mixed.lo exa_migration_mixed.lo exa_accel.lo exa_glyphs.lo exa_offscreen.lo exa_render.lo exa_unaccel.lo stap_probes.o -laudit -lm -lrt


Then I get this expected warning message :

*** Warning: Linking the shared library libexa.la against the non-libtool
*** objects  stap_probes.o is not portable!

And then libtool runs the "ar" utility :

libtool: link: ar cru .libs/libexa.a .libs/exa.o .libs/exa_classic.o .libs/exa_migration_classic.o .libs/exa_driver.o .libs/exa_mixed.o .libs/exa_migration_mixed.o .libs/exa_accel.o .libs/exa_glyphs.o .libs/exa_offscreen.o .libs/exa_render.o .libs/exa_unaccel.o


As you can see, the "stap_probes.o" object is missing in the command line.

I tried with :
- libtool (GNU libtool) 2.2.10
- libtool (GNU libtool 1.3310 2010-11-15) 2.4.1a (git snapshot from today)


I tried to trace it in the libtool script, here is what I've found :

1. the ".o" file is put in the objs variable :

*.$objext)
    # A standard object.
    objs="$objs $arg"
    ;;

2. the ".so" files are put in the libobjs variable.

3. the libobjs value is saved into the libobjs_save variable :

    libobjs_save="$libobjs"

4. latter, when the warning is issued, objs is added to libobjs :

    libobjs="$libobjs $objs"

5. the variable oldobjs is initialized using the libobjs_save value (not containing .o file) :

    oldobjs="$libobjs_save $symfileobj"


So :
- libobjs (seems to be used to build a dynamic library) contains the .o file and the .lo files. - oldobjs (used to build traditional libray using ar) contains only the .lo files.

Is it a bug in libtool or an intentional behaviour ?

Thanks a lot,

Nicolas Peninguy




reply via email to

[Prev in Thread] Current Thread [Next in Thread]