Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 776937 - sys-apps/pciutils-3.7.0 - x86_64-pc-linux-gnu/bin/ld: cannot find -ludev
Summary: sys-apps/pciutils-3.7.0 - x86_64-pc-linux-gnu/bin/ld: cannot find -ludev
Status: UNCONFIRMED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-17 14:08 UTC by Martin Mokrejš
Modified: 2021-03-18 11:57 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Mokrejš 2021-03-17 14:08:01 UTC
Hi,
  I am installing and EPREFIXed gentoo instance andseems the dependencies are not defined properly.

x86_64-pc-linux-gnu-gcc -shared -Wl,-O1 -Wl,--as-needed -Wl,-soname,libpci.so.3 -Wl,--version-script=libpci.ver -o libpci.so.3.7.0 init.o access.o generic.o dump.o names.o filter.o names-hash.o names-parse.o names-net.o names-cache.o names-hwdb.o params.o caps.o sysfs.o proc.o i386-ports.o -lz -ludev
/foo/gentoo/usr/x86_64-pc-linux-gnu/gcc-bin/10.2.0/../../../lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -ludev
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:70: libpci.so.3.7.0] Error 1
make[1]: Leaving directory '/scratch.ssd/bar/portage/sys-apps/pciutils-3.7.0/work/pciutils-3.7.0-abi_x86_64.amd64/lib'
make: *** [Makefile:65: lib/libpci.so.3.7.0] Error 2
make: *** Waiting for unfinished jobs....
 * ERROR: sys-apps/pciutils-3.7.0::gentoo failed (compile phase):
 *   emake failed


I have sys-fs/eudev-3.2.10 already installed.

I do have /foo/gentoo/usr/lib64/libudev.so .Well, there is no '-L' on the link line. 


$
$ x86_64-pc-linux-gnu-gcc -print-search-dirs
install: /foo/gentoo/usr/x86_64-pc-linux-gnu/gcc-bin/10.2.0/../../../lib/gcc/x86_64-pc-linux-gnu/10.2.0/
programs: =/foo/gentoo/usr/x86_64-pc-linux-gnu/gcc-bin/10.2.0/../../../libexec/gcc/x86_64-pc-linux-gnu/10.2.0/:/foo/gentoo/usr/x86_64-pc-linux-gnu/gcc-bin/10.2.0/../../../libexec/gcc/:/foo/gentoo/usr/x86_64-pc-linux-gnu/gcc-bin/10.2.0/../../../lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu/10.2.0/:/foo/gentoo/usr/x86_64-pc-linux-gnu/gcc-bin/10.2.0/../../../lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/
libraries: =/foo/gentoo/usr/x86_64-pc-linux-gnu/gcc-bin/10.2.0/../../../lib/gcc/x86_64-pc-linux-gnu/10.2.0/:/foo/gentoo/usr/x86_64-pc-linux-gnu/gcc-bin/10.2.0/../../../lib/gcc/:/foo/gentoo/usr/x86_64-pc-linux-gnu/gcc-bin/10.2.0/../../../lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/lib/x86_64-pc-linux-gnu/10.2.0/:/foo/gentoo/usr/x86_64-pc-linux-gnu/gcc-bin/10.2.0/../../../lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/lib/../lib64/:/foo/gentoo/usr/x86_64-pc-linux-gnu/gcc-bin/10.2.0/../../../lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../x86_64-pc-linux-gnu/10.2.0/:/foo/gentoo/usr/x86_64-pc-linux-gnu/gcc-bin/10.2.0/../../../lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../lib64/:/baz/gentoo/lib/x86_64-pc-linux-gnu/10.2.0/:/baz/gentoo/lib/../lib64/:/baz/gentoo/usr/lib/x86_64-pc-linux-gnu/10.2.0/:/baz/gentoo/usr/lib/../lib64/:/foo/gentoo/usr/x86_64-pc-linux-gnu/gcc-bin/10.2.0/../../../lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/lib/:/foo/gentoo/usr/x86_64-pc-linux-gnu/gcc-bin/10.2.0/../../../lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../:/baz/gentoo/lib/:/baz/gentoo/usr/lib/
$

