multiple definitions of tet_thistest and others.
$ meson setup build
The Meson build system
Version: 1.0.1
Source dir: /home/uli/work/xts
Build dir: /home/uli/work/xts/build
Build type: native build
Project name: X Test Suite
Project version: 0.99.1
C compiler for the host machine: cc (gcc 12.2.0 "cc (Debian 12.2.0-14) 12.2.0")
C linker for the host machine: cc ld.bfd 2.40
Host machine cpu family: x86_64
Host machine cpu: x86_64
Compiler for C supports arguments -w: YES
First supported argument: -w
Found pkg-config: /usr/bin/pkg-config (1.8.1)
Run-time dependency x11 found: YES 1.8.4
Run-time dependency xext found: YES 1.3.4
Run-time dependency xi found: YES 1.8
Run-time dependency xtst found: YES 1.2.3
Run-time dependency xau found: YES 1.0.9
Run-time dependency xtrans found: YES 1.4.0
Run-time dependency xmu found: YES 1.1.3
Run-time dependency xaw7 found: YES 1.0.14
Program bdftopcf found: YES (/usr/bin/bdftopcf)
Program mkfontdir found: YES (/usr/bin/mkfontdir)
Program sed found: YES (/usr/bin/sed)
Program perl found: YES (/usr/bin/perl)
Program xset found: YES (/usr/bin/xset)
Program xdpyinfo found: YES (/usr/bin/xdpyinfo)
Program python3 found: YES (/usr/bin/python3)
Program asciidoc found: YES (/usr/bin/asciidoc)
Program xmlto found: YES (/usr/bin/xmlto)
Configuring config.h using configuration
Program sh found: YES (/usr/bin/sh)
Build targets in project: 1124
NOTICE: Future-deprecated features used:
* 0.56.0: {'meson.build_root', 'meson.source_root'}
* 0.60.0: {'install_subdir with empty directory'}
Found ninja-1.11.1 at /usr/bin/ninja
Running 'ninja -C build' compiles a while, then it aborts with these errors:
...
[430/3695] Linking target xts5/Xproto/pAllocColorCells
FAILED: xts5/Xproto/pAllocColorCells
cc -o xts5/Xproto/pAllocColorCells xts5/Xproto/pAllocColorCells.p/meson-generated_pAllocColorCells.m.c.o -Wl,--as-needed -Wl,--no-undefined '-Wl,-rpath,$ORIGIN/../src:$ORIGIN/../../src/tet3/apilib' -Wl,-rpath-link,/home/uli/work/xts/build/xts5/src -Wl,-rpath-link,/home/uli/work/xts/build/src/tet3/apilib -Wl,--start-group xts5/src/libxts5proto.so xts5/src/libxts5.so src/tet3/apilib/libapi_s.so src/tet3/tcm/libtcmmain.a src/tet3/apilib/libapi.a src/tet3/tcm/libtcm.a /usr/lib/x86_64-linux-gnu/libX11.so /usr/lib/x86_64-linux-gnu/libXext.so /usr/lib/x86_64-linux-gnu/libXi.so /usr/lib/x86_64-linux-gnu/libXtst.so /usr/lib/x86_64-linux-gnu/libXau.so -Wl,--end-group
/usr/bin/ld: src/tet3/tcm/libtcmmain.a.p/tcm.c.o:/home/uli/work/xts/build/../src/tet3/tcm/tcm.c:96: multiple definition of `tet_thistest'; xts5/Xproto/pAllocColorCells.p/meson-generated_pAllocColorCells.m.c.o:/home/uli/work/xts/build/xts5/Xproto/pAllocColorCells.p/pAllocColorCells.m.c:183: first defined here
collect2: error: ld returned 1 exit status
[432/3695] Linking target xts5/Xproto/pAllocColor
FAILED: xts5/Xproto/pAllocColor
cc -o xts5/Xproto/pAllocColor xts5/Xproto/pAllocColor.p/meson-generated_pAllocColor.m.c.o -Wl,--as-needed -Wl,--no-undefined '-Wl,-rpath,$ORIGIN/../src:$ORIGIN/../../src/tet3/apilib' -Wl,-rpath-link,/home/uli/work/xts/build/xts5/src -Wl,-rpath-link,/home/uli/work/xts/build/src/tet3/apilib -Wl,--start-group xts5/src/libxts5proto.so xts5/src/libxts5.so src/tet3/apilib/libapi_s.so src/tet3/tcm/libtcmmain.a src/tet3/apilib/libapi.a src/tet3/tcm/libtcm.a /usr/lib/x86_64-linux-gnu/libX11.so /usr/lib/x86_64-linux-gnu/libXext.so /usr/lib/x86_64-linux-gnu/libXi.so /usr/lib/x86_64-linux-gnu/libXtst.so /usr/lib/x86_64-linux-gnu/libXau.so -Wl,--end-group
/usr/bin/ld: src/tet3/tcm/libtcmmain.a.p/tcm.c.o:/home/uli/work/xts/build/../src/tet3/tcm/tcm.c:96: multiple definition of `tet_thistest'; xts5/Xproto/pAllocColor.p/meson-generated_pAllocColor.m.c.o:/home/uli/work/xts/build/xts5/Xproto/pAllocColor.p/pAllocColor.m.c:169: first defined here
collect2: error: ld returned 1 exit status
[435/3695] Linking target xts5/Xproto/pAllocColorPlanes
FAILED: xts5/Xproto/pAllocColorPlanes
cc -o xts5/Xproto/pAllocColorPlanes xts5/Xproto/pAllocColorPlanes.p/meson-generated_pAllocColorPlanes.m.c.o -Wl,--as-needed -Wl,--no-undefined '-Wl,-rpath,$ORIGIN/../src:$ORIGIN/../../src/tet3/apilib' -Wl,-rpath-link,/home/uli/work/xts/build/xts5/src -Wl,-rpath-link,/home/uli/work/xts/build/src/tet3/apilib -Wl,--start-group xts5/src/libxts5proto.so xts5/src/libxts5.so src/tet3/apilib/libapi_s.so src/tet3/tcm/libtcmmain.a src/tet3/apilib/libapi.a src/tet3/tcm/libtcm.a /usr/lib/x86_64-linux-gnu/libX11.so /usr/lib/x86_64-linux-gnu/libXext.so /usr/lib/x86_64-linux-gnu/libXi.so /usr/lib/x86_64-linux-gnu/libXtst.so /usr/lib/x86_64-linux-gnu/libXau.so -Wl,--end-group
/usr/bin/ld: src/tet3/tcm/libtcmmain.a.p/tcm.c.o:/home/uli/work/xts/build/../src/tet3/tcm/tcm.c:96: multiple definition of `tet_thistest'; xts5/Xproto/pAllocColorPlanes.p/meson-generated_pAllocColorPlanes.m.c.o:/home/uli/work/xts/build/xts5/Xproto/pAllocColorPlanes.p/pAllocColorPlanes.m.c:183: first defined here
collect2: error: ld returned 1 exit status
[439/3695] Compiling C object xts5/Xopen/XKeysymToKeycode.p/XKeysymToKeycode_Test1.c.o
ninja: build stopped: subcommand failed.
I tried to fix these by adding "extern" to the "int tet_thistest" lines but the next iteration finds plenty of identical errors in more and more files. And even after fixing all of them I get more "multiple definitions" errors for keysyms_per_keycode
and minkc
and maxkc
and ebuf
and so on. And even after fixing them the final linking fails because it does not find ntests
.
So this is currently unbuildable on Debian 12. I think there's something fundamentally wrong in the build process, maybe some special gcc flag is required?