Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 691362

Summary: sys-fs/udev fails to link libcap.so in wrong format
Product: Gentoo Linux Reporter: Daiajo Tibdixious <daiajo>
Component: Current packagesAssignee: udev maintainers <udev-bugs>
Status: RESOLVED WORKSFORME    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: build log

Description Daiajo Tibdixious 2019-08-03 22:01:42 UTC
Created attachment 585640 [details]
build log

udev-242 link fails with this error
/usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/libcap.so: error adding symbols: file in wrong format
collect2: error: ld returned 1 exit status

I rebuilt sys-libs/libcap-2.26-r2 without issue, but the undev link still fails.

# file /usr/lib/libcap.so
/usr/lib/libcap.so: symbolic link to libcap.so.2
# file /usr/lib/libcap.so.2
/usr/lib/libcap.so.2: symbolic link to libcap.so.2.26
# file /usr/lib/libcap.so.2.26
/usr/lib/libcap.so.2.26: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, stripped
# file /usr/lib64/libcap.so.2.26
/usr/lib64/libcap.so.2.26: cannot open `/usr/lib64/libcap.so.2.26' (No such file or directory)
# file /usr/lib64/libcap.so
/usr/lib64/libcap.so: ASCII text
# cat /usr/lib64/libcap.so 
/* GNU ld script
   Since Gentoo has critical dynamic libraries in /lib, and the static versions
   in /usr/lib, we need to have a "fake" dynamic lib in /usr/lib, otherwise we
   run into linking problems.  This "fake" dynamic lib is a linker script that
   redirects the linker to the real lib.  And yes, this works in the cross-
   compiling scenario as the sysroot-ed linker will prepend the real path.

   See bug https://bugs.gentoo.org/4411 for more info.
 */
OUTPUT_FORMAT ( elf64-x86-64 )
GROUP ( /lib64/libcap.so.2 )

# emerge -pqv '=sys-fs/udev-242::gentoo'
[ebuild     U ] sys-fs/udev-242 [239] USE="acl kmod (-selinux)" ABI_X86="32 (64) (-x32)"
Comment 1 Daiajo Tibdixious 2019-08-03 22:02:20 UTC
# emerge --info '=sys-fs/udev-242::gentoo'
Portage 2.3.69 (python 3.6.5-final-0, default/linux/amd64/17.1/desktop, gcc-8.3.0, glibc-2.29-r2, 4.19.44-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.19.44-gentoo-x86_64-AMD_FX-tm-8350_Eight-Core_Processor-with-gentoo-2.6
KiB Mem:    16420032 total,   2453420 free
KiB Swap:     506040 total,    506040 free
Timestamp of repository gentoo: Sat, 03 Aug 2019 16:15:01 +0000
Head commit of repository gentoo: 5cf81f5a9757105cad09486a33226e6fdcb37677
sh bash 4.4_p23-r1
ld GNU ld (Gentoo 2.31.1 p7) 2.31.1
app-shells/bash:          4.4_p23-r1::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.28.2-r1::gentoo
dev-lang/python:          2.7.15::gentoo, 3.6.5::gentoo
dev-util/cmake:           3.14.6::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.41.2::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.16.1-r1::gentoo
sys-devel/binutils:       2.31.1-r6::gentoo, 2.32-r1::gentoo
sys-devel/gcc:            8.3.0-r1::gentoo
sys-devel/gcc-config:     2.0::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.19::gentoo (virtual/os-headers)
sys-libs/glibc:           2.29-r2::gentoo
Repositories:

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

Daiajo
    location: /usr/local/portage
    masters: gentoo
    priority: 0

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -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="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN 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"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg 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 sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_AU.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en_GB"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
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 acl acpi alsa alsa-plugin amd64 branding bzip2 cairo cdda cdr cli consolekit crypt css cxx dbus dhcp dri dts dvd dvdr emboss encode exif fam flac fortran gdbm gif glamor gnutls gpm gtk iconv icu ipv6 java jpeg kde lcms ldap libnotify libtirpc mad minizip mmx mng mp3 mp4 mpeg multilib mysql ncurses nls nptl nsplugin ogg opengl openmp pam pango pcre pdf png policykit ppds pulseaudio qt5 readline savedconfig sddm sdl seccomp semantic-desktop spell split-usr sql sse sse2 ssl startup-notification svg tcpd tiff truetype udev udisks unicode upower usb vim-syntax vorbis wxwidgets x264 xattr xcb xml xv xvid zlib" ABI_X86="64 32" 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 fma3 fma4 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 xop" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" L10N="en-GB" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" NETBEANS_MODULES="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" RUBY_TARGETS="ruby24" USERLAND="GNU" VIDEO_CARDS="ati radeon" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 2 Mike Gilbert gentoo-dev 2019-08-04 17:53:52 UTC
You probably have a bad libdir value in /usr/lib64/pkgconfig/libcap.pc. Please rebuild sys-libs/libcap.
Comment 3 Daiajo Tibdixious 2019-08-04 22:36:28 UTC
I already rebuilt libcap (as I mentioned in the initial description).

# cat /usr/lib64/pkgconfig/libcap.pc
prefix=/usr
exec_prefix=
libdir=/usr/lib64
includedir=/usr/include

Name: libcap
Description: libcap
Version: 2.26
Libs: -L${libdir} -lcap
Libs.private: 
Cflags: -I${includedir}

# cat /usr/lib/pkgconfig/libcap.pc
prefix=/usr
exec_prefix=
libdir=/usr/lib
includedir=/usr/include

Name: libcap
Description: libcap
Version: 2.26
Libs: -L${libdir} -lcap
Libs.private: 
Cflags: -I${includedir}

# ls /usr/*/libcap.so*
/usr/lib64/libcap.so  /usr/lib/libcap.so  /usr/lib/libcap.so.2  /usr/lib/libcap.so.2.26
# ls /lib*/libcap.so*
/lib64/libcap.so.2  /lib64/libcap.so.2.26
# file /lib*/libcap.so*
/lib64/libcap.so.2:    symbolic link to libcap.so.2.26
/lib64/libcap.so.2.26: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, stripped

It seems that the 64bit libcap is in /lib64, whereas the pc file has it in /usr/lib64, where that libcap.so is a text file redirector to /lib64.
Comment 4 Mike Gilbert gentoo-dev 2019-08-05 00:10:05 UTC
What does this output on your system?

pkg-config --libs libcap
Comment 5 Mike Gilbert gentoo-dev 2019-08-05 00:17:01 UTC
Actually this might be more useful:

PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 pkg-config --libs libcap
Comment 6 Mike Gilbert gentoo-dev 2019-08-05 01:36:25 UTC
Just to share my thoughts:

This does not appear to be a common problem, or more people would be reporting it.

I suspect there is something special about your system that causes pkg-config to return the wrong libdir, or meson to misinterpret the libdir, or something like that.

I doubt we are going to be able to figure out what is different about your system by sending comments back-and-forth on bugzilla. It will likely require some greater research on your part.

If you would like to ping me on Freenode (IRC) for an interactive troubleshooting session, I would not mind.
Comment 7 Daiajo Tibdixious 2019-08-05 04:06:18 UTC
# PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 pkg-config --libs libcap
-L/usr/lib64 -lcap

I was about to log a problem with chromium not building now.
/usr/include/glib-2.0/glib/gmacros.h:181:29: error: size of array ���_GStaticAssertCompileTimeAssertion_1��� is negative
Upgraded it just a few days ago with no issues.

So I have pango fails with a configure problem https://www.bugs.gentoo.org/690742
and this one. All suggesting a fundamental problem but I can't see the connection.
Comment 8 Daiajo Tibdixious 2019-08-05 04:10:43 UTC
(In reply to Mike Gilbert from comment #6)
> Just to share my thoughts:
> 
> This does not appear to be a common problem, or more people would be
> reporting it.
> 
> I suspect there is something special about your system that causes
> pkg-config to return the wrong libdir, or meson to misinterpret the libdir,
> or something like that.
> 
> I doubt we are going to be able to figure out what is different about your
> system by sending comments back-and-forth on bugzilla. It will likely
> require some greater research on your part.
> 
> If you would like to ping me on Freenode (IRC) for an interactive
> troubleshooting session, I would not mind.

I have not used freenode irc before, I connected to #mikegilbert
Comment 9 Mike Gilbert gentoo-dev 2019-08-05 14:14:40 UTC
Sorry, I should have mentioned the #gentoo support channel.