[PATCH] This fixes an error with compiling the xserver with SELinux enabled.

Justin P. Mattock justinmattock at gmail.com
Thu Feb 25 22:00:28 PST 2010


Latest HEAD fails to build with SELinux enabled.
Below is a fix that worked for me. not sure if its
legit or not(please look and review).

libpixman-1.so /usr/lib/libXdmcp.so /usr/lib/libaudit.so -lwrap -lm -lrt
../../Xext/.libs/libXext.a(xselinux_ext.o): In function `SELinuxExtensionInit':
xselinux_ext.c:(.text+0x5): undefined reference to `is_selinux_enabled'
xselinux_ext.c:(.text+0x29): undefined reference to `security_get_boolean_active'
../../Xext/.libs/libXext.a(xselinux_ext.o): In function `ProcSELinuxSetDeviceContext':
xselinux_ext.c:(.text+0x2b4): undefined reference to `security_check_context_raw'
xselinux_ext.c:(.text+0x2c5): undefined reference to `avc_context_to_sid_raw'
../../Xext/.libs/libXext.a(xselinux_ext.o): In function `ProcSELinuxSetCreateContext':
xselinux_ext.c:(.text+0x3f4): undefined reference to `security_check_context_raw'
xselinux_ext.c:(.text+0x403): undefined reference to `avc_context_to_sid_raw'
../../Xext/.libs/libXext.a(xselinux_ext.o): In function `SELinuxPopulateItem':
xselinux_ext.c:(.text+0x4ba): undefined reference to `avc_sid_to_context_raw'
xselinux_ext.c:(.text+0x4cb): undefined reference to `avc_sid_to_context_raw'
../../Xext/.libs/libXext.a(xselinux_ext.o): In function `SELinuxSendContextReply':
xselinux_ext.c:(.text+0x564): undefined reference to `avc_sid_to_context_raw'
xselinux_ext.c:(.text+0x5c8): undefined reference to `freecon'
../../Xext/.libs/libXext.a(xselinux_ext.o): In function `SELinuxFreeItems':
xselinux_ext.c:(.text+0x788): undefined reference to `freecon'
xselinux_ext.c:(.text+0x795): undefined reference to `freecon'
../../Xext/.libs/libXext.a(xselinux_hooks.o): In function `SELinuxDoCheck':
xselinux_hooks.c:(.text+0xd7): undefined reference to `avc_has_perm'
../../Xext/.libs/libXext.a(xselinux_hooks.o): In function `SELinuxScreen':
xselinux_hooks.c:(.text+0x1e0): undefined reference to `avc_compute_create'
../../Xext/.libs/libXext.a(xselinux_hooks.o): In function `SELinuxFlaskInit':
xselinux_hooks.c:(.text+0x24c): undefined reference to `selinux_set_callback'
xselinux_hooks.c:(.text+0x25d): undefined reference to `selinux_set_callback'
xselinux_hooks.c:(.text+0x269): undefined reference to `selinux_set_mapping'
xselinux_hooks.c:(.text+0x280): undefined reference to `avc_open'
xselinux_hooks.c:(.text+0x299): undefined reference to `security_get_initial_context_raw'
xselinux_hooks.c:(.text+0x2b2): undefined reference to `avc_context_to_sid_raw'
xselinux_hooks.c:(.text+0x2c4): undefined reference to `freecon'
xselinux_hooks.c:(.text+0x375): undefined reference to `avc_netlink_acquire_fd'
xselinux_hooks.c:(.text+0x570): undefined reference to `getcon_raw'
xselinux_hooks.c:(.text+0x585): undefined reference to `avc_context_to_sid_raw'
xselinux_hooks.c:(.text+0x59e): undefined reference to `freecon'
../../Xext/.libs/libXext.a(xselinux_hooks.o): In function `SELinuxResource':
xselinux_hooks.c:(.text+0x10cf): undefined reference to `avc_compute_create'
../../Xext/.libs/libXext.a(xselinux_hooks.o): In function `SELinuxExtension':
xselinux_hooks.c:(.text+0x1297): undefined reference to `avc_compute_create'
../../Xext/.libs/libXext.a(xselinux_hooks.o): In function `SELinuxResourceState':
xselinux_hooks.c:(.text+0x134a): undefined reference to `avc_sid_to_context_raw'
xselinux_hooks.c:(.text+0x13a9): undefined reference to `freecon'
xselinux_hooks.c:(.text+0x13cd): undefined reference to `avc_sid_to_context_raw'
xselinux_hooks.c:(.text+0x141d): undefined reference to `freecon'
../../Xext/.libs/libXext.a(xselinux_hooks.o): In function `SELinuxLabelClient':
xselinux_hooks.c:(.text+0x14d0): undefined reference to `getpeercon_raw'
xselinux_hooks.c:(.text+0x14f4): undefined reference to `avc_context_to_sid_raw'
xselinux_hooks.c:(.text+0x1511): undefined reference to `freecon'
../../Xext/.libs/libXext.a(xselinux_hooks.o): In function `SELinuxFlaskReset':
xselinux_hooks.c:(.text+0x1d09): undefined reference to `avc_netlink_release_fd'
../../Xext/.libs/libXext.a(xselinux_hooks.o): In function `SELinuxWakeupHandler':
xselinux_hooks.c:(.text+0x16b1): undefined reference to `avc_netlink_check_nb'
../../Xext/.libs/libXext.a(xselinux_hooks.o): In function `SELinuxFlaskReset':
xselinux_hooks.c:(.text+0x1d2f): undefined reference to `avc_destroy'
../../Xext/.libs/libXext.a(xselinux_label.o): In function `SELinuxLabelReset':
xselinux_label.c:(.text+0x5c): undefined reference to `selabel_close'
../../Xext/.libs/libXext.a(xselinux_label.o): In function `SELinuxLabelInit':
xselinux_label.c:(.text+0xc2): undefined reference to `selabel_open'
../../Xext/.libs/libXext.a(xselinux_label.o): In function `SELinuxDefaultClientLabel':
xselinux_label.c:(.text+0x10d): undefined reference to `selabel_lookup_raw'
../../Xext/.libs/libXext.a(xselinux_label.o): In function `SELinuxExtensionToSID':
xselinux_label.c:(.text+0x2ed): undefined reference to `selabel_lookup_raw'
xselinux_label.c:(.text+0x2fe): undefined reference to `avc_context_to_sid_raw'
xselinux_label.c:(.text+0x30c): undefined reference to `freecon'
xselinux_label.c:(.text+0x334): undefined reference to `freecon'
../../Xext/.libs/libXext.a(xselinux_label.o): In function `SELinuxEventToSID':
xselinux_label.c:(.text+0x3be): undefined reference to `avc_compute_create'
xselinux_label.c:(.text+0x404): undefined reference to `selabel_lookup_raw'
xselinux_label.c:(.text+0x416): undefined reference to `avc_context_to_sid_raw'
xselinux_label.c:(.text+0x423): undefined reference to `freecon'
xselinux_label.c:(.text+0x4a3): undefined reference to `freecon'
../../Xext/.libs/libXext.a(xselinux_label.o): In function `SELinuxAtomToSID':
xselinux_label.c:(.text+0x5b8): undefined reference to `selabel_lookup_raw'
xselinux_label.c:(.text+0x5d0): undefined reference to `avc_context_to_sid_raw'
xselinux_label.c:(.text+0x5de): undefined reference to `freecon'
xselinux_label.c:(.text+0x623): undefined reference to `selabel_lookup_raw'
xselinux_label.c:(.text+0x641): undefined reference to `freecon'
../../Xext/.libs/libXext.a(xselinux_label.o): In function `SELinuxPropertyToSID':
xselinux_label.c:(.text+0x6e5): undefined reference to `avc_compute_create'
xselinux_label.c:(.text+0x725): undefined reference to `avc_compute_member'
../../Xext/.libs/libXext.a(xselinux_label.o): In function `SELinuxSelectionToSID':
xselinux_label.c:(.text+0x7e3): undefined reference to `avc_compute_member'
collect2: ld returned 1 exit status
make[3]: *** [Xvfb] Error 1
make[3]: Leaving directory `/home/kernel/xserver/xserver/hw/vfb'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/kernel/xserver/xserver/hw/vfb'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/kernel/xserver/xserver/hw'
make: *** [all-recursive] Error 1


Posted here:
http://www.pubbs.net/xorg/201002/61107/

Reported-by: Harald Braumann <harry at unheit.net>

Signed-off-by: Justin P. Mattock <justinmattock at gmail.com>

---
 configure.ac |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index b9c7574..8713673 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1431,7 +1431,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}"
+XSERVER_SYS_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} ${LIBS} ${SELINUX_LIBS}"
 AC_SUBST([XSERVER_LIBS])
 AC_SUBST([XSERVER_SYS_LIBS])
 
-- 
1.6.5.GIT




More information about the xorg mailing list