tech-toolchain archive

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

ld finding the wrong library

I've just tracked down why I've been failing to build xinit.

The link command used is:

--sysroot=/bsd/current/dest_amd64 -Wl,-rpath,/usr/X11R7/lib -L=/usr/X11R7/lib
    -o xinput  buttonmap.o feedback.o list.o property.o setint.o setmode.o
setptr.o state.o test.o xinput.o -lXi -lm      
-Wl,-rpath-link,/bsd/current/dest_amd64/lib  -L=/lib

and I get an error because XESetWireToEventCookie is undefined.
XESetWireToEventCookie() is referenced in and should be
defined by

However since there is no -lX11 (or a direct reference to is looked for because of the NEEDED entry in
However has an RPATH entry for /usr/X11R7/lib, and the linker
is looking there first.
On my system the installed is dated from late 2009 and doesn't
have XESetWireToEventCookie - so the link fails.

Maybe the --sysroot should affect this - but it doesn't.

I've also noticed that ld is adding a NEEDED entry for into
the xinput program - surely this is wrong.

I've changed the Makefile for xinput to explicitly specify -lX11
to make the build not reference installed libraries.


David Laight:

Home | Main Index | Thread Index | Old Index