Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 931642 - media-libs/libsdl2-2.30.2-r1 and newer fail to compile
Summary: media-libs/libsdl2-2.30.2-r1 and newer fail to compile
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2024-05-09 17:15 UTC by Robert Marmorstein
Modified: 2024-05-16 18:55 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Build Log (build.log,459.22 KB, text/x-log)
2024-05-09 17:16 UTC, Robert Marmorstein
Details
Delete CMake Regex (libsdl2-2.30.3.CMakeLists.patch,432 bytes, patch)
2024-05-09 22:55 UTC, Robert Marmorstein
Details | Diff
SDL2-2.30.3_build-abi_x86_32.x86 folder from the broken build (libsdl2-build.tar.gz,482.34 KB, application/gzip)
2024-05-09 23:13 UTC, Robert Marmorstein
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Marmorstein 2024-05-09 17:15:54 UTC
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.
Comment 1 Robert Marmorstein 2024-05-09 17:16:05 UTC
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"
Comment 2 Robert Marmorstein 2024-05-09 17:16:38 UTC
Created attachment 892622 [details]
Build Log
Comment 3 Ionen Wolkens gentoo-dev 2024-05-09 19:43:10 UTC
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.
Comment 4 Ionen Wolkens gentoo-dev 2024-05-09 19:51:11 UTC
(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)
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-09 19:52:04 UTC
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.
Comment 6 Ionen Wolkens gentoo-dev 2024-05-09 20:13:33 UTC
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.
Comment 7 Robert Marmorstein 2024-05-09 20:18:24 UTC
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.
Comment 8 Ionen Wolkens gentoo-dev 2024-05-09 20:21:08 UTC
My own log has that option as well but it's not causing issues on this end.
Comment 9 Ionen Wolkens gentoo-dev 2024-05-09 20:23:36 UTC
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.
Comment 10 Robert Marmorstein 2024-05-09 20:52:21 UTC
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.
Comment 11 Robert Marmorstein 2024-05-09 22:55:16 UTC
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.
Comment 12 Robert Marmorstein 2024-05-09 23:13:34 UTC
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.
Comment 13 Ionen Wolkens gentoo-dev 2024-05-10 12:57:31 UTC
(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.
Comment 14 Robert Marmorstein 2024-05-10 15:46:57 UTC
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?
Comment 15 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-11 00:31:26 UTC
-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
Comment 16 Robert Marmorstein 2024-05-11 01:26:32 UTC
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"
Comment 17 Robert Marmorstein 2024-05-11 01:27:13 UTC
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"
Comment 18 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-11 01:27:42 UTC
(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.)
Comment 19 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-05-11 01:29:18 UTC
(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?
Comment 20 Robert Marmorstein 2024-05-16 18:55:47 UTC
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.