<div dir="ltr">Package: libsdl2-dev<div>Version: 2.28.3+dfsg-2<br clear="all"><div>Justification: sdl2-config can fail to get the proper link flags.</div><div><br></div><div>This used to work with both gcc and clang, but now when using clang, it fails:</div><div><br></div><div>$ CC=clang-16 sdl2-config --static-libs<br>clang: error: unsupported option '-print-multiarch'<br>clang: error: no input files<br>/usr/lib//libSDL2.a -lm -lasound -lm -ldl -lpthread -lpulse-simple -lpulse -pthread -lsamplerate -lX11 -lXext -lXcursor -lXi -lXfixes -lXrandr -lXss -ldrm -lgbm -lwayland-egl -lwayland-client -lwayland-cursor -lxkbcommon -ldecor-0 -lpthread<br></div><div><br></div><div>The reason for this failure is the fact that clang has removed support for the -print-multiarch flag.</div><div>See: <a href="https://github.com/llvm/llvm-project/commit/e05edb19adbfd1b24f58d583e4b5b4d742f982ee">https://github.com/llvm/llvm-project/commit/e05edb19adbfd1b24f58d583e4b5b4d742f982ee</a></div><div><br></div><div>I first tried reporting this with Ubuntu, then with SDL2 upstream, but the source of this bug actually stems from a debian patch.</div><div><br></div><div>See: debian/patches/no-libdir.patch</div><div><br></div><div>The author of the patch states that:</div><div>"a compiler for the host architecture that supports the -print-multiarch argument (which Debian's gcc and clang do)"</div><div><br></div><div>This is no longer true, as clang will not take that flag.</div><div><br></div><div>The SDL2 upstream will not execute the compiler to determine the library dir. This is debian-specific (and inherited by Ubuntu.)</div><div><br></div><div>From my testing, it seems that clang v 16 and above is affected.</div><div><br></div><div>I have produced this bug on:</div><div>Ubuntu 23.04 Lunar Lobster</div><div>Ubuntu 23.10 Mantic Minotaur</div><div><br></div><div><br></div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><br></div></div></div></div></div>