
Code: Select all
[...]x86_64-pc-linux-gnu/bin/ld: /usr/lib/libcrypt.so: error adding symbols: file in wrong format
collect2: error: ld returned 1 exit status
Code: Select all
$ ls -l /usr/lib*/libcrypt.so*
Code: Select all
$ pkgconf --path libcrypt
Code: Select all
$ qfile /usr/lib*/pkgconfig/libcrypt.pc
Code: Select all
$ qfile /usr/lib*/libcrypt.so*
/usr/lib/libcrypt.so is a 32bit path.[122/525] x86_64-pc-linux-gnu-gcc -o modules/pam_pwhistory/pam_pwhistory.so modules/pam_pwhistory/pam_pwhistory.so.p/pam_pwhistory.c.o modules/pam_pwhistory/pam_pwhistory.so.p/opasswd.c.o modules/pam_pwhistory/pam_pwhistory.so.p/pwhistory_config.c.o -Wl,--as-needed -Wl,--allow-shlib-undefined -shared -fPIC -Wl,--fatal-warnings -Wl,--no-undefined-version -Wl,-O1 -O2 -pipe -march=znver2 -mtune=znver2 -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,--undefined-version '-Wl,-rpath,$ORIGIN/../../libpam' -Wl,--start-group libpam_internal/libpam_internal.a libpam/libpam.so.0.85.1 -Wl,--version-script=/var/tmp/portage/sys-libs/pam-1.7.2/work/Linux-PAM-1.7.2/modules/pam_pwhistory/module.map /usr/lib/libcrypt.so -Wl,--end-group
[...]
/usr/x86_64-pc-linux-gnu/binutils-bin/2.46.0/ld: /usr/lib/libcrypt.so: error adding symbols: file in wrong format
collect2: error: ld returned 1 exit status
Code: Select all
build.pkg_config_path: /usr/lib/pkgconfig:/usr/share/pkgconfig
pkg_config_path : /usr/lib/pkgconfig:/usr/share/pkgconfigCode: Select all
build.pkg_config_path: /usr/share/pkgconfig
pkg_config_path : /usr/share/pkgconfig
netfab wrote:Can you please post the outputs of following commands :Code: Select all
$ ls -l /usr/lib*/libcrypt.so*Code: Select all
$ pkgconf --path libcryptCode: Select all
$ qfile /usr/lib*/pkgconfig/libcrypt.pcThe qfile utility is from app-portage/portage-utils.Code: Select all
$ qfile /usr/lib*/libcrypt.so*
Your emerge --info and build.log shows that portage is building the package only for 64-bit.
But, on this command :/usr/lib/libcrypt.so is a 32bit path.[122/525] x86_64-pc-linux-gnu-gcc -o modules/pam_pwhistory/pam_pwhistory.so modules/pam_pwhistory/pam_pwhistory.so.p/pam_pwhistory.c.o modules/pam_pwhistory/pam_pwhistory.so.p/opasswd.c.o modules/pam_pwhistory/pam_pwhistory.so.p/pwhistory_config.c.o -Wl,--as-needed -Wl,--allow-shlib-undefined -shared -fPIC -Wl,--fatal-warnings -Wl,--no-undefined-version -Wl,-O1 -O2 -pipe -march=znver2 -mtune=znver2 -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,--undefined-version '-Wl,-rpath,$ORIGIN/../../libpam' -Wl,--start-group libpam_internal/libpam_internal.a libpam/libpam.so.0.85.1 -Wl,--version-script=/var/tmp/portage/sys-libs/pam-1.7.2/work/Linux-PAM-1.7.2/modules/pam_pwhistory/module.map /usr/lib/libcrypt.so -Wl,--end-group
[...]
/usr/x86_64-pc-linux-gnu/binutils-bin/2.46.0/ld: /usr/lib/libcrypt.so: error adding symbols: file in wrong format
collect2: error: ld returned 1 exit status
Maybe this file (and others) is an orphan file on your filesystem.
Code: Select all
$ ls -l /usr/lib*/libcrypt.so*Code: Select all
lrwxrwxrwx 1 root root 17 2025-11-10 17:42 /usr/lib/libcrypt.so -> libcrypt.so.2.0.0
lrwxrwxrwx 1 root root 17 2025-11-10 17:42 /usr/lib/libcrypt.so.1 -> libcrypt.so.1.1.0
-rwxr-xr-x 1 root root 214320 2025-11-10 17:42 /usr/lib/libcrypt.so.1.1.0
lrwxrwxrwx 1 root root 17 2025-11-10 17:42 /usr/lib/libcrypt.so.2 -> libcrypt.so.2.0.0
-rwxr-xr-x 1 root root 214320 2025-11-10 17:42 /usr/lib/libcrypt.so.2.0.0
lrwxrwxrwx 1 root root 17 2025-11-10 17:42 /usr/lib64/libcrypt.so -> libcrypt.so.2.0.0
lrwxrwxrwx 1 root root 17 2025-11-10 17:42 /usr/lib64/libcrypt.so.1 -> libcrypt.so.1.1.0
-rwxr-xr-x 1 root root 206712 2025-11-10 17:42 /usr/lib64/libcrypt.so.1.1.0
lrwxrwxrwx 1 root root 17 2025-11-10 17:42 /usr/lib64/libcrypt.so.2 -> libcrypt.so.2.0.0
-rwxr-xr-x 1 root root 202616 2025-11-10 17:42 /usr/lib64/libcrypt.so.2.0.0Code: Select all
pkgconf --path libcrypt Code: Select all
/usr/lib/pkgconfig/libcrypt.pcCode: Select all
qfile /usr/lib*/pkgconfig/libcrypt.pc Code: Select all
sys-libs/libxcrypt: /usr/lib/pkgconfig/libcrypt.pc
sys-libs/libxcrypt: /usr/lib64/pkgconfig/libcrypt.pcCode: Select all
qfile /usr/lib*/libcrypt.so* Code: Select all
sys-libs/libxcrypt: /usr/lib/libcrypt.so.2
sys-libs/libxcrypt: /usr/lib/libcrypt.so.2.0.0
sys-libs/libxcrypt: /usr/lib/libcrypt.so
sys-libs/libxcrypt: /usr/lib/libcrypt.so.1
sys-libs/libxcrypt: /usr/lib/libcrypt.so.1.1.0
sys-libs/libxcrypt: /usr/lib64/libcrypt.so.2
sys-libs/libxcrypt: /usr/lib64/libcrypt.so.2.0.0
sys-libs/libxcrypt: /usr/lib64/libcrypt.so
sys-libs/libxcrypt: /usr/lib64/libcrypt.so.1
sys-libs/libxcrypt: /usr/lib64/libcrypt.so.1.1.0Code: Select all
How are you running emerge? from a root prompt? Code: Select all
emerge --info --verbose Code: Select all
$ ls -l /usr/lib*/pkgconfig/libcrypt.pc
Code: Select all
$ emerge -pv sys-libs/libxcrypt
Code: Select all
# emerge -av1 sys-libs/libxcrypt

