Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 795315 - media-libs/libsdl[libcaca] abi_x86_32 tries to link 64-bit libraries
Summary: media-libs/libsdl[libcaca] abi_x86_32 tries to link 64-bit libraries
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
: 823890 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-06-11 02:14 UTC by admin
Modified: 2023-05-27 14:41 UTC (History)
4 users (show)

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


Attachments
build log for x86_32 (build.log,207.76 KB, text/x-log)
2021-06-11 02:17 UTC, admin
Details
config log for x86_32 (config.log,229.16 KB, text/x-log)
2021-06-11 02:21 UTC, admin
Details
Temporary patch. (libtool_workaround_fix.patch,1.79 KB, patch)
2021-06-12 20:00 UTC, admin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description admin 2021-06-11 02:14:54 UTC
While installing the 32 bit libSDL version I get a compilation failure because of instead of searching at /usr/lib it searches at /usr/lib64.



Reproducible: Always

Steps to Reproduce:
1. emerge --ask libsdl
2. wait
3. compilation failure for x86_32, x86_64 works
Actual Results:  
I get a compilation failure.

Expected Results:  
It should build successfully.

I use gentoo hardened system.

emerge --info:
Portage 3.0.18 (python 3.9.4-final-0, default/linux/amd64/17.1/hardened, gcc-11.1.0, glibc-2.33, 5.12.0-pf4-xkmod x86_64)
=================================================================
System uname: Linux-5.12.0-pf4-xkmod-x86_64-Intel-R-_Core-TM-_i7-9700K_CPU_@_3.60GHz-with-glibc2.33
KiB Mem:    32817960 total,  17302076 free
KiB Swap:   67108860 total,  67108860 free
Timestamp of repository gentoo: Thu, 10 Jun 2021 21:30:01 +0000
Head commit of repository gentoo: ca38032064b6bbcf36604e5c0421eac7533a0243
Timestamp of repository guru: Thu, 10 Jun 2021 10:20:13 +0000
Head commit of repository guru: 300d908151dd6b1f407dc8272134225ea2fcce89

Timestamp of repository monero: Thu, 10 Jun 2021 07:50:09 +0000
Head commit of repository monero: 16b24cf6c9624b96e5ebaac10cdf038b989e1e96

sh bash 5.1_p8
ld GNU ld (Gentoo 2.35.2 p1) 2.35.2
app-shells/bash:          5.1_p8::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.32.1::gentoo
dev-lang/python:          2.7.18_p9::gentoo, 3.9.4_p1::gentoo
dev-lang/rust:            1.51.0-r2::gentoo
dev-util/cmake:           3.18.5::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.42.1-r1::gentoo
sys-apps/sandbox:         2.24::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.16.3-r1::gentoo
sys-devel/binutils:       2.35.2::gentoo
sys-devel/gcc:            10.3.0-r1::gentoo, 11.1.0-r1::gentoo
sys-devel/gcc-config:     2.4::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.10::gentoo (virtual/os-headers)
sys-libs/glibc:           2.33::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts: 
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-jobs: 1

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

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

crossdev
    location: /var/db/repos/localrepo-crossdev
    masters: gentoo
    priority: 10

flow
    location: /var/lib/layman/flow
    sync-type: laymansync
    sync-uri: https://gitlab.com/Flow/flow-s-ebuilds.git
    masters: gentoo
    priority: 50

