ERROR: sys-libs/pam-1.7.2::gentoo failed (compile phase):
-
northfrisia
- Tux's lil' helper

- Posts: 83
- Joined: Mon Feb 01, 2021 4:55 am
ERROR: sys-libs/pam-1.7.2::gentoo failed (compile phase):
Hi,
sys-libs/pam-1.7.2. failed to compile.
Here are the logs:
The emerge info -> https://bpa.st/2R4BW
The output of emerge -pqv -> https://bpa.st/HJFGG
The build log -> https://bpa.st/CQ5T6
The environment -> (wget paste failed here "400 Bad request" ???)
Will see whether I will be able to add this file later...
My Gentoo is updated daily, I am running multilib.
This error is an older one, since I hoped that is would be a temporary...
...which is not unfortunately.
How can I fix this?
Cheers!
NorthFrisia
sys-libs/pam-1.7.2. failed to compile.
Here are the logs:
The emerge info -> https://bpa.st/2R4BW
The output of emerge -pqv -> https://bpa.st/HJFGG
The build log -> https://bpa.st/CQ5T6
The environment -> (wget paste failed here "400 Bad request" ???)
Will see whether I will be able to add this file later...
My Gentoo is updated daily, I am running multilib.
This error is an older one, since I hoped that is would be a temporary...
...which is not unfortunately.
How can I fix this?
Cheers!
NorthFrisia
Hi,
Same as https://forums.gentoo.org/viewtopic-t-1176001.html
No solution but it seems you are not alone in this case.
Same as https://forums.gentoo.org/viewtopic-t-1176001.html
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
Can you please post the outputs of following commands :
The qfile utility is from app-portage/portage-utils.
Your emerge --info and build.log shows that portage is building the package only for 64-bit.
But, on this command :
Maybe this file (and others) is an orphan file on your filesystem.
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*
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.
The source of the issue is this:
Those paths should be /usr/lib64 and not /usr/lib.
How are you running emerge? from a root prompt? Feels a lot like environment bleed or some other way of overriding pkgconfig path.
Code: Select all
build.pkg_config_path: /usr/lib/pkgconfig:/usr/share/pkgconfig
pkg_config_path : /usr/lib/pkgconfig:/usr/share/pkgconfigHow are you running emerge? from a root prompt? Feels a lot like environment bleed or some other way of overriding pkgconfig path.
To be clear, this is what I get for the configure stage of sys-libs/pam-1.7.2 for those variables:
The meson code in an ebuild looks for PKG_CONFIG_LIBDIR or BUILD_PKG_CONFIG_LIBDIR to be set in the environment.
This is normally supplied by other eclasses.
I believe this is a case where emerge --info --verbose may be of some help
Code: Select all
build.pkg_config_path: /usr/share/pkgconfig
pkg_config_path : /usr/share/pkgconfigThis is normally supplied by other eclasses.
I believe this is a case where emerge --info --verbose may be of some help
-
northfrisia
- Tux's lil' helper

- Posts: 83
- Joined: Mon Feb 01, 2021 4:55 am
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.
I am multilib (32/64 bit) by the way (see initial post)
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 By the way
sys-apps/systemd-utils-259.3:0/0::gentoo
now fails at the same ninja-step seemingly (looking at the error after compilation failed...
no deeper analysis, though)
Please post the outputs of :
Can you try to reinstall sys-libs/libxcrypt to see if it makes any difference :
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
-
northfrisia
- Tux's lil' helper

- Posts: 83
- Joined: Mon Feb 01, 2021 4:55 am
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
the compilation of libxcrypt was painless, the following compilation of pam failed.
Here are the outputs of the mentioned commands:
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 KiBPlease post outputs of :
Code: 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"
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.
-
northfrisia
- Tux's lil' helper

- Posts: 83
- Joined: Mon Feb 01, 2021 4:55 am
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.
ATTENTION! For all reading this...
After pam is recompiled successfully you need to recompile your login manager (sddm in my case)
BEFORE you logout or reboot otherwise you are locked out.
PKG_CONFIG_PATH is set bei nvidia and vpl via scripts copied to /etc.
In my case I found a leftover in my .zshrc, which seemed to be the culprit here.
May be "This should not be set anywhere " is a little too broad...? (guessing, since official sources set it in scripts below /etc/. ...)
PKG_CONFIG_PATH must be set only to paths which contain pkg-config files that are correct for the build being run. In the general case of running emerge on arbitrary packages, it seems dangerous to have it set because of the variety of packages that might consume it. Exactly what official sources are setting it, where are they writing it, and to what value are they setting it?
-
northfrisia
- Tux's lil' helper

- Posts: 83
- Joined: Mon Feb 01, 2021 4:55 am
I found the following place, where PKG_CONFIG_PTH gets set:
I could identify some of the packages:
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

