Since libsdl2 was ported to CMake, I've experienced problems with the emerge of libsdl2. It fails to find the size_t type. Older ebuilds (such as libsdl2-2.30.1-r1) still compile correctly.
Portage 3.0.64-4+g7c9bb2cae (python 3.12.3-final-0, default/linux/amd64/17.1, gcc-13, glibc-2.39-r5, 6.3.5-gentoo-x86_64 x86_64) ================================================================= System Settings ================================================================= System uname: Linux-6.3.5-gentoo-x86_64-x86_64-Intel-R-_Pentium-R-_D_CPU_3.20GHz-with-glibc2.39 KiB Mem: 3293464 total, 315904 free KiB Swap: 2714972 total, 2188492 free Timestamp of repository gentoo: Thu, 09 May 2024 05:33:54 +0000 Head commit of repository gentoo: b22924fd3c9c6bd2256d41922da71b82cef2fd62 sh bash 5.2_p26-r3 ld GNU ld (Gentoo 2.42 p3) 2.42.0 distcc 3.4 x86_64-pc-linux-gnu [disabled] app-misc/pax-utils: 1.3.7::gentoo app-shells/bash: 5.2_p26-r3::gentoo dev-build/autoconf: 2.72-r1::gentoo dev-build/automake: 1.16.5-r2::gentoo dev-build/cmake: 3.29.2::gentoo dev-build/libtool: 2.4.7-r4::gentoo dev-build/make: 4.4.1-r1::gentoo dev-build/meson: 1.4.0-r1::gentoo dev-java/java-config: 2.3.3-r1::gentoo dev-lang/perl: 5.38.2-r3::gentoo dev-lang/python: 3.11.9::gentoo, 3.12.3::gentoo, 3.13.0_beta1::gentoo dev-lang/rust-bin: 1.77.1::gentoo sys-apps/baselayout: 2.15::gentoo sys-apps/openrc: 0.54::gentoo sys-apps/sandbox: 2.38::gentoo sys-devel/binutils: 2.42-r1::gentoo sys-devel/binutils-config: 5.5::gentoo sys-devel/clang: 18.1.5::gentoo sys-devel/gcc: 13.2.1_p20240503::gentoo sys-devel/gcc-config: 2.11::gentoo sys-devel/llvm: 17.0.6::gentoo, 18.1.5::gentoo sys-kernel/linux-headers: 6.8-r1::gentoo (virtual/os-headers) sys-libs/glibc: 2.39-r5::gentoo Repositories: gentoo location: /var/db/repos/gentoo sync-type: git sync-uri: https://github.com/gentoo-mirror/gentoo.git priority: -1000 volatile: False localrepo location: /var/db/repos/localrepo masters: gentoo volatile: False Installed sets: @system ACCEPT_KEYWORDS="amd64 ~amd64 ~x86" ACCEPT_LICENSE="*" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=native -Os -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c" CXXFLAGS="-march=native -Os -pipe" DISTDIR="/usr/portage/distfiles" EMERGE_DEFAULT_OPTS="--jobs=2 --load-average=1.8 --autounmask=y" ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live clean-logs collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news parallel-fetch parallel-install pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://www.gtlib.gatech.edu/pub/gentoo http://mirrors.rit.edu/gentoo/ http://gentoo.osuosl.org/" LANG="en_US.UTF8" LC_ALL="en_US.UTF8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" LEX="flex" LINGUAS="en_US" MAKEOPTS="-j2" PKGDIR="/var/cache/binpkgs" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git" PORTAGE_TMPDIR="/dev/shm" SHELL="/bin/bash" USE="X acl acpi alsa amd64 apache2 bash-completion bzip2 cgi cli crypt cupsddk curl dahdi dbus dri dv dvd elogind encode faac ffmpeg fortran freetds gdbm iconv ipv6 jpeg kdenlive kolab lame latex latex3 libinput libtirpc lzma mp3 mpeg mysql mysqli ncurses ogg opengl openmp pam pcre pgsql plasma png postproc pulseaudio readline seccomp split-usr ssl taglib test-rust theora threads truetype unicode usb vhosts vim-syntax xattr xv zlib" ABI_X86="32 64" ADA_TARGET="gcc_12" APACHE2_MODULES="actions alias auth_basic auth_digest authn_alias authn_core authn_anon authn_dbm authn_default authn_file authz_dbm authz_core authz_default cgi cgid authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias proxy_http proxy_connect proxy version dbd unixd socache_shmcb" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 sse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 ntrip navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-3" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11 python3_12" RUBY_TARGETS="ruby26" SANE_BACKENDS="pixma net epson epson2 snapscan" VIDEO_CARDS="intel vesa" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account" Unset: ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LD, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS ================================================================= Package Settings ================================================================= media-libs/libsdl2-2.28.5::gentoo was built with the following: USE="X alsa dbus haptic joystick opengl pulseaudio sound threads video (-aqua) (-custom-cflags) -doc -fcitx4 -gles1 -gles2 -ibus -jack -kms -libsamplerate -nas -oss -pipewire -sndio -static-libs -test -udev -vulkan -wayland -xscreensaver" ABI_X86="32 (64) (-x32)" CPU_FLAGS_X86="mmx sse sse2 -3dnow" VIDEO_CARDS="(-vc4)" FEATURES="binpkg-logs qa-unresolved-soname-deps userfetch sandbox xattr unmerge-orphans unknown-features-warn parallel-install usersync pid-sandbox parallel-fetch collision-protect fixlafiles buildpkg-live binpkg-dostrip ebuild-locks unmerge-logs merge-sync splitdebug multilib-strict config-protect-if-modified userpriv assume-digests news binpkg-docompress network-sandbox sfperms protect-owned preserve-libs usersandbox clean-logs distlocks strict ipc-sandbox"
Created attachment 892622 [details] Build Log
This doesn't make sense at a glance, merely including stdio.h is failing despite it's including stddef.h for size_t before bits/types/struct_FILE.h? Needless to say, I can't reproduce with exact same USE. It would likely have something to do with the cmake migration, but I have no idea.
(my best guess would be that there's some conflicting define being set that throws off glibc/gcc's includes -- not that I know what might've triggered this)
Not tried to look at this at all yet but if we run out of ideas, it is the kind of shenanigan we had with fixincludes in the past, I think. But I doubt it's that.
Could you tar+compress the /dev/shm/portage/media-libs/libsdl2-2.30.3/work/SDL2-2.30.3_build-abi_x86_32.x86 directory and attach it here? The generated includes may or may not have some hints.
So I extracted the compile command that was failing and tried it with and without different compile options. I was able to narrow down the problem to this compile flag: -isystem/usr/include Not sure what in the build system is introducing that, but removing it solves the issue.
My own log has that option as well but it's not causing issues on this end.
it is something that SDL is doing in CMakeLists.txt and wasn't in with autoconf though: if(USE_GCC OR USE_CLANG) string(REGEX REPLACE "(^| )-I" "\\1 -isystem" EXTRA_CFLAGS "${EXTRA_CFLAGS}") endif() Unsure why.
So I tried commenting those three lines out in the CMakelists.txt file (lines 3060 to 3062): #if(USE_GCC OR USE_CLANG) # string(REGEX REPLACE "(^| )-I" "\\1 -isystem" EXTRA_CFLAGS "${EXTRA_CFLAGS}") #endif() And ninja now runs to completion without error.
Created attachment 892645 [details, diff] Delete CMake Regex So I applied this patch that deletes those three lines -- and I can run ebuild compile successfully. This is probably not the -right- solution. But it does seem to fix my issue for now.
Created attachment 892646 [details] SDL2-2.30.3_build-abi_x86_32.x86 folder from the broken build As requested, here's a tarball of the work/SDL2-2.30.3_build-abi_x86_32.x86 folder.
(In reply to Robert Marmorstein from comment #12) > Created attachment 892646 [details] > SDL2-2.30.3_build-abi_x86_32.x86 folder from the broken build Looks normal at a glance, and unfortunately still no idea why -isystem is making a difference.
Looking at the manpages and some online comments, it looks like the use of -isystem is to prevent some potential warning messages. So perhaps just deleting these three lines is the right patch after all?
-isystem can cause all sorts of problems, e.g. https://gcc.gnu.org/PR70129. We should propose removing it upstream. It doesn't even work reliably for avoiding warnings. *still* quite curious as to why it only affects you though
I'm not sure what could make mine different (other than age -- it's been running Gentoo on it for nearly 20 years now -- since at least 2006 and probably a bit longer). I use a pretty standard toolchain, all my packages are up-to-date, I don't use any overlays (anymore), and I'm using OpenRC instead of SystemD. Maybe it's my CFLAGS? CHOST="x86_64-pc-linux-gnu" CFLAGS="-march=native -Os -pipe"
Or my feature flags? FEATURES="sandbox collision-protect distlocks multilib-strict news clean-logs -noinfo -noman -nostrip splitdebug parallel-fetch parallel-install userfetch userpriv usersync -ccache fixlafiles" CPU_FLAGS_X86="mmx mmxext sse sse2 sse3"
(Also, just to be clear, it's not a suggestion you're doing anything wrong; just very curious as to what makes your system different.)
(In reply to Robert Marmorstein from comment #16) > I'm not sure what could make mine different (other than age -- it's been > running Gentoo on it for nearly 20 years now -- since at least 2006 and > probably a bit longer). This might be it, then (in a kind of generic way). Sometimes we get strange bug reports from people on quite old installs (even if it's been migrated to a newer machine, ofc) because there's some old orphaned file somewhere. If you have the time and inclination, it might be interesting to see a list of orphaned files on your system in /usr, e.g. `find /usr | xargs qfile -o` (unfortunately qfile doesn't support recursion). Also wondering if there's any junk in /usr/local?
Well, that shares lots of old kernel config files, a few things from Qt3, a lot of orphaned man pages, two games that probably should have installed under /usr/local, some old awstats stuff . . . let me narrow this down a bit and I'll share. /usr/local has an old copy of FICS (Free Internet Chess Server) I used to run, a custom version of kdenlive from a bugfix I wrote many years ago, and some ruby/sass stuff. /usr/local/lib is empty except for the ruby gems. And /usr/local/lib64 is empty except for some libraries I wrote for my dissertation. I don't think any of that would interfere with libsdl2, but I can clean it out and see.
I can confirm this bug. 2.30.7-r1 fails to compile on my system as well. It's also an old Gentoo system. I can attach the build.log. The first error is /usr/include/bits/types/cookie_io_functions_t.h:28:43: error: unknown type name ‘size_t’
I can confirm this bug too. My install, however, is only about 2 years old. I only use; FEATURES="ccache parallel-fetch parallel-install" USE for libsdl2: media-libs/libsdl2 X gles2 haptic opengl vulkan Global USE: USE="dbus dri pipewire kf6compat pulseaudio qt6 screencast semantic-desktop systemd timidity wayland -bluetooth -elogind -fluidsynth -foomatic -fprintd -geoip -geolocation -gnome -grub -gles2-only -handbook -hunspell -ieee1394 -intel -jack -kaccounts -kwallet -rdoc -sddm -sdk -selinux -spell -telemetry -thunderbolt -vala -wifi -X"
Please share fresh logs and also inspect your /usr/local (it should really be empty except for the layout dirs).
Created attachment 917914 [details] Build log from a 2 year old system.
Also, except for a niceness script that I use with portage, there is nothing in my /usr/local.
(In reply to krpisjar from comment #24) > Created attachment 917914 [details] > Build log from a 2 year old system. Can you give me fresh logs with distcc+ccache off?
and emerge --info
Created attachment 917921 [details] emerge --info (was too large to paste, 18k chars)
Created attachment 917922 [details] Build log w/o ccache There is distcc mentioned, but I don't use it (it's "-distcc" after all). Logs provided.