[PATCH] Xext: Link to external libraries when necessary.

Eamon Walsh ewalsh at tycho.nsa.gov
Mon Mar 8 13:33:37 PST 2010


Although the DDX should be linked to the necessary libraries, we may
also need to pull them in directly to the module to ensure the symbols
are resolved at runtime. Should fix this bug with XSELINUX:

/usr/bin/X: symbol lookup error:
/usr/lib64/xorg/modules/extensions/libextmod.so: undefined symbol:
is_selinux_enabled

-v2: use _LIBADD instead of _LIBS; remove SELINUX_LIBS from
     XSERVER_SYS_LIBS as it should only be needed in extmod.

Signed-off-by: Dan Nicholson <dbn.lists at gmail.com>
Signed-off-by: Eamon Walsh <ewalsh at tycho.nsa.gov>
---
 Xext/Makefile.am |    4 ++++
 configure.ac     |    2 +-
 2 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/Xext/Makefile.am b/Xext/Makefile.am
index 7287c4a..193d6e5 100644
--- a/Xext/Makefile.am
+++ b/Xext/Makefile.am
@@ -32,6 +32,7 @@ BUILTIN_SRCS =			\
 
 # Sources always included in libXextmodule.la & libXext.la. That's right, zero.
 MODULE_SRCS =
+MODULE_LIBS =
 
 # Optional sources included if extension enabled by configure.ac rules
 
@@ -83,6 +84,7 @@ endif
 XSELINUX_SRCS = xselinux_ext.c xselinux_hooks.c xselinux_label.c xselinux.h xselinuxint.h
 if XSELINUX
 MODULE_SRCS += $(XSELINUX_SRCS)
+MODULE_LIBS += $(SELINUX_LIBS)
 endif
 
 # Security extension: multi-level security to protect clients from each other
@@ -119,11 +121,13 @@ endif
 # Now take all of the above, mix well, bake for 10 minutes and get libXext*.la
 
 libXext_la_SOURCES =		$(BUILTIN_SRCS) $(MODULE_SRCS)
+libXext_la_LIBADD =		$(MODULE_LIBS)
 
 if XORG
 libXextbuiltin_la_SOURCES =	$(BUILTIN_SRCS)
 
 libXextmodule_la_SOURCES =	$(MODULE_SRCS)
+libXextmodule_la_LIBADD =	$(MODULE_LIBS)
 endif
 
 EXTRA_DIST = \
diff --git a/configure.ac b/configure.ac
index 0579551..3e8ea10 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1432,7 +1432,7 @@ PKG_CHECK_MODULES([XSERVERLIBS], [$REQUIRED_LIBS])
 #
 XSERVER_CFLAGS="${XSERVER_CFLAGS} ${XSERVERCFLAGS_CFLAGS}"
 XSERVER_LIBS="$DIX_LIB $CONFIG_LIB $MI_LIB $OS_LIB"
-XSERVER_SYS_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} ${LIBS} ${SELINUX_LIBS}"
+XSERVER_SYS_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} ${LIBS}"
 AC_SUBST([XSERVER_LIBS])
 AC_SUBST([XSERVER_SYS_LIBS])
 
-- 
1.7.0


--------------070002030304040401070106--


More information about the xorg-devel mailing list