sdl2-config can fail when using clang over gcc.

Bug #2035422 reported by Bram Stolk
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libsdl2 (Debian)
Fix Released
Unknown
libsdl2 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

The following will fail:

$ CC=clang /usr/bin/sdl2-config --static-libs
clang: error: unsupported option '-print-multiarch'
clang: error: no input files
...

Whereas using gcc as compiler will work correctly:

CC=gcc /usr/bin/sdl2-config --static-libs
/usr/lib/x86_64-linux-gnu/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

This is because clang does not know the flag -print-multiarch

This makes it hard to use sdl2-config to query what flags to use when linking an SDL2 application statically.

OS: I have encountered this issue both in lunar lobster and mantic minotaur.

SDL2 version: 2.28.3+dfsg-2

Expected behaviour: no error, as in gcc case, when using clang.

$ lsb_release -rd
No LSB modules are available.
Description: Ubuntu Mantic Minotaur (development branch)
Release: 23.10

Revision history for this message
Paride Legovini (paride) wrote :

Related:

[1] https://github.com/llvm/llvm-project/commit/e05edb19adbfd1b24f58d583e4b5b4d742f982ee

This looks like a valid issue which I can reproduce locally on my Mantic system, but I am not sure the issue should be fixed in Ubuntu. Given that clang explicitly disabled support for -print-multiarch in [1], I doubt that's the right project to report this issue against.

I suggest reporting the issue against libsdl:

  https://github.com/libsdl-org/SDL/issues

and see what they think about it.

Changed in libsdl2 (Ubuntu):
status: New → Confirmed
Revision history for this message
Bram Stolk (b-stolk) wrote (last edit ):

I reported it as a bug with SDL2, but actually, the bug stems from a Debian patch.
https://github.com/libsdl-org/SDL/issues/8244#issuecomment-1719808138

I then proceeded to file a bug with Debian, which I am unable to do from an Ubuntu machine:

  $ reportbug -B libsdl2-dev
  Ignored bogus setting for -B: libsdl2-dev
  *** ERROR: "Ubuntu" BTS is currently unsupported.

  Please use "ubuntu-bug" (from the apport package) for reporting bugs in Ubuntu.

  You can report bugs to Debian by specifying 'bts debian' in your ~/.reportbugrc
  or by passing the -B debian option on the commandline (see reportbug(1)).

I have tried sending an email bug report to debian instead. I will update w bug nr iif it makes it through the automated system.

Revision history for this message
Bram Stolk (b-stolk) wrote :
Changed in libsdl2 (Debian):
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.