Yes, maybe something is wrong with parsing the complicated paths? There is a symlinked NFS-based directory in there so the 'foo' and 'baz' are practivally same but as you can see, gcc-picked up both.

It is true that https://gitweb.gentoo.org/repo/proj/prefix.git/plain/scripts/bootstrap-bash.sh  complained to me that I want to install gcc into a location which needs to be resolved via the symlink and it is known to be broken. Provided I installed system up to stage3 I doubt I am affected but nevertheless wanted to mention that.



$ emerge --info
Portage 3.0.17 (python 3.8.8-final-0, default/linux/amd64/17.1/no-multilib/prefix/kernel-3.2+, gcc-10.2.0, glibc-2.32-r8, 3.10.0-1160.15.2.el7.x86_64 x86_64)
=================================================================
System uname: Linux-3.10.0-1160.15.2.el7.x86_64-x86_64-Intel-R-_Xeon-R-_Gold_6254_CPU_@_3.10GHz-with-glibc2.2.5
KiB Mem:  10563841808 total,1332575404 free
KiB Swap:    4194300 total,   3890320 free
Timestamp of repository gentoo: Wed, 17 Mar 2021 01:00:01 +0000
Head commit of repository gentoo: 7f45254f083ec6d66c62d554198d449ea52e3420
sh bash 5.1_p4
ld GNU ld (Gentoo 2.35.2 p1) 2.35.2
app-shells/bash:          5.1_p4::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.32.1::gentoo
dev-lang/python:          3.8.8::gentoo, 3.9.2::gentoo
dev-util/cmake:           3.19.7::gentoo
sys-apps/baselayout:      2.7-r1::gentoo
sys-apps/sandbox:         2.21::gentoo
sys-devel/autoconf:       2.71::gentoo
sys-devel/automake:       1.16.3-r1::gentoo
sys-devel/binutils:       2.35.2::gentoo
sys-devel/gcc:            10.2.0-r5::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.11::gentoo (virtual/os-headers)
sys-libs/glibc:           2.32-r8::gentoo
Repositories:

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

science
    location: /foo/gentoo/var/lib/layman/science
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="@FREE Intel-SDP intel-ucode fasta meme mRNAmarkup ApE modeller gmap abyss swiss-prot Aladdin AVASYS pyvcf Non-profit-OSL-3.0 estscan blat staden CeCILL-1.1 phrap STRIDE cctbx-2.0 bh-luxi ARIADNE unRAR trf freedist free-noncomm genscan no-source-code BSD MIT BSD-2 unicode Subversion"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -mtune=native -ftree-vectorize"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /foo/gentoo/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/sandbox.d /etc/terminfo /foo/gentoo/etc/env.d /foo/gentoo/etc/gentoo-release"
CXXFLAGS="-O2 -pipe -mtune=native -ftree-vectorize"
DISTDIR="/storage/brno3-cerit/home/mmokrejs/gentoo/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 -ftree-vectorize"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles force-prefix ipc-sandbox merge-sync multilib-strict network-sandbox news nostrip parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans unprivileged"
FFLAGS="-O2 -pipe -mtune=native -ftree-vectorize"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j100"
PKGDIR="/foo/gentoo/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/foo/gentoo/"
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="/scratch.ssd/bar"
USE="acl amd64 asm avx avx2 berkdb boost bzip2 cli crypt dri emboss fortran gdbm gmp iconv icu java jpeg jpg lapack libglvnd libtirpc mariadb mmx ncurses nfs nls nptl nptlonly objc openmp openssl pbs pcre pcre16 pdf perl png prefix readline sctp seccomp server session split-usr sqlite sse sse2 sse3 sse4_1 sse4_2 ssl sslv3 ssse3 svg tcl tcpd threads tiff tk truetype unicode vim-syntax xml zlib" 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="mmx mmxext sse sse2" 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" 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_8" PYTHON_TARGETS="python3_8" RUBY_TARGETS="ruby26" USERLAND="GNU" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" 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, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Ionen Wolkens gentoo-dev 2021-03-18 11:18:55 UTC
pciutils[udev] seems fine on my own amd64 prefix, and the linking line is identical.

