Hello,

I am trying to compile X server as part of Buildroot/BusyBox based custom Linux distribution. The final generated image is unable to load intel video driver (intel_drv.so module). The exact error I am getting is the following:

[ 6.989] (EE) Failed to load /usr/lib/xorg/modules/drivers/intel_drv.so: /usr/lib/xorg/modules/drivers/intel_drv.so: undefined symbol: I810InitMC
[     6.989] (EE) Failed to load module "intel" (loader failed, 0)

I tried compiling both xserver version 1.20.14 and 21.1.2 but no luck and hit the same error twice. I tried two different Intel video drivers with the following commit hashes:

older: 5ca3ac1a90af177eb111a965e9b4dd8a27cc58fc
newer: 31486f40f8e8f8923ca0799aea84b58799754564

The cross compilation library used is Glibc

The make files for both the intel video driver and xserver are attached. Please let me know if I need to provide some more information regarding this.

Any help or tip towards solving the issue would be appreciated. During compilation, xserver has following set of patches (patches can be provided upon request too).

xserver 1.20.14 (patches come from Buildroot upstream)
---------------
0001-modesettings-needs-dri2.patch
0002-include-misc.h-fix-uClibc-build.patch
0003-hw-xwayland-Makefile.am-fix-build-without-glx.patch
0004-hw-xfree86-common-xf86Init.c-fix-build-without-glx.patch
0005-Fix-segfault-on-probing-a-non-PCI-platform-device-on.patch
0006-compiler.h-don-t-define-inb-outb-and-friends-on-mips.patch

xserver 21.1.2 (patches come from Buildroot upstream)
--------------
0001-include-misc.h-fix-uClibc-build.patch
0002-Fix-compilation-error-when-built-without-logind-plat.patch

--
--
Br,
Ahsan
################################################################################
#
# xdriver_xf86-video-intel
#
################################################################################

XDRIVER_XF86_VIDEO_INTEL_VERSION = 5ca3ac1a90af177eb111a965e9b4dd8a27cc58fc
XDRIVER_XF86_VIDEO_INTEL_SITE = 
https://anongit.freedesktop.org/git/xorg/driver/xf86-video-intel.git
XDRIVER_XF86_VIDEO_INTEL_SITE_METHOD = git
XDRIVER_XF86_VIDEO_INTEL_LICENSE = MIT
XDRIVER_XF86_VIDEO_INTEL_LICENSE_FILES = COPYING
XDRIVER_XF86_VIDEO_INTEL_AUTORECONF = YES

# -D_GNU_SOURCE fixes a getline-related compile error in src/sna/kgem.c
# We force -O2 regardless of the optimization level chosen by the user,
# as compiling this package is known to be broken with -Os.
XDRIVER_XF86_VIDEO_INTEL_CONF_ENV = \
        CFLAGS="$(TARGET_CFLAGS) -D_GNU_SOURCE -O2"

XDRIVER_XF86_VIDEO_INTEL_CONF_OPTS = \
        --disable-xvmc \
        --enable-sna \
        --disable-xaa \
        --disable-dga \
        --disable-async-swap

XDRIVER_XF86_VIDEO_INTEL_DEPENDENCIES = \
        libdrm \
        libpciaccess \
        xlib_libXrandr \
        xorgproto \
        xserver_xorg-server

# X.org server support for DRI depends on a Mesa3D DRI driver
ifeq ($(BR2_PACKAGE_MESA3D_DRI_DRIVER),y)
XDRIVER_XF86_VIDEO_INTEL_CONF_OPTS += \
        --enable-dri2 \
        --enable-dri3 \
        --enable-uxa
endif

$(eval $(autotools-package))
################################################################################
#
# xserver_xorg-server
#
################################################################################

XSERVER_XORG_SERVER_VERSION = 1.20.14
XSERVER_XORG_SERVER_SOURCE = xorg-server-$(XSERVER_XORG_SERVER_VERSION).tar.xz
XSERVER_XORG_SERVER_SITE = 
https://xorg.freedesktop.org/archive/individual/xserver
XSERVER_XORG_SERVER_LICENSE = MIT
XSERVER_XORG_SERVER_LICENSE_FILES = COPYING
XSERVER_XORG_SERVER_INSTALL_STAGING = YES
# xfont_font-util is needed only for autoreconf
XSERVER_XORG_SERVER_AUTORECONF = YES
XSERVER_XORG_SERVER_DEPENDENCIES = \
        xfont_font-util \
        xutil_util-macros \
        xlib_libX11 \
        xlib_libXau \
        xlib_libXdmcp \
        xlib_libXext \
        xlib_libXfixes \
        xlib_libXfont2 \
        xlib_libXi \
        xlib_libXrender \
        xlib_libXres \
        xlib_libXft \
        xlib_libXcursor \
        xlib_libXinerama \
        xlib_libXrandr \
        xlib_libXdamage \
        xlib_libXxf86vm \
        xlib_libxkbfile \
        xlib_xtrans \
        xdata_xbitmaps \
        xorgproto \
        xkeyboard-config \
        pixman \
        mcookie \
        host-pkgconf

# We force -O2 regardless of the optimization level chosen by the
# user, as the X.org server is known to trigger some compiler bugs at
# -Os on several architectures.
XSERVER_XORG_SERVER_CONF_OPTS = \
        --disable-config-hal \
        --enable-record \
        --disable-xnest \
        --disable-xephyr \
        --disable-dmx \
        --disable-unit-tests \
        --with-builder-addr=buildr...@buildroot.org \
        CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include/pixman-1 -O2" \
        --with-fontrootdir=/usr/share/fonts/X11/ \
        --$(if $(BR2_PACKAGE_XSERVER_XORG_SERVER_XVFB),en,dis)able-xvfb

ifeq ($(BR2_PACKAGE_SYSTEMD),y)
XSERVER_XORG_SERVER_CONF_OPTS += \
        --with-systemd-daemon \
        --enable-systemd-logind
XSERVER_XORG_SERVER_DEPENDENCIES += \
        systemd
else
XSERVER_XORG_SERVER_CONF_OPTS += \
        --without-systemd-daemon \
        --disable-systemd-logind
endif

# Xwayland support needs libdrm, libepoxy, wayland and libxcomposite
ifeq 
($(BR2_PACKAGE_LIBDRM)$(BR2_PACKAGE_LIBEPOXY)$(BR2_PACKAGE_WAYLAND)$(BR2_PACKAGE_WAYLAND_PROTOCOLS)$(BR2_PACKAGE_XLIB_LIBXCOMPOSITE),yyyyy)
XSERVER_XORG_SERVER_CONF_OPTS += --enable-xwayland
XSERVER_XORG_SERVER_DEPENDENCIES += libdrm libepoxy wayland wayland-protocols 
xlib_libXcomposite
else
XSERVER_XORG_SERVER_CONF_OPTS += --disable-xwayland
endif

ifeq ($(BR2_PACKAGE_XSERVER_XORG_SERVER_MODULAR),y)
XSERVER_XORG_SERVER_CONF_OPTS += --enable-xorg
XSERVER_XORG_SERVER_DEPENDENCIES += libpciaccess
ifeq ($(BR2_PACKAGE_LIBDRM),y)
XSERVER_XORG_SERVER_DEPENDENCIES += libdrm
XSERVER_XORG_SERVER_CONF_OPTS += --enable-libdrm
else
XSERVER_XORG_SERVER_CONF_OPTS += --disable-libdrm
endif
else
XSERVER_XORG_SERVER_CONF_OPTS += --disable-xorg
endif

ifeq ($(BR2_PACKAGE_XSERVER_XORG_SERVER_KDRIVE),y)
XSERVER_XORG_SERVER_CONF_OPTS += \
        --enable-kdrive \
        --disable-glx \
        --disable-dri

else # modular
XSERVER_XORG_SERVER_CONF_OPTS += --disable-kdrive
endif

ifeq ($(BR2_PACKAGE_HAS_LIBGL),y)
XSERVER_XORG_SERVER_CONF_OPTS += --enable-dri --enable-glx
XSERVER_XORG_SERVER_DEPENDENCIES += libgl
else
XSERVER_XORG_SERVER_CONF_OPTS += --disable-dri --disable-glx
endif

# Optional packages
ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
XSERVER_XORG_SERVER_DEPENDENCIES += udev
XSERVER_XORG_SERVER_CONF_OPTS += --enable-config-udev
# udev kms support depends on libdrm and dri2
ifeq ($(BR2_PACKAGE_LIBDRM),y)
XSERVER_XORG_SERVER_CONF_OPTS += --enable-config-udev-kms
else
XSERVER_XORG_SERVER_CONF_OPTS += --disable-config-udev-kms
endif
endif

