Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 831226 - media-gfx/gphoto2-2.5.28 fails to link: x86_64-pc-linux-gnu/bin/ld: cannot find -lcdkw (dev-libs/cdk needs to be re-emerged to avoid the issue)
Summary: media-gfx/gphoto2-2.5.28 fails to link: x86_64-pc-linux-gnu/bin/ld: cannot fi...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-15 08:49 UTC by Miroslav Šulc
Modified: 2024-01-29 13:53 UTC (History)
8 users (show)

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


Attachments
build.log (build.log,24.31 KB, text/x-log)
2022-01-15 08:49 UTC, Miroslav Šulc
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Miroslav Šulc gentoo-dev 2022-01-15 08:49:51 UTC
Created attachment 762190 [details]
build.log

/bin/sh ../libtool  --tag=CC   --mode=link x86_64-pc-linux-gnu-gcc -I.. -I../gphoto2 -I/usr/include/gphoto2 -I/usr/include/libexif  -DLOCALEDIR=\"/usr/share/locale\" -D_GPHOTO2_INTERNAL_CODE  -I/usr/include/cdk  -I/usr/include/libexif    -march=native -O2 -pipe -frecord-gcc-switches -Wall -Wmissing-declarations -Wmissing-prototypes  -Wl,-O1 -Wl,--as-needed -o gphoto2  gphoto2-gphoto2-cmd-config.o gphoto2-actions.o gphoto2-foreach.o gphoto2-gp-params.o gphoto2-spawnve.o gphoto2-main.o gphoto2-version.o gphoto2-range.o gphoto2-shell.o -lgphoto2 -lgphoto2_port -lm  -L/usr/lib64 -lcdkw -lncursesw -ltinfow   -lpthread -lexif   -lreadline -lpopt  -lm 
libtool: link: x86_64-pc-linux-gnu-gcc -I.. -I../gphoto2 -I/usr/include/gphoto2 -I/usr/include/libexif -DLOCALEDIR=\"/usr/share/locale\" -D_GPHOTO2_INTERNAL_CODE -I/usr/include/cdk -I/usr/include/libexif -march=native -O2 -pipe -frecord-gcc-switches -Wall -Wmissing-declarations -Wmissing-prototypes -Wl,-O1 -o gphoto2 gphoto2-gphoto2-cmd-config.o gphoto2-actions.o gphoto2-foreach.o gphoto2-gp-params.o gphoto2-spawnve.o gphoto2-main.o gphoto2-version.o gphoto2-range.o gphoto2-shell.o  -Wl,--as-needed -lgphoto2 -lgphoto2_port -L/usr/lib64 -lcdkw -lncursesw -ltinfow -lpthread -lexif -lreadline -lpopt -lm
/usr/lib/gcc/x86_64-pc-linux-gnu/11.2.1/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lcdkw
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:725: gphoto2] Error 1
make[2]: Leaving directory '/var/tmp/portage/media-gfx/gphoto2-2.5.28/work/gphoto2-2.5.28/gphoto2'
make[1]: *** [Makefile:463: all-recursive] Error 1
make[1]: Leaving directory '/var/tmp/portage/media-gfx/gphoto2-2.5.28/work/gphoto2-2.5.28'
make: *** [Makefile:395: all] Error 2


# emerge --info '=media-gfx/gphoto2-2.5.28::gentoo'
Portage 3.0.30 (python 3.10.1-final-0, default/linux/amd64/17.1/hardened, gcc-11.2.1, glibc-2.34-r6, 5.16.0-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.16.0-gentoo-x86_64-11th_Gen_Intel-R-_Core-TM-_i9-11900K_@_3.50GHz-with-glibc2.34
KiB Mem:   131764076 total,  98216068 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Sat, 15 Jan 2022 08:00:01 +0000
Head commit of repository gentoo: 8ea76e544bfa6ca296c317c1631b0813288fc65c
sh bash 5.1_p16
ld GNU ld (Gentoo 2.37_p1 p1) 2.37
app-misc/pax-utils:        1.3.3::gentoo
app-shells/bash:           5.1_p16::gentoo
dev-java/java-config:      2.3.1::gentoo
dev-lang/perl:             5.34.0-r6::gentoo
dev-lang/python:           2.7.18_p13::gentoo, 3.8.12_p1-r1::gentoo, 3.9.9-r1::gentoo, 3.10.1-r3::gentoo
dev-lang/rust:             1.58.0::gentoo
dev-util/cmake:            3.22.1::gentoo
dev-util/meson:            0.60.3::gentoo
sys-apps/baselayout:       2.8::gentoo
sys-apps/openrc:           0.44.10::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-devel/autoconf:        2.13-r1::gentoo, 2.71-r1::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.37_p1-r1::gentoo
sys-devel/binutils-config: 5.4::gentoo
sys-devel/clang:           13.0.0::gentoo
sys-devel/gcc:             11.2.1_p20211127::gentoo
sys-devel/gcc-config:      2.5-r1::gentoo
sys-devel/libtool:         2.4.6-r6::gentoo
sys-devel/lld:             13.0.0::gentoo
sys-devel/llvm:            13.0.0::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  5.16::gentoo (virtual/os-headers)
sys-libs/glibc:            2.34-r6::gentoo
Repositories:

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

fordfrog
    location: /usr/src/fordfrog.git
    masters: gentoo
    priority: 0

local
    location: /usr/local/portage
    masters: gentoo

brother-overlay
    location: /var/lib/layman/brother-overlay
    masters: gentoo
    priority: 50

ceamac
    location: /var/lib/layman/ceamac
    masters: gentoo
    priority: 50

flavour
    location: /var/lib/layman/flavour
    masters: gentoo
    priority: 50

waebbl
    location: /var/lib/layman/waebbl
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe -frecord-gcc-switches"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /opt/brother/scanner/brscan4/brsanenetdevice4.cfg /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.8/conf"
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 -O2 -pipe -frecord-gcc-switches"
DISTDIR="/var/db/repos/gentoo/distfiles"
EMERGE_DEFAULT_OPTS="--misspell-suggestions n"
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="-march=native -O2 -pipe -frecord-gcc-switches"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live 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="-march=native -O2 -pipe -frecord-gcc-switches"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="cs_CZ.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="cs cs_CZ en en_US en_UK"
MAKEOPTS="-j17"
PKGDIR="/var/db/repos/gentoo/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"
SHELL="/bin/bash"
USE="X a52 aac aacplus acl alsa amd64 aubio bluetooth bzip2 cdda cddb cdr color-management colord crypt cuda cups dbus dia dssi dvb dvd elogind exif ffmpeg flac gegl gif gphoto2 gsm gtk gtk3 hardened hddtemp http2 ibus iconv icu id3tag ipv6 jack jack-dbus jacksession javafx jpeg ladspa lastfm latex lcms libass libglvnd libnotify libproxy libsamplerate libtirpc lilypond lm-sensors lv2 mad modplug mp3 mpeg mpi mtp multilib musepack ncurses nls nptl ocr ogg openexr opengl openmp opus osc pam pcre pdf pie png policykit pulseaudio qt5 raw readline rubberband samba scanner screencast seccomp sf2 sndfile soundio speex spell split-usr ssl ssp startup-notification svg svg2 taglib theora tiff timidity tk tray truetype udev unicode usb vamp visio vorbis vpx vst vulkan wavpack webp widevine wmf x264 x265 xattr xinerama xmp xtpax xv xvid zlib" ABI_X86="32 64" ADA_TARGET="gnat_2020" APACHE2_MODULES="alias auth_basic authn_core authn_file authz_core authz_host authz_user cgi cgid deflate dir expires filter headers http2 include info log_config mime mime_magic negotiation proxy proxy_ajp rewrite setenvif socache_shmcb status unixd vhost_alias" APACHE2_MPMS="event" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 avx512f avx512dq avx512cd avx512bw avx512vl avx512vbmi f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 ssse3" 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="evdev libinput synaptics wacom" KERNEL="linux" L10N="cs cs-CZ en en-US en-UK" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="NVPTX" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_7 python3_8 python3_9 python3_10" RUBY_TARGETS="ruby26 ruby27 ruby30" SANE_BACKENDS="genesys" USERLAND="GNU" VIDEO_CARDS="intel i915 i965 nvidia" 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, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LEX, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS


# emerge -pqv '=media-gfx/gphoto2-2.5.28::gentoo'
[ebuild     U ] media-gfx/gphoto2-2.5.28 [2.5.27] USE="ncurses nls readline -aalib (-exif%*)"
Comment 1 foufou33 2022-01-15 18:55:03 UTC
for some odd reason the /usr/lib64/libcdkw.so simlink points to a non existing file (libcdkw.so.6.3.4 in this case )


ls -l /usr/lib64/libcdkw*
lrwxrwxrwx 1 root root 16 Jan 12 21:13 /usr/lib64/libcdkw.so -> libcdkw.so.6.3.4
lrwxrwxrwx 1 root root 14 Jan 12 21:13 /usr/lib64/libcdkw.so.6.3.4 -> libcdkw.so.5.0


equery b /usr/lib64/libcdkw.so
 * Searching for /usr/lib64/libcdkw.so ... 
dev-libs/cdk-5.0.20211216 (/usr/lib64/libcdkw.so -> libcdkw.so.6.3.4)


think the probleme is with 
dev-libs/cdk


$ equery files cdk  | grep -v man  | grep -v include | grep -v doc 
/usr
/usr/bin
/usr/bin/cdk5-config
/usr/lib64
/usr/lib64/libcdkw.so
/usr/lib64/libcdkw.so.6.3.4
/usr/share
Comment 2 foufou33 2022-01-15 19:03:21 UTC
oh well, reemerged cdk (ebuild  /usr/portage/dev-libs/cdk/cdk-5.0.20211216.ebuild  merge)
lo and behold, problem is gone ....
Comment 3 Drake Donahue 2022-01-15 19:51:33 UTC
Had this problem.
Traced it back to emerge -1 dev-libs/cdk-5.0.20211216 having created files in /var/tmp/portage/dev-libs/cdk-5.0.20211216/image/usr/lib64 but not installing them in /usr/lib64. Ran ebuild /usr/portage/dev-libs/cdk/cdk-5.0.20211216.ebuild fetch
Ran ebuild /usr/portage/dev-libs/cdk/cdk-5.0.20211216.ebuild configure
Ran ebuild /usr/portage/dev-libs/cdk/cdk-5.0.20211216.ebuild compile
Copied /var/tmp/portage/dev-libs/cdk-5.0.20211216/image/usr/lib64/libcdkw.so.5.0 into /usr/lib64 entered /usr/lib64 and created symlinks: 
libcdkw.so -> libcdkw.so.6.3.4
libcdkw.so.6.3.4 -> libcdkw.so.5.0
emerge -1 gphoto2 libgphoto2 then ran successfully.

Was going to try to find the problem in dev-lib/cdk; removed the libcdkw file and symlinks from /usr/lib64, ran: emerge -C dev-libs/cdk gphoto2 libgphoto2 , then ran:
emerge -C dev-libs/cdk gphoto2 libgphoto2 ; to my surprise the problem did not manifest itself.
Comment 4 Miroslav Šulc gentoo-dev 2022-01-16 08:08:55 UTC
re-emerging cdk really helped, thanks! keeping the bug open as there might be something wrong with cdk and it might need a revbump.
Comment 5 josef.95 2022-02-02 19:36:09 UTC
Yes, rebuild
[ebuild   R    ] dev-libs/cdk-5.0.20211216:0/6::gentoo  USE="unicode -examples" 0 KiB
helped here too.

Thanks!
Comment 6 acmondor 2023-03-07 20:13:28 UTC
I too encountered this issue on both amd64 and x86 systems. Looking at the emerge log for dev-libs/cdk I noticed that libcdkw.so.5.0 gets deleted right near the end as shown below:

[ebuild     U  ] dev-libs/cdk-5.0.20221025:0/6::gentoo [5.0.20210324-r2:0/6::gentoo] USE="unicode -examples -verify-sig%" 529 KiB
.
.
.
>>> Emerging (12 of 158) dev-libs/cdk-5.0.20221025::gentoo
.
.
.
linking libcdkw.so.5.0
.
.
.
ln -s -f libcdkw.so.5.0 libcdkw.so.6.3.4
ln -s -f libcdkw.so.6.3.4 libcdkw.so
>>> Source compiled.
>>> Test phase [not enabled]: dev-libs/cdk-5.0.20221025

>>> Installing (12 of 158) dev-libs/cdk-5.0.20221025::gentoo
>>> /usr/lib/libcdkw.so.5.0
>>> /usr/lib/libcdkw.so.6.3.4 -> libcdkw.so.5.0
.
.
.
>>> /usr/lib/libcdkw.so -> libcdkw.so.6.3.4
>>> needed    obj /usr/lib/libcdkw.so.5.0
>>> needed    sym /usr/lib/libcdkw.so.6.2.4
>>> Safely unmerging already-installed instance...
.
.
.
--- replaced sym /usr/lib/libcdkw.so.6.2.4
--- replaced obj /usr/lib/libcdkw.so.5.0
--- replaced sym /usr/lib/libcdkw.so
.
.
.
>>> Regenerating /etc/ld.so.cache...
>>> Original instance of package unmerged safely.
>>> dev-libs/cdk-5.0.20221025 merged.
>>> Regenerating /etc/ld.so.cache...
<<< !needed  obj /usr/lib/libcdkw.so.5.0
<<< !needed  sym /usr/lib/libcdkw.so.6.2.4

 * GNU info directory index is up-to-date.


Note the two !needed lines. When emerge is run again to re-install the package everything looks the same as above, except those !needed lines aren't then. That is, the log ended like this:

>>> Regenerating /etc/ld.so.cache...
>>> Original instance of package unmerged safely.
>>> dev-libs/cdk-5.0.20221025 merged.
>>> Regenerating /etc/ld.so.cache...

 * GNU info directory index is up-to-date.


The problem is something to do with the upgrade and the .so links. If I down grade the package (ie run: emerge -1v =dev-libs/cdk-5.0.20210324-r2), there is no problem (ie libcdkw.so.5.0 is not removed). However, if follow that with an upgrade (ie run: emerge -1v dev-libs/cdk), the .so file is removed as described above.

I tried looking through the portage code to find the problem and did notice a comment in /usr/lib/python3.10/site-packages/portage/util/env_update.py regarding ldconfig (ie the code related to "Regenerating /etc/ld.so.cache...") that downgrades are treated differently than upgrades. Although, I'm not sure that is completely relevant as I have not yet found what bit of code is actually generating the !needed lines and deleting those files.

Lastly, the log output shown above is for a x86 system. The ouput from an amd64 system is basically identical except /usr/lib/ is /usr/lib64/.
Comment 7 cono 2023-03-14 15:06:03 UTC
Same issue here. Just ran today revdep-rebuild, it started to built gphoto2 and build failed. Rebuilt libcdk fixed symlinks.
Comment 8 Aaron W. Swenson gentoo-dev 2024-01-29 13:50:09 UTC
(In reply to cono from comment #7)
> Same issue here. Just ran today revdep-rebuild, it started to built gphoto2
> and build failed. Rebuilt libcdk fixed symlinks.

I've run into this today with dev-libs/cdk-5.0.20230201 and media-gfx/gphoto2-2.5.28-r1.

Remerging dev-libs/cdk-5.0.20230201 was the only step I performed to fix.
Comment 9 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-01-29 13:53:08 UTC
Given the above, this sounds a lot like the libmilter bug (bug 862642) where symlink order was broken.