steam-overlay
    location: /var/lib/layman/steam-overlay
    sync-type: laymansync
    sync-uri: https://github.com/anyc/steam-overlay.git
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -mtune=native -march=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/themes/oxygen-gtk/gtk-2.0"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.4/ext-active/ /etc/php/cgi-php7.4/ext-active/ /etc/php/cli-php7.4/ext-active/ /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="-O2 -pipe -mtune=native -march=native"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY 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"
FCFLAGS="-O2 -pipe -mtune=native -march=native"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict 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="-O2 -pipe -mtune=native -march=native"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j16"
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="/var/tmp"
USE="X a52 aac aalib accessibility acl acpi afs alsa amd64 atm bash-completion bluetooth bzip2 calendars canna caps cjk clang colord cracklib crypt cups curl cvs cxx cycles cypt dbus dedicated dga dri dv elogind emacs emoji encode exif expat fbcon ffmpeg flac fontconfig fortran freewnn ftp gd gdbm geoip ggi gif gimp git gles2 gmp gnuplot gnutls graphicsmagick graphviz gsl gsm gstreamer gui gzip handbook hardened hddtemp iconv icu imap imlib inotify introspection ipv6 java javascript jbig jemalloc jit joystick jpeg kde kerberos ladspa lame latex lcms ldap libass libcaca libglvnd libnotify libtirpc lm-sensors lua luajit lz4 lzma lzo m17n-lib mad magic man matroska memcached mhash mmap mng modules mp3 mp4 mpeg mpi mplayer mtp multilib multitarget musepack mysql mysqli nas ncurses netcdf networkmanager nls nntp nptl ocaml ocamlopt ofx ogg openal openexr opengl openimageio openmp opus osc pcmcia pcre pda pdf perl php pie plasma plotutils png portaudio posix postgres postscript profile python qmail-spp qt5 quicktime radius raw rdp readline recode rnnoise rss ruby samba sasl screencast sctp sdl seccomp semantic-desktop session skey slang slp smartcard smp snappy sndfile sockets socks5 sound source sox speex spell split-usr sqlite ssl ssp startup-notification static-libs static-user subversion svg syslog szip tcl tcpd theora threads tidy tiff tk truetype udev udisks unicode unpn unpn-av upower usb v4l vaapi vala vcd vdpau verify-sig vhosts videos vim-syntax vnc vorbis vulkan wavpack wayland webkit webp wifi wmf wxwidgets x264 xattr xcomposite xemacs xft xine xinerama xivd xml xmpp xosd xpm xscreensaver xtpax xv xvid zeroconf zip zlib zsh-completion zstd" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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 3dnow" ELIBC="glibc" 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" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="X86 ARM AArch64" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9" QEMU_SOFTMMU_TARGETS="arm x86_64 sparc mips ppc" QEMU_USER_TARGETS="x86_64" RUBY_TARGETS="ruby26" USERLAND="GNU" VIDEO_CARDS="iris i965 intel nouveau" 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:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RUSTFLAGS
Comment 1 admin 2021-06-11 02:17:05 UTC
Created attachment 715203 [details]
build log for x86_32
Comment 2 admin 2021-06-11 02:21:54 UTC
Created attachment 715206 [details]
config log for x86_32

This describes the issues with --libdir and where EXTRA_LDFLAGS is using −L/usr/lib64 instead of −L/usr/lib
Comment 3 admin 2021-06-11 03:48:10 UTC
I've found a bit more info,
disabling aalib the global useflag worked, this is due because instead of having the linker trying to add the symbols, it should skip it, if not it exits emerge.
Comment 4 admin 2021-06-11 05:07:57 UTC
I just checked the config log a bit more, it seems that -laa gets replaced with //usr/lib64/libaa.so, I'm not sure that is the right behavior, I think it should stay -laa, and I'm not even sure what is causing this.
Comment 5 Ionen Wolkens gentoo-dev 2021-06-11 07:41:15 UTC
Can't reproduce, tried same USE (including abi_x86_32 and aalib) but it builds fine, and own my own line I see:
-lasound -lm -ldl -laudio -laa -L/usr/lib64 -lcaca -lpthread  -m32

I am a bit concerned by the -L/usr/lib64 being there though, not that I see any with double // in my logs and it still built fine.

By any chances, did you recently do a profile migration (from 17.0)? Incomplete migration is often the cause of issues with abi_x86_32.
Comment 6 Ionen Wolkens gentoo-dev 2021-06-11 08:05:52 UTC
Also, the -L/usr/lib64 is coming from libcaca rather than libsdl

Seems this is used as-is:
$ caca-config --libs
-L/usr/lib64 -lcaca

Goes away with USE="-libcaca", not that it fails for me either way so I assume there's something more going on.

There's also:
$ aalib-config --libs
-L/usr/lib64 -Wl,-rpath,/usr/lib -laa -lm -lncurses -ltinfo

