Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 890744 - media-libs/libsdl2-2.26.2[wayland] - static patch breaks slibtool + Clang
Summary: media-libs/libsdl2-2.26.2[wayland] - static patch breaks slibtool + Clang
Status: RESOLVED FIXED
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, PullRequest
Depends on:
Blocks: slibtool
  Show dependency tree
 
Reported: 2023-01-13 20:45 UTC by Carlos
Modified: 2023-01-20 01:23 UTC (History)
2 users (show)

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


Attachments
build.log (build.log,554.00 KB, text/x-log)
2023-01-13 20:52 UTC, Carlos
Details
Revised libsdl2-2.0.16-static-libs.patch (libsdl2-2.0.16-static-libs.patch,2.07 KB, patch)
2023-01-13 20:52 UTC, Carlos
Details | Diff
generated makefile (file_890744.txt,89.04 KB, text/plain)
2023-01-15 16:34 UTC, Carlos
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos 2023-01-13 20:45:51 UTC
The static patch for libsdl2 mixes C source and object files into the C compiler's command line during linking. Slibtool doesn't seem to filter them out from the command line like libtool, causing failure of the final linking step.

Reproducible: Always

Steps to Reproduce:
1. Use https://wiki.gentoo.org/wiki/Slibtool
2. emerge media-libs/libsdl2
Actual Results:  
Slibtool is tricked into inserting header files into the C compiler's command line, resulting in

> clang-15: error: cannot specify -o when generating multiple output files

I haven't reproduced this with GCC, but I expect the equivalent "fatal error: cannot specify ‘-o’ with ‘-c’, ‘-S’ or ‘-E’ with multiple files" message would be given.


Expected Results:  
Slibtool should have only object files in its command line.

Portage 3.0.43 (python 3.10.9-final-0, default/linux/amd64/17.0/musl, gcc-15.0.6, musl-1.2.3-r5, 6.0.12-xanmod1 x86_64)
=================================================================
System uname: Linux-6.0.12-xanmod1-x86_64-Intel-R-_Core-TM-_i7-8565U_CPU_@_1.80GHz-with-libc
KiB Mem:     7978960 total,   2029844 free
KiB Swap:    4194300 total,   3955708 free
Head commit of repository gentoo: 6a6fa3740348c14c20902f5d0876daa8d578b5ca

Head commit of repository 12101111-overlay: 803c1b1e6ec2cf965c9c72fe8abcebf57fa2cd27

Head commit of repository clang-musl: 0f218a5f31db973f742a201519b9b4dfc3be4edc

Timestamp of repository dm9pZCAq: Tue, 10 Jan 2023 17:48:01 +0000
Head commit of repository dm9pZCAq: 570de4048deb01f329a9c7fd17902f32a08a499d

Timestamp of repository gentoobr: Tue, 10 Jan 2023 17:48:03 +0000
Head commit of repository gentoobr: c3dbc3a34afb0ffd2f18e3eb848d0c7612175360

Timestamp of repository guru: Thu, 12 Jan 2023 13:02:00 +0000
Head commit of repository guru: 1510f2a58b8582932f413abf8c130d8888581583

Head commit of repository tlp: 4ba9fce0927a4bc87a4df54eb352a163a439810e

Head commit of repository yago: e2a72973659ba7c12f8f098be5c2e294e18595b8

sh dash 0.5.12
ld LLD 15.0.6 (compatible with GNU linkers)
app-misc/pax-utils:       1.3.6-r1::gentoo
app-shells/bash:          5.2_p15-r1::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.36.0-r1::gentoo
dev-lang/python:          3.10.9::gentoo
dev-lang/rust:            1.66.0::clang-musl
dev-util/cmake:           3.25.1::gentoo
dev-util/meson:           1.0.0::gentoo
sys-apps/baselayout:      2.9::gentoo
sys-apps/sandbox:         2.30-r1::gentoo
sys-devel/autoconf:       2.13-r7::gentoo, 2.71-r5::gentoo
sys-devel/automake:       1.16.5::gentoo
sys-devel/clang:          14.0.6-r1::gentoo, 15.0.6-r1::gentoo
sys-devel/libtool:        2.4.7-r1::gentoo
sys-devel/lld:            14.0.6-r1::gentoo, 15.0.6::gentoo
sys-devel/llvm:           14.0.6-r2::gentoo, 15.0.6::clang-musl
sys-devel/make:           4.4::gentoo
sys-kernel/linux-headers: 6.1::gentoo (virtual/os-headers)
sys-libs/musl:            1.2.3-r5::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://github.com/gentoo/gentoo.git
    priority: -1000
    volatile: True