First I reinstalled sys-libs/libxcryptnetfab wrote:Please post the outputs of :Code: Select all
$ ls -l /usr/lib*/pkgconfig/libcrypt.pcCan you try to reinstall sys-libs/libxcrypt to see if it makes any difference :Code: Select all
$ emerge -pv sys-libs/libxcryptCode: Select all
# emerge -av1 sys-libs/libxcrypt
Code: Select all
#> ls -l /usr/lib*/pkgconfig/libcrypt.pc
lrwxrwxrwx 1 root root 12 2026-03-22 11:29 /usr/lib/pkgconfig/libcrypt.pc -> libxcrypt.pc
lrwxrwxrwx 1 root root 12 2026-03-22 11:29 /usr/lib64/pkgconfig/libcrypt.pc -> libxcrypt.pcCode: Select all
#> emerge -pv sys-libs/libxcrypt
These are the packages that would be merged, in order:
Calculating dependencies ... done!
Dependency resolution took 2.90 s (backtrack: 0/20).
[ebuild R ] sys-libs/libxcrypt-4.4.38:0/1::gentoo USE="(compat) (system) (-headers-only) -static-libs -test" ABI_X86="32 (64) (-x32)" 0 KiB
Total: 1 package (1 reinstall), Size of downloads: 0 KiBCode: Select all
# pkg-config --variable pc_path pkg-config
Code: Select all
$ env | grep PATH
This should not be set anywhere and is causing you problems. Find out where it coming from and remove it. Often an environment file somewhere in /etc or a shell configuration.northfrisia wrote:Code: Select all
PKG_CONFIG_PATH="/usr/lib/pkgconfig"

That fixed it! Oh YEAH! Thanks a lot too all, which contributed and helped to pin point this...grknight wrote:This should not be set anywhere and is causing you problems. Find out where it coming from and remove it. Often an environment file somewhere in /etc or a shell configuration.northfrisia wrote:Code: Select all
PKG_CONFIG_PATH="/usr/lib/pkgconfig"
If found in /etc/env.d, then don't forget to execute env-update ; source /etc/profile. A new login or reboot may be required to apply the environment change beyond that.

Code: Select all
/etc>grep -r PKG_CONFIG_PATH
env.d/99cuda879098:PKG_CONFIG_PATH=/opt/cuda/pkgconfig
environment.d/10-gentoo-env.conf:PKG_CONFIG_PATH=/opt/cuda/pkgconfig
csh.env:setenv PKG_CONFIG_PATH '/opt/cuda/pkgconfig'
profile.env:export PKG_CONFIG_PATH='/opt/cuda/pkgconfig'
vpl/vars.sh:PKG_CONFIG_PATH=$(prepend_path "$vpl_pkgconfig" "${PKG_CONFIG_PATH:-}")
vpl/vars.sh:export PKG_CONFIG_PATHCode: Select all
dev-util/nvidia-cuda-toolkit
env-update
???
???
media-libs/libvpl