I figured out what was causing the linking problems. It turns out that doing an "osc build" sets the environment variable "LD_AS_NEEDED", which causes the linker ot behave as if "--as-needed" were given in the command line. We are using cmake, and give the X libraries using the following line in CMakeLists.txt:

    set(CMAKE_EXE_LINKER_FLAGS "-lX11 -lXtst -lXi")

This produces the offending command line in Makefile:

/usr/bin/gcc -Wall -m32 -lX11 -lXtst -lXi CMakeFiles/fala_pixelchanged.dir/main.c.o -o fala_pixelchanged

The reason for the linker complaints is that the X libraries precede main.c.o in the command line. At the point where the linker sees the libraries, there are no references to symbols in them, so the linker just discards the libraries.

What had me baffled for a while was that doing an "osc chroot" into the build and running "make" there produced no complaints from the linker even though the command lines were identical. If at all possible, it would be nice to have "--as-needed" as an explicit linker flag instead of magically modifying the linker's default behavior with an environment variable.
--
Pertti

_______________________________________________
MeeGo-dev mailing list
[email protected]
http://lists.meego.com/listinfo/meego-dev

Reply via email to