Building with GCC >= 10 results in a lot of "multiple definition" linker errors
With GCC 9, the following ...
CC=gcc-9 ../autogen.sh
make -j$(nproc)
.. builds fine. However, GCC 11 is used by default on my system. So this ...
../autogen.sh
make -j$(nproc)
... results in these errors:
CCLD pChangeActivePointerGrab
/usr/bin/ld: ../../src/tet3/tcm/.libs/libtcmmain.a(tcm.o):/src/tet3/tcm/tcm.c:96: multiple definition of `tet_thistest'; pChangeActivePointerGrab.o:/xts5/Xproto/pChangeActivePointerGrab.c:169: first defined here
CCLD pAllocNamedColor
/usr/bin/ld: ../../src/tet3/tcm/.libs/libtcmmain.a(tcm.o):/src/tet3/tcm/tcm.c:96: multiple definition of `tet_thistest'; pAllocNamedColor.o:/xts5/Xproto/pAllocNamedColor.c:169: first defined here
CCLD pAllocColor
/usr/bin/ld: ../../src/tet3/tcm/.libs/libtcmmain.a(tcm.o):/src/tet3/tcm/tcm.c:96: multiple definition of `tet_thistest'; pAllocColor.o:/xts5/Xproto/pAllocColor.c:169: first defined here
CCLD pAllocColorPlanes
/usr/bin/ld: ../../src/tet3/tcm/.libs/libtcmmain.a(tcm.o):/src/tet3/tcm/tcm.c:96: multiple definition of `tet_thistest'; pAllocColorPlanes.o:/xts5/Xproto/pAllocColorPlanes.c:183: first defined here
CCLD pAllowEvents
/usr/bin/ld: ../../src/tet3/tcm/.libs/libtcmmain.a(tcm.o):/src/tet3/tcm/tcm.c:96: multiple definition of `tet_thistest'; pAllowEvents.o:/xts5/Xproto/pAllowEvents.c:170: first defined here
CCLD pBadRequest
/usr/bin/ld: ../../src/tet3/tcm/.libs/libtcmmain.a(tcm.o):/src/tet3/tcm/tcm.c:96: multiple definition of `tet_thistest'; pBadRequest.o:/xts5/Xproto/pBadRequest.c:143: first defined here
CCLD pBell
/usr/bin/ld: ../../src/tet3/tcm/.libs/libtcmmain.a(tcm.o):/src/tet3/tcm/tcm.c:96: multiple definition of `tet_thistest'; pBell.o:/xts5/Xproto/pBell.c:150: first defined here
CCLD pAllocColorCells
/usr/bin/ld: ../../src/tet3/tcm/.libs/libtcmmain.a(tcm.o):/src/tet3/tcm/tcm.c:96: multiple definition of `tet_thistest'; pAllocColorCells.o:/xts5/Xproto/pAllocColorCells.c:183: first defined here
There are more, still. I've tried to fix some of these in !5 (merged) but I couldn't figure these out.
Edited by Johannes Kauffmann