Skip to content

Build is linking against X11 even with NO_X11=1 #14336

@HWXLR8

Description

@HWXLR8

MAME version

3b86b1a

System information

Raspberry Pi 5 8GB running Gentoo
Linux 6.12.44-v8+ #1902 SMP PREEMPT Fri Aug 29 15:19:33 BST 2025 aarch64 GNU/Linux

INI configuration details

Emulated system/software

No response

Incorrect behaviour

Using the following build parameters:

make \
     OSD=sdl \
     USE_WAYLAND=1 \
     NO_X11=1 \
     USE_XINPUT=0 \
     USE_TAPTUN=0 \
     USE_PCAP=0 \
     NO_USE_PULSEAUDIO=1 \
     NO_USE_PORTAUDIO=1 \
     USE_QTDEBUG=0 \
     REGENIE=1

Linking fails while looking for references to XPending, even though NO_X11=1 is used:

Linking mame...
/usr/lib/gcc/aarch64-unknown-linux-gnu/14/../../../../aarch64-unknown-linux-gnu/bin/ld: ../../../../../scripts/src/osd/mame_mame/libosd_sdl.a(input_x11.o): undefined reference to symbol 'XPending'
/usr/lib/gcc/aarch64-unknown-linux-gnu/14/../../../../aarch64-unknown-linux-gnu/bin/ld: /usr/lib64/libX11.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[2]: *** [mame.make:272: ../../../../../mame] Error 1
make[1]: *** [Makefile:109: mame] Error 2
make: *** [makefile:1250: linux] Error 2

Expected behaviour

Mame should link successfully.

Steps to reproduce

No response

Additional details

I have even tried building libsdl2 with X11 support enabled (which I shouldn't have to), and it made no difference.

# equery u libsdl2
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for media-libs/libsdl2-2.32.8:
 U I
 + + X             : Add support for X11
 + + alsa          : Add support for media-libs/alsa-lib (Advanced Linux Sound Architecture)
 - - dbus          : Enable dbus support for anything that needs it (gpsd, gnomemeeting, etc)
 - - doc           : Add extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally
 - - fcitx         : Enable support for app-i18n/fcitx
 - - gles1         : include OpenGL ES 1.0 support
 + + gles2         : Enable GLES 2.0 (OpenGL for Embedded Systems) support (independently of full OpenGL, see also: gles2-only)
 + + haptic        : Enable the haptic (force feedback) subsystem
 - - ibus          : Enable support for app-i18n/ibus
 - - jack          : Add support for the JACK Audio Connection Kit
 + + joystick      : Control joystick support (disable at your own risk)
 + + kms           : Build the KMSDRM video driver
 + + libsamplerate : Build with support for converting sample rates using libsamplerate
 - - nas           : Add support for network audio sound
 + + opengl        : Add support for OpenGL (3D graphics)
 - - oss           : Add support for OSS (Open Sound System)
 - - pipewire      : Enable support for the media-video/pipewire audio backend
 - - pulseaudio    : Add sound server support via media-libs/libpulse (may be PulseAudio or PipeWire)
 - - sndio         : Enable support for the media-sound/sndio backend
 + + sound         : Control audio support (disable at your own risk)
 - - static-libs   : Build static versions of dynamic libraries as well
 - - test          : Enable dependencies and/or preparations necessary to run tests (usually controlled by FEATURES=test but can be toggled
                     independently)
 + + udev          : Enable virtual/udev integration (device discovery, power and storage device support, etc)
 + + video         : Control video support (disable at your own risk)
 + + vulkan        : Add support for 3D graphics and computing via the Vulkan cross-platform API
 + + wayland       : Enable dev-libs/wayland backend
 - - xscreensaver  : Add support for XScreenSaver extension

If I am doing anything wrong, please let me know, but I do not believe this behavior is correct. Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions