Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 806326 - app-emulation/virtualbox-6.1.26 cannot find -lcrypt
Summary: app-emulation/virtualbox-6.1.26 cannot find -lcrypt
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: Lars Wendler (Polynomial-C) (RETIRED)
URL:
Whiteboard: Workaround: try --keep-going=y with w...
Keywords:
Depends on:
Blocks: 798963
  Show dependency tree
 
Reported: 2021-08-04 03:58 UTC by Sergey Ilinykh
Modified: 2021-11-06 20:53 UTC (History)
1 user (show)

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


Attachments
build.log (build.log.gz,144.47 KB, application/gzip)
2021-08-04 03:59 UTC, Sergey Ilinykh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Ilinykh 2021-08-04 03:58:50 UTC
I don't know if it's still relevant or not wrt recent fixes to glibc but I got 

x86_64-pc-linux-gnu-g++                  -Wl,-O1 -Wl,--as-needed -m64   -o /storage/gentoo/tmp/portage/app-emulation/virtualbox-6.1.26/work/VirtualBox-6.1.26/out/linux.amd64/release/obj/bin2c/bin2c /storage/gentoo/tmp/portage/app-emulation/virtualbox-6.1.26/work/VirtualBox-6.1.26/out/linux.amd64/release/obj/bin2c/bin2c.o     -lpthread   -lm   -lrt   -ldl   -lcrypt 
/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lcrypt
collect2: error: ld returned 1 exit status
kmk: *** [/usr/share/kBuild/footer-pass2-compiling-targets.kmk:776: /storage/gentoo/tmp/portage/app-emulation/virtualbox-6.1.26/work/VirtualBox-6.1.26/out/linux.amd64/release/obj/bin2c/bin2c] Error 1
kmk: *** Waiting for unfinished jobs....


while updating my system a couple of days ago.
After installing libxcrypt the problem disappeared.

Reproducible: Always
Comment 1 Sergey Ilinykh 2021-08-04 03:59:56 UTC
Created attachment 729936 [details]
build.log
Comment 2 Sergey Ilinykh 2021-08-04 04:00:41 UTC
$ emerge --info =app-emulation/virtualbox-6.1.26
Portage 3.0.20 (python 3.9.6-final-0, default/linux/amd64/17.1/desktop/plasma/systemd, gcc-11.2.0, glibc-2.33-r5, 5.13.7-gentoo-x86_64 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.13.7-gentoo-x86_64-x86_64-Intel-R-_Core-TM-_i7-9750H_CPU_@_2.60GHz-with-glibc2.33
KiB Mem:    32712980 total,  27580380 free
KiB Swap:          0 total,         0 free
Head commit of repository gentoo: 6e17560f8922f9b12c3184946b691cb016e58667

sh bash 5.1_p8
ld GNU ld (Gentoo 2.36.1 p5) 2.36.1
ccache version 4.3 [disabled]
app-shells/bash:          5.1_p8::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.34.0-r1::gentoo
dev-lang/python:          2.7.18_p11::gentoo, 3.9.6::gentoo, 3.10.0_rc1::gentoo
dev-lang/rust:            1.53.0::gentoo
dev-util/ccache:          4.3-r3::gentoo
dev-util/cmake:           3.21.1::gentoo
sys-apps/baselayout:      2.7-r3::gentoo
sys-apps/sandbox:         2.24::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.71-r1::gentoo
sys-devel/automake:       1.16.4::gentoo
sys-devel/binutils:       2.36.1-r2::gentoo
sys-devel/gcc:            10.3.0-r2::gentoo, 11.2.0::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.13::gentoo (virtual/os-headers)
sys-libs/glibc:           2.33-r5::gentoo
Repositories:

gentoo
    location: /storage/gentoo/portage
    sync-type: git
    sync-uri: https://github.com/gentoo/gentoo.git
    priority: -1000

ejabberd
    location: /home/rion/projects/ejabberd-overlay
    masters: gentoo

rion
    location: /home/rion/projects/rion-overlay
    masters: gentoo

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

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

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
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"
CXXFLAGS="-O2 -pipe"
DISTDIR="/storage/gentoo/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"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance 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"
GENTOO_MIRRORS="https://mirror.yandex.ru/gentoo-distfiles http://distfiles.gentoo.org"
LANG="ru_RU.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="ru en en_US"
MAKEOPTS="-j2"
PKGDIR="/storage/gentoo/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="/storage/gentoo/tmp"
USE="X a52 aac acl acpi activities alsa amd64 appstream aptx avahi bluetooth branding bzip2 cairo cdr cli crypt cuda cups dbus declarative designer dri dts dvd dvdr emboss emoji encode exif faad ffmpeg flac fuse gdbm gif gnome-keyring gpm gstreamer gtk gtk3 gui http2 iconv icu idn ipv6 javafx jingle jpeg jpeg2k kde kipi kwallet ladspa lcms ldac libass libglvnd libnotify libtirpc lm-sensors mad mng modemmanager modplug mp3 mp4 mpeg mtp multilib ncurses networkmanager nls nptl nsplugin nvenc offensive ogg opengl openmp opus pam pango pcre pdf phonon plasma png policykit ppds pulseaudio qml qt5 rdp readline rtmp samba sdl seccomp semantic-desktop spell split-usr srt ssl startup-notification svg symlink systemd systemtap tcpd theora threads tiff truetype udev udisks unicode upnp upower usb v4l vdpau vnc vorbis vpx vulkan webp widgets wxwidgets x264 xattr xcb xinerama xml xv xvid zlib 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="mmx mmxext sse sse2 sse3 ssse3 sse4_1 sse4_2 aes avx avx2" 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 synaptics" KERNEL="linux" L10N="ru en en_US" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="WebAssembly" 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_9" RUBY_TARGETS="ruby27" USERLAND="GNU" VIDEO_CARDS="nvidia i965" 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, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RUSTFLAGS

=================================================================
                        Package Settings
=================================================================

app-emulation/virtualbox-6.1.26::gentoo was built with the following:
USE="alsa opengl opus pam pulseaudio qt5 sdk udev vnc -debug -doc -dtrace -headless -java -lvm -pax-kernel -python -vboxwebsrv" ABI_X86="(64)" PYTHON_SINGLE_TARGET="python3_9 -python3_8"
Comment 3 Sergey Ilinykh 2021-08-04 04:01:56 UTC
emerge info was taken already after system update. sorry for that.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-08-04 04:05:01 UTC
I suspect that you were the victim of an incomplete transition due to one problem or another (hopefully all ironed out now, although it's been working around bugs rather than the process).  It is interesting you actually hit this problem given you have FEATURES="preserved-libs" though.

That said, if VirtualBox is linking against libcrypt, we still need a dependency on it! It's very possible as-is that Portage could merge VirtualBox after dropping crypt from glibc and before installing libxcrypt. Even if it shouldn't lead to a problem like _this_.

Someone with it installed will need to check that it indeed links against libcrypt and revbump the versions in tree to add the virtual/libcrypt:= dependency.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-08-22 03:14:49 UTC
ping
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-09-27 14:55:30 UTC
ping
Comment 7 Sergey Ilinykh 2021-09-27 15:26:59 UTC
I guess it's build-only dep. I can't grep libcrypt from the installed stuff and the failed bin2c (Binary 2 C Structure Converter) isn't installed by VirtualBox.

Also I checked VB 6.1.26 source code and couldn't find libcrypt linking anywhere. So maybe they use something from openssl now.

Even so I found the following conditionally compiled code 

```C++
    pfnCryptR = (PFNCRYPTR)(uintptr_t)RTLdrGetSystemSymbolEx("libcrypt.so", "crypt_r", RTLDRLOAD_FLAGS_SO_VER_RANGE(1, 6));
    if (!pfnCryptR)
        pfnCryptR = (PFNCRYPTR)(uintptr_t)RTLdrGetSystemSymbolEx("libxcrypt.so", "crypt_r", RTLDRLOAD_FLAGS_SO_VER_RANGE(1, 32));
```
in src/VBox/Runtime/r3/posix/process-creation-posix.cpp

But still I can't grep lib(x)crypt from the compiled binaries.
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-11-06 20:51:36 UTC
That looks like vague ~dlopen stuff. Let's just depend on it.
Comment 9 Larry the Git Cow gentoo-dev 2021-11-06 20:53:26 UTC
The bug has been closed via the following commit(s):

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

commit 9bc0bb6f57d32ecd0ac728ef361fb73e0578b3fa
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2021-11-06 20:52:32 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-11-06 20:52:32 +0000

    app-emulation/virtualbox: needs libcrypt
    
    Bug's been open for a while and VirtualBox's build system is "complicated":
    let's depend on libcrypt given it seems pretty clear it needs it in some
    capacity and we're better off ensuring it actually builds/installs.
    
    Closes: https://bugs.gentoo.org/806326
    Signed-off-by: Sam James <sam@gentoo.org>

 .../virtualbox/{virtualbox-6.1.24.ebuild => virtualbox-6.1.24-r1.ebuild} | 1 +
 .../virtualbox/{virtualbox-6.1.26.ebuild => virtualbox-6.1.26-r1.ebuild} | 1 +
 .../virtualbox/{virtualbox-6.1.28.ebuild => virtualbox-6.1.28-r1.ebuild} | 1 +
 3 files changed, 3 insertions(+)