But when I look at the libudev.so symlink I do feel like something "could" go wrong.

Target exists but for me it's a whole:
libudev.so -> ../../../../../home/ionen/prefix/lib64/libudev.so.1.6.3

Is it valid for you?
Comment 2 Martin Mokrejš 2021-03-18 11:38:02 UTC
Thank you. Right, on the very same machine the ls(1) output blinks the symlink on 3rd line in red, as it points to nowhere:

lrwxrwxrwx 1 mmokrejs meta     16 Mar 17 14:44 /storage/brno3-cerit/home/mmokrejs/gentoo/lib64/libudev.so.1 -> libudev.so.1.6.3
-rwxr-xr-x 1 mmokrejs meta 189808 Mar 17 14:44 /storage/brno3-cerit/home/mmokrejs/gentoo/lib64/libudev.so.1.6.3
lrwxrwxrwx 1 mmokrejs meta     84 Mar 17 14:44 /storage/brno3-cerit/home/mmokrejs/gentoo/usr/lib64/libudev.so -> ../../../../../../../storage/brno3-cerit/home/mmokrejs/gentoo/lib64/libudev.so.1.6.3
-rw-r--r-- 1 mmokrejs meta    655 Mar 17 14:44 /storage/brno3-cerit/home/mmokrejs/gentoo/usr/lib64/pkgconfig/libudev.pc


$ cd /storage/brno3-cerit/home/mmokrejs/gentoo/usr/lib64/
$ ls -latr libudev.so
lrwxrwxrwx 1 mmokrejs meta 84 Mar 17 14:44 libudev.so -> ../../../../../../../storage/brno3-cerit/home/mmokrejs/gentoo/lib64/libudev.so.1.6.3
$ file libudev.so
libudev.so: broken symbolic link to ../../../../../../../storage/brno3-cerit/home/mmokrejs/gentoo/lib64/libudev.so.1.6.3
$ 

The real fs mount point is /mnt/storage-brno3-cerit, then

/storage/brno3-cerit symlinks to /mnt/storage-brno3-cerit/nfs4

I assume it is because the path when resolved with the "nfs4" in its name is longer by one. I guess during libudev install the ... libtool? package create the path when think it is under /mnt/storage-brno3-cerit/nfs4 path while later it get executed through /storage/brno3-cerit path. But why does this happen only for a single package? Maybe the error message from bootstrap-prefix.sh was :correct"?


$ export I_KNOW_MY_GCC_WORKS_FINE_WITH_SYMLINKS='hell yeah'
$ ./bootstrap-prefix.sh 

The "problem is" that the mounts are done in a different way on the cluster and that is why there is a unified symlinked path as e.g. /storage/brno3-cerit and that was the one I wanted to tell gentoo-prefix to pick. All tools works IMO except this one.
Comment 3 Fabian Groffen gentoo-dev 2021-03-18 11:43:24 UTC
In your case I suggest to just fix the symlink manually, because this really is nasty to take care of.  Hence we don't support this setup.
Comment 4 Martin Mokrejš 2021-03-18 11:48:56 UTC
Maybe readlink or some other utility could be used or improved to shorten the path? Now on the broken symlink it cannot probably do any better but during installation of libudev it could have shortened the relative path to ../../lib64/libudev.so.1.6.3

$ readlink libudev.so
../../../../../../../storage/brno3-cerit/home/mmokrejs/gentoo/lib64/libudev.so.1.6.3
$
Comment 5 Martin Mokrejš 2021-03-18 11:57:40 UTC
rm libudev.so; ln -s ../../lib64/libudev.so.1.6.3 libudev.so
rm libkmod.so; ln -s ../../lib64/libkmod.so.2.3.6 libkmod.so # from sys-apps/kmod-28

There were no more issues. I tested like this:

$ ln -s ../dsdsd/sds junksss
$ find ./ -type l -exec file {} \; | grep broken
./junksss: broken symbolic link to ../dsdsd/sds
$ 

Maybe some portage class could have taken care of this? Still I wonder why this happened for only two packages.