Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GNU/Linux build failure with '--disable-x11' configure option: undefined reference to symbol 'XSetErrorHandler' #3602

Closed
2 tasks done
Leo3418 opened this issue Jul 1, 2022 · 2 comments
Labels

Comments

@Leo3418
Copy link

Leo3418 commented Jul 1, 2022

Describe the bug

Builds with --disable-x11 configure option fail with compiler error.

Steps to reproduce the behaviour

Run these commands in the repository working tree's root directory:

  1. git clean -fdx
  2. ./autogen.sh
  3. ./configure --enable-core-inline --enable-sdl2 --disable-x11
  4. make -j "$(nproc)"

Expected behavior

The build succeeds.

What operating system(s) this bug have occurred on?

Gentoo Linux, Linux 5.18.8, x86_64

What version(s) of DOSBox-X have this bug?

Versions since commit 591f6c3

Used configuration

Build failure, runtime configuration file is irrelevant

Output log

g++  -g -std=gnu++14  -O2 -msse  -Wall   -Wextra   -Wunused   -pedantic   -Wlogical-op   -Wsign-promo   -Wconversion-null   -Wno-deprecated-declarations   -Wno-implicit-fallthrough   -Wno-strict-aliasing   -Wno-missing-field-initializers   -Wno-format-zero-length   -Wno-address-of-packed-member   -Wno-int-to-void-pointer-cast  -I/tmp/dosbox-x -I/tmp/dosbox-x/vs/sdlnet/linux-host/include -I/tmp/dosbox-x/vs/sdlnet/linux-host/include/SDL -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L   -L/tmp/dosbox-x/vs/sdlnet/linux-host/lib -o dosbox-x dosbox.o  debug/libdebug.a dos/libdos.a shell/libshell.a builtin/libbuiltin.a ints/libints.a hardware/serialport/libserial.a hardware/parport/libparallel.a libs/porttalk/libporttalk.a gui/libgui.a libs/gui_tk/libgui_tk.a hardware/libhardware.a cpu/libcpu.a hardware/reSID/libresid.a fpu/libfpu.a gui/libgui.a misc/libmisc.a output/liboutput.a hardware/mame/libmame.a libs/zmbv/libzmbv.a libs/decoders/internal/libopusint.a aviwriter/libaviwriter.a  libs/xBRZ/libxbrz.a libs/mt32/libmt32.a libs/fluidsynth/libfluidsynth.a -lasound -lm -ldl -lpthread -L/usr/lib64 -lSDL2 -ltinfo -lfreetype  -lSDL2_net -lz -lpng -lz -lpcap -lslirp -lglib-2.0  -lfluidsynth -lavcodec -lavformat -lavutil -lswscale -lavcodec  -lGL
/usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: gui/libgui.a(sdlmain_linux.o): undefined reference to symbol 'XSetErrorHandler'
/usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-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[3]: *** [Makefile:470: dosbox-x] Error 1
make[3]: Leaving directory '/tmp/dosbox-x/src'
make[2]: *** [Makefile:530: all-recursive] Error 1
make[2]: Leaving directory '/tmp/dosbox-x/src'
make[1]: *** [Makefile:399: all-recursive] Error 1
make[1]: Leaving directory '/tmp/dosbox-x'
make: *** [Makefile:332: all] Error 2

Additional information

$ uname -a
Linux nvme-fussy 5.18.8 #1 SMP PREEMPT_DYNAMIC Wed Jun 29 18:49:58 PDT 2022 x86_64 AMD Ryzen 7 4700U with Radeon Graphics AuthenticAMD GNU/Linux
$ cat /etc/os-release 
NAME=Gentoo
ID=gentoo
PRETTY_NAME="Gentoo Linux"
ANSI_COLOR="1;35"
HOME_URL="https://www.gentoo.org/"
SUPPORT_URL="https://www.gentoo.org/support/"
BUG_REPORT_URL="https://bugs.gentoo.org/"
VERSION_ID="2.8"
$ gcc --version
gcc (Gentoo 11.3.0 p4) 11.3.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ ld --version
GNU ld (Gentoo 2.37_p1 p2) 2.37
Copyright (C) 2021 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.
$ emerge --info media-libs/libsdl2 x11-libs/libX11
...
=================================================================
                        Package Settings
=================================================================

media-libs/libsdl2-2.0.20-r1::gentoo was built with the following:
USE="X alsa dbus gles2 joystick opengl pulseaudio sound threads udev video wayland (-aqua) (-custom-cflags) -doc -fcitx4 -gles1 -haptic -ibus -jack -kms -libsamplerate -nas -oss -pipewire -sndio -static-libs -vulkan -xinerama -xscreensaver" ABI_X86="(64) -32 (-x32)" CPU_FLAGS_X86="mmx sse sse2 -3dnow" VIDEO_CARDS="(-vc4)"


x11-libs/libX11-1.7.5::gentoo was built with the following:
USE="ipv6 -doc -test" ABI_X86="(64) -32 (-x32)"
FEATURES="preserve-libs userfetch assume-digests usersandbox network-sandbox merge-sync news parallel-fetch binpkg-logs binpkg-docompress ipc-sandbox pid-sandbox sfperms qa-unresolved-soname-deps unmerge-logs userpriv distlocks multilib-strict fixlafiles unmerge-orphans unknown-features-warn protect-owned binpkg-dostrip config-protect-if-modified sandbox strict xattr buildpkg-live ebuild-locks usersync"

Have you checked that no similar bug report(s) exist?

  • I have searched and didn't find any similar bug report.

Code of Conduct & Contributing Guidelines

  • I agree to follow the code of conduct and the contributing guidelines.
@Leo3418 Leo3418 added the bug label Jul 1, 2022
@grapeli
Copy link

grapeli commented Jul 1, 2022

The easiest workaround is to undo these two commits.
749f8d8
591f6c3
Unfortunately, they don't cover a situation where someone is building dosbox-x without x11. Intended to run under fbcon, kmsdrm, directfb, wayland (without Xwayland).

@Leo3418
Copy link
Author

Leo3418 commented Jul 2, 2022

Fixed in 07e51e0, thanks Wengier. Though I'd include a reference to this issue in the commit message so it can be automatically closed :)

@Leo3418 Leo3418 closed this as completed Jul 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants