You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dron@gnu:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux trixie/sid
Release: n/a
Codename: trixie
dron@gnu:~$
CMAKE
dron@gnu:~$ cmake --version
cmake version 3.31.1
CMake suite maintained and supported by Kitware (kitware.com/cmake).
dron@gnu:~$
GCC
dron@gnu:~$ gcc --version
gcc (Debian 14.2.0-7) 14.2.0
Copyright (C) 2024 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.
MUSL
dron@gnu:~$ musl-ldd --version
musl libc (x86_64)
Version 1.2.5
Dynamic Program Loader
Usage: musl-ldd [options] [--] pathname
dron@gnu:~$
Hello, Im make home experiments with building SDL for non glibc libc, for example musl but I have strange errors with building SDL2 and SDL3 under musl-gcc, includes collision? Im very bad understand cmake, maybe it stupid case but Im not found solution and do not understand where main problem. For start experiments I create Makefile
[ 15%] Building C object CMakeFiles/SDL2main.dir/src/main/dummy/SDL_dummy_main.c.o
In file included from /home/dron/SDL2-MUSL/SDL2/build/include/SDL2/SDL_stdinc.h:37,
from /home/dron/SDL2-MUSL/SDL2/build/include/SDL2/SDL_assert.h:25,
from /home/dron/SDL2-MUSL/SDL2/src/main/dummy/../../SDL_internal.h:208,
from /home/dron/SDL2-MUSL/SDL2/src/main/dummy/SDL_dummy_main.c:4:
/usr/include/stdio.h:53:9: error: unknown type name ‘__gnuc_va_list’
53 | typedef __gnuc_va_list va_list;| ^~~~~~~~~~~~~~
/usr/include/stdio.h:53:24: error: conflicting types for ‘va_list’; have ‘int’
53 | typedef __gnuc_va_list va_list;| ^~~~~~~
In file included from /usr/include/x86_64-linux-musl/stdarg.h:10,
from /usr/include/stdio.h:37:
/usr/include/x86_64-linux-musl/bits/alltypes.h:326:27: note: previous declaration of ‘va_list’ with type ‘va_list’ {aka ‘__va_list_tag[1]’}
326 | typedef __builtin_va_list va_list;| ^~~~~~~
/usr/include/stdio.h:373:22: error: unknown type name ‘__gnuc_va_list’
373 | __gnuc_va_list __arg) __nonnull ((1));| ^~~~~~~~~~~~~~
/usr/include/stdio.h:378:54: error: unknown type name ‘__gnuc_va_list’
378 | extern int vprintf (const char *__restrict __format, __gnuc_va_list __arg);| ^~~~~~~~~~~~~~
/usr/include/stdio.h:381:22: error: unknown type name ‘__gnuc_va_list’
381 | __gnuc_va_list __arg) __THROWNL;| ^~~~~~~~~~~~~~
These lines confuse me
In file included from /usr/include/x86_64-linux-musl/stdarg.h:10,
from /usr/include/stdio.h:37:
Im do not understand why used /usr/include/stdio.h instead /usr/include/x86_64-linux-musl/stdio.h Im no find in CMakeList.txt redifinition.
Musl create wrapper under gcc and use spec file for set system -isystem include path.
And in my mind now compiler expect take all libc headers like stdlib.h from musl, not from system because behavior gcc as driver program is redeclarated, because used special spec file
Inside SDL source not contains __gnuc_va_list directly. This is not SDL problem. But maybe cmake or cmake configuration in SDL source tree drop musl spec file configuration?
I'd be glad if someone at least pointed out which way to look, I think I'm stupid, I can't figure out where exactly something is going wrong. At first glance, everything is correct, but :D
Thank for Any ideas 😊
Sorry if it is off-topic, maybe just close it
The text was updated successfully, but these errors were encountered:
With a verbose build, you can see what arguments are passed to $CC:
cmake --build . --config Release --verbose
SDL has system dependencies, for which it might need to do -I/usr/include.
You might need to build some/all dependencies with your musl toolchain, and install in a separate prefix directory.
In general, when targeting another platform or libc, it's best to write a dedicated CMake toolchain file. The one from Emscripten is a good example.
System Information
OS
CMAKE
GCC
MUSL
Hello, Im make home experiments with building
SDL
for nonglibc
libc, for examplemusl
but I have strange errors with buildingSDL2
andSDL3
undermusl-gcc
, includes collision? Im very bad understandcmake
, maybe it stupid case but Im not found solution and do not understand where main problem. For start experiments I createMakefile
Now run this
Main errors here (bottom in log)
These lines confuse me
Im do not understand why used
/usr/include/stdio.h
instead/usr/include/x86_64-linux-musl/stdio.h
Im no find inCMakeList.txt
redifinition.Musl create wrapper under
gcc
and use spec file for set system-isystem
include path.Inside spec file have redifinition for system includes
/usr/lib/x86_64-linux-musl/musl-gcc.specs
And in my mind now compiler expect take all
libc
headers likestdlib.h
frommusl
, not from system because behaviorgcc
as driver program is redeclarated, because used specialspec
fileInside
SDL
source not contains__gnuc_va_list
directly. This is notSDL
problem. But maybecmake
orcmake
configuration inSDL
source tree dropmusl
spec file configuration?I'd be glad if someone at least pointed out which way to look, I think I'm stupid, I can't figure out where exactly something is going wrong. At first glance, everything is correct, but :D
Thank for Any ideas 😊
Sorry if it is off-topic, maybe just close it
The text was updated successfully, but these errors were encountered: