Bug 20243 - Missing link against libX11
Summary: Missing link against libX11
Status: RESOLVED FIXED
Alias: None
Product: libxklavier
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: PowerPC Mac OS X (All)
: medium normal
Assignee: Sergey V. Udaltsov
QA Contact: Sergey V. Udaltsov
URL:
Whiteboard:
Keywords: NEEDINFO
Depends on:
Blocks:
 
Reported: 2009-02-21 11:27 UTC by Daniel Macks
Modified: 2009-04-06 15:54 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Daniel Macks 2009-02-21 11:27:21 UTC
libxklavier-3.8 (and all other recent previous versions) uses symbols from libX11, but does not pass -lX11 when linking. That breaks building libxklavier on systems that need -no-undefined, can prevent the lib from being dlopen()ed, and can cause weird breakage for other packages that try to use the lib (*they* might need to pass -lX11 even if they are't x11ish).
Comment 1 Sergey V. Udaltsov 2009-03-31 02:25:13 UTC
According to 

http://webcvs.freedesktop.org/xklavier/libxklavier/libxklavier/Makefile.am?revision=1.22&view=markup

LIBADD include X_LIBS

X_LIBS are populated by AC_PATH_XTRA in

http://webcvs.freedesktop.org/xklavier/libxklavier/configure.in?revision=1.51&view=markup

So libX11 should be linked, I guess. Could you please check?
Comment 2 Daniel Macks 2009-03-31 08:02:05 UTC
My X_LIBS=-L/usr/X11R6/lib; looking at libs.m4 from autoconf-2.63, that is as expected: lots of tests and fallback-tests to *find* x11 (including looking for libX11 various ways) and propagate -L and -I path flags, and some platform-dependent other flags for x11 usage, but not setting any -l flags to link agaist libX11 itself.
Comment 3 Sergey V. Udaltsov 2009-03-31 12:55:53 UTC
You're right, -lX11 is not added to X_LIBS. But in libxklaiver.la I still see

dependency_libs=' -lX11 /usr/lib/libxml2.la /usr/lib/libgobject-2.0.la /usr/lib/libglib-2.0.la -lXi -lxkbfile'

and

$ ldd .libs/libxklavier.so
	linux-vdso.so.1 =>  (0x00007fff1a5fe000)
	libX11.so.6 => /usr/lib/libX11.so.6 (0x00007fdb12020000)
...

So how does your libtool process that situation?
Comment 4 Daniel Macks 2009-04-05 14:16:20 UTC
My libtool obviously *doesn't* link it against libX11 nor mention libX11 in .la or otool (my platform's equivalent of ldd). Given that you *do* get the link, the real question is where/how is your libtool getting it? Is it passed as part of the libtool command (via what Makefile variable, and how is autoconf figuring it out?) or is libtool picking it from a dependent-lib's .la (which one?)
Comment 5 Sergey V. Udaltsov 2009-04-06 15:54:45 UTC
Actually, I see it depends on the system. On some other system it is not autoincluded. So I am adding it to Makefile.am.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.