12101111-overlay
    location: /var/db/repos/12101111-overlay
    sync-type: git
    sync-uri: https://github.com/12101111/overlay/
    masters: gentoo
    volatile: True

clang-musl
    location: /var/db/repos/clang-musl
    sync-type: git
    sync-uri: https://github.com/clang-musl-overlay/clang-musl-overlay
    masters: gentoo
    volatile: True

crossdev
    location: /var/db/repos/crossdev
    masters: gentoo
    volatile: True

dm9pZCAq
    location: /var/db/repos/dm9pZCAq
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/dm9pZCAq.git
    masters: gentoo
    volatile: True

gentoobr
    location: /var/db/repos/gentoobr
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoobr.git
    masters: gentoo
    volatile: True

guru
    location: /var/db/repos/guru
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/guru.git
    masters: gentoo
    volatile: True

tlp
    location: /var/db/repos/tlp
    sync-type: git
    sync-uri: https://github.com/dywisor/tlp-portage
    masters: gentoo
    volatile: True

yago
    location: /var/db/repos/yago
    sync-type: git
    sync-uri: file://home/carlos/Build/yago
    masters: gentoo
    volatile: True

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
AR="llvm-ar"
CBUILD="x86_64-gentoo-linux-musl"
CC="clang"
CFLAGS="-march=skylake -mtune=skylake -O3 -pipe -flto=thin -mllvm -polly -fPIC -fstack-protector-strong -D_FORTIFY_SOURCE=2"
CHOST="x86_64-gentoo-linux-musl"
CONFIG_PROTECT="/etc /usr/lib/libreoffice/program/sofficerc /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"
CPP="x86_64-gentoo-linux-musl-clang-cpp"
CXX="clang++"
CXXFLAGS="-march=skylake -mtune=skylake -O3 -pipe -flto=thin -mllvm -polly -fPIC -fstack-protector-strong -D_FORTIFY_SOURCE=2"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--keep-going=y --quiet=y --buildpkg --buildpkg-exclude='virtual/* sys-kernel/*-sources */*-bin'"
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="-march=skylake -mtune=skylake -O3 -pipe -flto=thin"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=skylake -mtune=skylake -O3 -pipe -flto=thin"
GENTOO_MIRRORS="https://gentoo.c3sl.ufpr.br/"
INSTALL_MASK="charset.alias /usr/share/locale/locale.alias"
LANG="pt_BR.UTF-8"
LDFLAGS="-Wl,--as-needed -Wl,-z,relro,-z,now"
LEX="flex"
LIBTOOL="rlibtool"
MAKE="make LIBTOOL=rlibtool"
MAKEFLAGS="LIBTOOL=rlibtool"
MAKEOPTS="-j6 -l6"
PKGDIR="/var/cache/binpkgs"
PORTAGE_COMPRESS="zstd"
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="/var/run/"
RUSTFLAGS="-Ctarget-cpu=skylake -Copt-level=3 -Cllvm-args=-polly -Clinker=clang -Clinker-plugin-lto=yes -Clink-arg=-flto=thin -Clink-arg=-Wl,--as-needed"
SHELL="/bin/bash"
USE="X acl alsa amd64 apng bash-completion basu bluetooth bzip2 cairo clang cli compiler-rt crypt cups dbus default-compiler-rt default-libcxx default-lld dri drm egl ffmpeg fontconfig fortran gif gles2 gme harfbuzz heif hwaccel iconv icu ipv6 jpeg jpeg2k libcxx libcxxabi libglvnd libsamplerate libtirpc lld llvm-libunwind lto lz4 lzma lzo mp3 ncurses nls nptl opengl openmp openssl opus pam pango pcre perl png pt pulseaudio python readline screencast seccomp split-usr ssl test-rust theora threads tiff tk truetype unicode v4l vaapi vorbis vpx vulkan wayland webp x264 x265 x86_64 xattr zlib zstd" ABI_X86="64" ADA_TARGET="gnat_2021" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid 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" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="musl" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="wacom" KERNEL="linux" L10N="pt pt-BR" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="AMDGPU BPF NVPTX X86 AArch64 ARM AVR Hexagon Lanai MSP430 Mips PowerPC RISCV Sparc SystemZ VE WebAssembly XCore" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10" QEMU_SOFTMMU_TARGETS="x86_64 i386 aarch64 aarch64_be arm riscv32 riscv64" QEMU_USER_TARGETS="aarch64 aarch64_be arm riscv32 riscv64" RUBY_TARGETS="ruby27" SANE_BACKENDS="epson epson2" USERLAND="GNU" VIDEO_CARDS="intel i965 amdgpu radeonsi" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, ARFLAGS, AS, ASFLAGS, CCLD, CONFIG_SHELL, CPPFLAGS, CTARGET, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, LC_ALL, LD, LFLAGS, LINGUAS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 1 Carlos 2023-01-13 20:52:15 UTC
Created attachment 848398 [details]
build.log
Comment 2 Carlos 2023-01-13 20:52:24 UTC
Created attachment 848400 [details, diff]
Revised libsdl2-2.0.16-static-libs.patch