But I don't see that rpath used in my log, so perhaps it doesn't use that one.
Comment 7 admin 2021-06-11 16:35:10 UTC
(In reply to Ionen Wolkens from comment #5)
> Can't reproduce, tried same USE (including abi_x86_32 and aalib) but it
> builds fine, and own my own line I see:
> -lasound -lm -ldl -laudio -laa -L/usr/lib64 -lcaca -lpthread  -m32
> 
> I am a bit concerned by the -L/usr/lib64 being there though, not that I see
> any with double // in my logs and it still built fine.
> 
> By any chances, did you recently do a profile migration (from 17.0)?
> Incomplete migration is often the cause of issues with abi_x86_32.
Yeah it's like it gets replaced with for some reasons.
I did not do a profile migration, my system is new fresh, using default/linux/amd64/17.1/hardened.

(In reply to Ionen Wolkens from comment #6)
> Also, the -L/usr/lib64 is coming from libcaca rather than libsdl
> 
> Seems this is used as-is:
> $ caca-config --libs
> -L/usr/lib64 -lcaca
> 
> Goes away with USE="-libcaca", not that it fails for me either way so I
> assume there's something more going on.
> 
> There's also:
> $ aalib-config --libs
> -L/usr/lib64 -Wl,-rpath,/usr/lib -laa -lm -lncurses -ltinfo
> 
> But I don't see that rpath used in my log, so perhaps it doesn't use that
> one.
I have tried to disable libcaca, it compiles.
It just doesn't work when enabling both aalib and libcaca. 
The interesting thing is when I disable libcaca, the lib being linked with is //usr/lib/libaa.so. (... -laudio //usr/lib/libaa.so -lslang -lm -lX11 -lpthread ... ), when I disable aalib, it throws me first:

-Wl,--as-needed -lasound -lm -ldl -laudio -L/usr/lib64 -lcaca -lpthread  -m32 -Wl,-O1   -Wl,-soname -Wl,libSDL-1.2.so.0 -o build/.libs/libSDL-1.2.so.0.11.5

Where -L/usr/lib64 -lcaca is in fact caca-config --libs
Then

/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib64/libasound.so when searching for -lasound
/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib64/libm.so when searching for -lm
/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib64/libm.a when searching for -lm
/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib64/libdl.so when searching for -ldl
/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib64/libdl.a when searching for -ldl
/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib64/libaudio.so when searching for -laudio
/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib64/libaudio.a when searching for -laudio
/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib64/libcaca.so when searching for -lcaca
/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib64/libcaca.a when searching for -lcaca
/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib64/libpthread.so when searching for -lpthread
/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib64/libpthread.a when searching for -lpthread
/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib64/libc.so when searching for -lc
/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: skipping incompatible /usr/lib64/libc.a when searching for -lc

Something is definitely wrong..
It feels like that -laa is being translated into libaa.so:

-L/usr/lib64 -Wl,-rpath,/usr/lib -laa -lm -lX11 -lslang

Becomes somehow:

//usr/lib/libaa.so -lslang -lm -lX11 -lpthread

For 
$ caca-config --libs 
-L/usr/lib64 -lcaca

But for 
$ aalib-config --libs
-L/usr/lib64 -Wl,-rpath,/usr/lib -laa -lm -lX11 -lslang

Maybe my RPATH is set somehow, but even if it was set, it should not be possible because of --disable-rpath.

How to know if that variable being used?

Also is it possible to have your build/config logs?
Specially everything in:

/var/tmp/portage/media-libs/libsdl-1.2.15_p20210224/

with using FEATURES="keepwork" so it doesn't get removed after being installed?

Thank you.

By the way, on my side, I get this issue on my both machines, laptop and desktop. So if that works for you it means that I did somehow the same error on my both machines, where I don't really know what it could be.

Also, the 32 bit library, by following dependencies, is being asked from wine-staging with those useflags:

app-emulation/wine-staging staging capi custom-cflags dos faudio gcrypt gecko gssapi gstreamer mingw mono netapi opencl osmesa perl pcap pipelight prelink realtime run-exes samba sdl staging themes udev unwind usb vkd3d vulkan

where gst-plugins-meta is being asked aswell. etc...
Comment 8 admin 2021-06-11 21:33:20 UTC
I'm suspecting now a problem with libtool not interpreting arguments correctly for some reasons.
Comment 9 admin 2021-06-12 20:00:25 UTC
Created attachment 715635 [details, diff]
Temporary patch.

This is a temporary/workaround patch for the issue I have, though it is probably not the proper one, I think the issue relies on libtool replacing /usr/lib by /usr/lib64 because it sees -L/usr/lib64 inside the EXTRA_LDFLAGS, so it replaces everything else by /usr/lib64, I'll investigate more once I have time but this works for me.
Comment 10 Ionen Wolkens gentoo-dev 2021-11-16 01:34:41 UTC
*** Bug 823890 has been marked as a duplicate of this bug. ***
Comment 11 Ionen Wolkens gentoo-dev 2021-11-16 01:37:44 UTC
Haven't looked closely but note the duplicate bug #823890 has a patch as well (using PKG_CHECK_MODULES).
Comment 12 Ionen Wolkens gentoo-dev 2021-11-16 01:59:08 UTC
On a side-note, I am still not able to reproduce USE="libcaca abi_x86_32" builds fine for me. Not to say there isn't something going on here.
Comment 13 Pacho Ramos gentoo-dev 2023-05-27 14:41:36 UTC
Can you retry with 1.2.64 version please? Thanks