ifeq ($(BR2_PACKAGE_DBUS),y)
XSERVER_XORG_SERVER_DEPENDENCIES += dbus
XSERVER_XORG_SERVER_CONF_OPTS += --enable-config-dbus
endif

ifeq ($(BR2_PACKAGE_FREETYPE),y)
XSERVER_XORG_SERVER_DEPENDENCIES += freetype
endif

ifeq ($(BR2_PACKAGE_LIBUNWIND),y)
XSERVER_XORG_SERVER_DEPENDENCIES += libunwind
XSERVER_XORG_SERVER_CONF_OPTS += --enable-libunwind
else
XSERVER_XORG_SERVER_CONF_OPTS += --disable-libunwind
endif

ifneq ($(BR2_PACKAGE_XLIB_LIBXVMC),y)
XSERVER_XORG_SERVER_CONF_OPTS += --disable-xvmc
endif

ifeq ($(BR2_PACKAGE_XLIB_LIBXCOMPOSITE),y)
XSERVER_XORG_SERVER_DEPENDENCIES += xlib_libXcomposite
else
XSERVER_XORG_SERVER_CONF_OPTS += --disable-composite
endif

ifeq ($(BR2_PACKAGE_XSERVER_XORG_SERVER_MODULAR),y)
XSERVER_XORG_SERVER_CONF_OPTS += --enable-dri2
ifeq ($(BR2_PACKAGE_XLIB_LIBXSHMFENCE),y)
XSERVER_XORG_SERVER_DEPENDENCIES += xlib_libxshmfence
XSERVER_XORG_SERVER_CONF_OPTS += --enable-dri3
ifeq 
($(BR2_PACKAGE_HAS_LIBEGL)$(BR2_PACKAGE_HAS_LIBGL)$(BR2_PACKAGE_LIBEPOXY),yyy)
XSERVER_XORG_SERVER_DEPENDENCIES += libepoxy
XSERVER_XORG_SERVER_CONF_OPTS += --enable-glamor
else
XSERVER_XORG_SERVER_CONF_OPTS += --disable-glamor
endif
else
XSERVER_XORG_SERVER_CONF_OPTS += --disable-dri3 --disable-glamor
endif
else
XSERVER_XORG_SERVER_CONF_OPTS += --disable-dri2 --disable-dri3 --disable-glamor
endif

ifeq ($(BR2_PACKAGE_XLIB_LIBXSCRNSAVER),y)
XSERVER_XORG_SERVER_DEPENDENCIES += xlib_libXScrnSaver
XSERVER_XORG_SERVER_CONF_OPTS += --enable-screensaver
else
XSERVER_XORG_SERVER_CONF_OPTS += --disable-screensaver
endif

ifneq ($(BR2_PACKAGE_XLIB_LIBDMX),y)
XSERVER_XORG_SERVER_CONF_OPTS += --disable-dmx
endif

ifeq ($(BR2_PACKAGE_OPENSSL),y)
XSERVER_XORG_SERVER_CONF_OPTS += --with-sha1=libcrypto
XSERVER_XORG_SERVER_DEPENDENCIES += openssl
else ifeq ($(BR2_PACKAGE_LIBGCRYPT),y)
XSERVER_XORG_SERVER_CONF_OPTS += --with-sha1=libgcrypt
XSERVER_XORG_SERVER_DEPENDENCIES += libgcrypt
else
XSERVER_XORG_SERVER_CONF_OPTS += --with-sha1=libsha1
XSERVER_XORG_SERVER_DEPENDENCIES += libsha1
endif

define XSERVER_XORG_SERVER_INSTALL_INIT_SYSTEMD
        $(INSTALL) -D -m 0644 package/x11r7/xserver_xorg-server/xorg.service \
                $(TARGET_DIR)/usr/lib/systemd/system/xorg.service
endef

# init script conflicts with S90nodm
ifneq ($(BR2_PACKAGE_NODM),y)
define XSERVER_XORG_SERVER_INSTALL_INIT_SYSV
        $(INSTALL) -D -m 755 package/x11r7/xserver_xorg-server/S40xorg \
                $(TARGET_DIR)/etc/init.d/S40xorg
endef
endif

$(eval $(autotools-package))

Reply via email to