Revised libsdl2-2.0.16-static-libs.patch which works with slibtool.

Signed-off-by: Carlos Eduardo <carana2099@gmail.com>
Comment 3 orbea 2023-01-15 14:06:03 UTC
I cant reproduce this with media-libs/libsdl2-2.26.2, sys-devel/clang-15.0.6-r1 and sys-libs/musl-1.2.3.

In SDL's generated Makefile what value does GEN_HEADERS get set to? Here it ends up as an empty variable which may be why it works for me.
Comment 4 Carlos 2023-01-15 16:34:21 UTC
Created attachment 848595 [details]
generated makefile

Here's the generated Makefile.

GEN_HEADERS seems to be bunch of Wayland-related files.

Just in case:

$ emerge --info '=media-libs/libsdl2-2.26.2::gentoo'
[...]
=================================================================
                        Package Settings
=================================================================

media-libs/libsdl2-2.26.2::gentoo was built with the following:
USE="X alsa (amd64) dbus gles2 haptic joystick kms libsamplerate opengl pulseaudio sound threads udev video vulkan wayland (-aqua) (-custom-cflags) -doc -fcitx4 -gles1 -ibus -jack -nas -oss -pipewire -sndio -static-libs -xscreensaver" CPU_FLAGS_X86="mmx sse sse2 -3dnow" VIDEO_CARDS="(-vc4)"
CFLAGS="-march=skylake -mtune=skylake -pipe -fPIC -fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2"
CXXFLAGS="-march=skylake -mtune=skylake -pipe -fPIC -fstack-protector-strong -D_FORTIFY_SOURCE=2 -O2"
Comment 5 orbea 2023-01-15 22:36:35 UTC
Thanks for checking, I can now reproduce it with USE=wayland and your modified patch is the correct fix.
Comment 6 orbea 2023-01-16 00:37:36 UTC
If you want to make a PR for gentoo that would be great, but if not I can if that is easier for you?
Comment 7 Larry the Git Cow gentoo-dev 2023-01-20 01:23:24 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cb17fbe3cfdc620aefd1017f500810d69a2bccb9

commit cb17fbe3cfdc620aefd1017f500810d69a2bccb9
Author:     Carlos Eduardo <carana2099@gmail.com>
AuthorDate: 2023-01-16 02:09:13 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-01-20 01:21:33 +0000

    media-libs/libsdl2: fix build with slibtool + clang
    
    Closes: https://bugs.gentoo.org/890744
    Signed-off-by: Carlos Eduardo <carana2099@gmail.com>
    Closes: https://github.com/gentoo/gentoo/pull/29129
    Signed-off-by: Sam James <sam@gentoo.org>

 media-libs/libsdl2/files/libsdl2-2.0.16-static-libs.patch | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)