besser82/libxcrypt

Build fails: ld: error: version script assignment of 'XCRYPT_2.0' to symbol 'crypt_gensalt_r' failed: symbol not defined

Opened this issue · 5 comments

See the log.

I think that you are using the *.map file with symbols that don't exist.

Version: 4.4.36
FreeBSD 15

Please fix the system configuration issue reported at the top of the build log:

!!! Jail is newer than host. (Jail: 1500010, Host: 1500006) !!!
!!! This is not supported. !!!
!!! Host kernel must be same or newer than jail. !!!
!!! Expect build failures. !!!

If that doesn't make the problem go away, please attach to this bug a complete tarball of the build directory, and a copy of the build log. Please also provide a URL for the source code of the port.

We've ran into this issue with Nixpkgs (the official package repository for the Nix package manager). This issue crops up when we compile using LLVM, gcc appears to work.

Attaching the requested tarball and build log (tarball contains full tree and build.log at top level): nix-libxcrypt-symbol-issue.tar.gz

Can be reproduced if you have nix available (on x86_64-linux at least) in a matter of tens of seconds by typing:

nix develop nixpkgs/58a1abdbae3217ca6b702f03d3b35125d88a2994#pkgsLLVM.libxcrypt
genericBuild

This will have the effect of building libxcrypt with a fully-llvm toolchain (note the use of the linker with basename x86_64-unknown-linux-gnu-ld, however tihs is a misnomer and actually LLVM's lld linker is being used, which opens the opportunity for it being an ld vs lld incompatibility at play)

Some hopefully salient details:

Link line and output

/run/current-system/sw/bin/bash ./libtool  --tag=CC   --mode=link x86_64-unknown-linux-gnu-clang -Wall -Wextra -Walloca -Wbad-function-cast -Wcast-align -Wcast-qual -Wconversion -Wformat=2 -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wnull-dereference -Wold-style-definition -Wpointer-arith -Wshadow -Wstrict-overflow=2 -Wstrict-prototypes -Wundef -Wvla -Wwrite-strings -Wpedantic -fno-plt -g -O2 -version-info 2:0:0 -Wl,--version-script,./libcrypt.map -Wl,-z,defs -Wl,-z,text -Wl,-z,relro -Wl,-z,now  -o libcrypt.la -rpath /tmp/xcrypt/outputs/out/lib lib/libcrypt_la-alg-des-tables.lo lib/libcrypt_la-alg-des.lo lib/libcrypt_la-alg-gost3411-2012-core.lo lib/libcrypt_la-alg-gost3411-2012-hmac.lo lib/libcrypt_la-alg-hmac-sha1.lo lib/libcrypt_la-alg-md4.lo lib/libcrypt_la-alg-md5.lo lib/libcrypt_la-alg-sha1.lo lib/libcrypt_la-alg-sha256.lo lib/libcrypt_la-alg-sha512.lo lib/libcrypt_la-alg-yescrypt-common.lo lib/libcrypt_la-alg-yescrypt-opt.lo lib/libcrypt_la-crypt-bcrypt.lo lib/libcrypt_la-crypt-des.lo lib/libcrypt_la-crypt-gensalt-static.lo lib/libcrypt_la-crypt-gost-yescrypt.lo lib/libcrypt_la-crypt-md5.lo lib/libcrypt_la-crypt-nthash.lo lib/libcrypt_la-crypt-pbkdf1-sha1.lo lib/libcrypt_la-crypt-scrypt.lo lib/libcrypt_la-crypt-sha256.lo lib/libcrypt_la-crypt-sha512.lo lib/libcrypt_la-crypt-static.lo lib/libcrypt_la-crypt-sunmd5.lo lib/libcrypt_la-crypt-yescrypt.lo lib/libcrypt_la-crypt.lo lib/libcrypt_la-util-base64.lo lib/libcrypt_la-util-gensalt-sha.lo lib/libcrypt_la-util-get-random-bytes.lo lib/libcrypt_la-util-make-failure-token.lo lib/libcrypt_la-util-xbzero.lo lib/libcrypt_la-util-xstrcpy.lo   
libtool: link: x86_64-unknown-linux-gnu-clang -shared  -fPIC -DPIC  lib/.libs/libcrypt_la-alg-des-tables.o lib/.libs/libcrypt_la-alg-des.o lib/.libs/libcrypt_la-alg-gost3411-2012-core.o lib/.libs/libcrypt_la-alg-gost3411-2012-hmac.o lib/.libs/libcrypt_la-alg-hmac-sha1.o lib/.libs/libcrypt_la-alg-md4.o lib/.libs/libcrypt_la-alg-md5.o lib/.libs/libcrypt_la-alg-sha1.o lib/.libs/libcrypt_la-alg-sha256.o lib/.libs/libcrypt_la-alg-sha512.o lib/.libs/libcrypt_la-alg-yescrypt-common.o lib/.libs/libcrypt_la-alg-yescrypt-opt.o lib/.libs/libcrypt_la-crypt-bcrypt.o lib/.libs/libcrypt_la-crypt-des.o lib/.libs/libcrypt_la-crypt-gensalt-static.o lib/.libs/libcrypt_la-crypt-gost-yescrypt.o lib/.libs/libcrypt_la-crypt-md5.o lib/.libs/libcrypt_la-crypt-nthash.o lib/.libs/libcrypt_la-crypt-pbkdf1-sha1.o lib/.libs/libcrypt_la-crypt-scrypt.o lib/.libs/libcrypt_la-crypt-sha256.o lib/.libs/libcrypt_la-crypt-sha512.o lib/.libs/libcrypt_la-crypt-static.o lib/.libs/libcrypt_la-crypt-sunmd5.o lib/.libs/libcrypt_la-crypt-yescrypt.o lib/.libs/libcrypt_la-crypt.o lib/.libs/libcrypt_la-util-base64.o lib/.libs/libcrypt_la-util-gensalt-sha.o lib/.libs/libcrypt_la-util-get-random-bytes.o lib/.libs/libcrypt_la-util-make-failure-token.o lib/.libs/libcrypt_la-util-xbzero.o lib/.libs/libcrypt_la-util-xstrcpy.o    -g -O2 -Wl,--version-script -Wl,./libcrypt.map -Wl,-z -Wl,defs -Wl,-z -Wl,text -Wl,-z -Wl,relro -Wl,-z -Wl,now   -Wl,-soname -Wl,libcrypt.so.2 -o .libs/libcrypt.so.2.0.0
x86_64-unknown-linux-gnu-ld: error: version script assignment of 'XCRYPT_2.0' to symbol 'crypt_gensalt_r' failed: symbol not defined
x86_64-unknown-linux-gnu-ld: error: version script assignment of 'XCRYPT_2.0' to symbol 'xcrypt' failed: symbol not defined
x86_64-unknown-linux-gnu-ld: error: version script assignment of 'XCRYPT_2.0' to symbol 'xcrypt_gensalt' failed: symbol not defined
x86_64-unknown-linux-gnu-ld: error: version script assignment of 'XCRYPT_2.0' to symbol 'xcrypt_gensalt_r' failed: symbol not defined
x86_64-unknown-linux-gnu-ld: error: version script assignment of 'XCRYPT_2.0' to symbol 'xcrypt_r' failed: symbol not defined
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Click to expand full list of symbols found in object files (via `find -iname '*.o' -exec nm {} +`)

./libxcrypt-4.4.36/lib/.libs/libcrypt_la-crypt-des.o:

./libxcrypt-4.4.36/lib/.libs/libcrypt_la-alg-sha1.o:

./libxcrypt-4.4.36/lib/.libs/libcrypt_la-util-base64.o:
0000000000000000 R _crypt_ascii64

./libxcrypt-4.4.36/lib/.libs/libcrypt_la-alg-md4.o:

./libxcrypt-4.4.36/lib/.libs/libcrypt_la-alg-md5.o:

./libxcrypt-4.4.36/lib/.libs/libcrypt_la-crypt-nthash.o:

./libxcrypt-4.4.36/lib/.libs/libcrypt_la-alg-des-tables.o:

./libxcrypt-4.4.36/lib/.libs/libcrypt_la-alg-des.o:

./libxcrypt-4.4.36/lib/.libs/libcrypt_la-crypt-gensalt-static.o:
0000000000000000 T _crypt_crypt_gensalt
0000000000000000 b _crypt_crypt_gensalt.output
                 U _crypt_crypt_gensalt_rn
0000000000000000 T crypt_gensalt@@XCRYPT_2.0

./libxcrypt-4.4.36/lib/.libs/libcrypt_la-util-make-failure-token.o:
0000000000000000 T _crypt_make_failure_token

./libxcrypt-4.4.36/lib/.libs/libcrypt_la-alg-hmac-sha1.o:

./libxcrypt-4.4.36/lib/.libs/libcrypt_la-crypt-sunmd5.o:

./libxcrypt-4.4.36/lib/.libs/libcrypt_la-crypt-sha256.o:

./libxcrypt-4.4.36/lib/.libs/libcrypt_la-util-get-random-bytes.o:
                 U arc4random_buf
0000000000000000 T _crypt_get_random_bytes
                 U __errno_location
                 U __explicit_bzero_chk

./libxcrypt-4.4.36/lib/.libs/libcrypt_la-crypt-pbkdf1-sha1.o:

./libxcrypt-4.4.36/lib/.libs/libcrypt_la-alg-gost3411-2012-hmac.o:
                 U __assert_fail
                 U _crypt_GOST34112012_Final
                 U _crypt_GOST34112012_Init
                 U _crypt_GOST34112012_Update
0000000000000000 T _crypt_gost_hash256
0000000000000050 T _crypt_gost_hmac256
                 U __explicit_bzero_chk
0000000000000000 r .LCPI1_0
0000000000000010 r .LCPI1_1
000000000000004c r .L__PRETTY_FUNCTION__._crypt_gost_hmac256
0000000000000000 r .L.str
000000000000002f r .L.str.1

./libxcrypt-4.4.36/lib/.libs/libcrypt_la-crypt-md5.o:

./libxcrypt-4.4.36/lib/.libs/libcrypt_la-crypt-static.o:
0000000000000000 T _crypt_crypt
0000000000000000 b _crypt_crypt.nr_crypt_ctx
                 U _crypt_crypt_r
0000000000000000 T crypt@@XCRYPT_2.0

./libxcrypt-4.4.36/lib/.libs/libcrypt_la-util-gensalt-sha.o:
                 U __assert_fail
                 U _crypt_ascii64
0000000000000000 T _crypt_gensalt_sha_rn
                 U __errno_location
0000000000000041 r .L__PRETTY_FUNCTION__._crypt_gensalt_sha_rn
0000000000000000 r .L.str
0000000000000010 r .L.str.1
000000000000002a r .L.str.2
                 U __snprintf_chk

./libxcrypt-4.4.36/lib/.libs/libcrypt_la-crypt-gost-yescrypt.o:
0000000000000080 T _crypt_crypt_gost_yescrypt_rn
0000000000000000 T _crypt_gensalt_gost_yescrypt_rn
                 U _crypt_gensalt_yescrypt_rn
                 U _crypt_gost_hash256
                 U _crypt_gost_hmac256
                 U _crypt_strcpy_or_abort
                 U _crypt_yescrypt_decode64
                 U _crypt_yescrypt_encode64
                 U _crypt_yescrypt_free_local
                 U _crypt_yescrypt_init_local
                 U _crypt_yescrypt_r
                 U __errno_location
0000000000000000 r .L.str
                 U memmove
                 U __stack_chk_fail
                 U strchr
                 U strlen
                 U strncmp

./libxcrypt-4.4.36/lib/.libs/libcrypt_la-crypt-yescrypt.o:
0000000000000000 T _crypt_crypt_yescrypt_rn
00000000000000e0 T _crypt_gensalt_yescrypt_rn
                 U _crypt_strcpy_or_abort
                 U _crypt_yescrypt_encode_params_r
                 U _crypt_yescrypt_free_local
                 U _crypt_yescrypt_init_local
                 U _crypt_yescrypt_r
                 U __errno_location
                 U __stack_chk_fail

./libxcrypt-4.4.36/lib/.libs/libcrypt_la-crypt-scrypt.o:
                 U _crypt_ascii64
0000000000000000 T _crypt_crypt_scrypt_rn
                 U _crypt_crypt_yescrypt_rn
00000000000000e0 T _crypt_gensalt_scrypt_rn
                 U _crypt_strcpy_or_abort
                 U __errno_location
0000000000000000 r .L.str
                 U __stack_chk_fail
                 U strncmp

./libxcrypt-4.4.36/lib/.libs/libcrypt_la-crypt.o:
0000000000000500 T crypt_checksalt@@XCRYPT_4.3
                 U _crypt_crypt_bcrypt_a_rn
                 U _crypt_crypt_bcrypt_rn
                 U _crypt_crypt_bcrypt_y_rn
0000000000000500 T _crypt_crypt_checksalt
00000000000004a0 T _crypt_crypt_gensalt_ra
0000000000000260 T _crypt_crypt_gensalt_rn
                 U _crypt_crypt_gost_yescrypt_rn
0000000000000570 T _crypt_crypt_preferred_method
0000000000000220 T _crypt_crypt_r
0000000000000180 T _crypt_crypt_ra
0000000000000000 T _crypt_crypt_rn
                 U _crypt_crypt_scrypt_rn
                 U _crypt_crypt_sha512crypt_rn
                 U _crypt_crypt_yescrypt_rn
                 U _crypt_gensalt_bcrypt_a_rn
                 U _crypt_gensalt_bcrypt_rn
                 U _crypt_gensalt_bcrypt_y_rn
                 U _crypt_gensalt_gost_yescrypt_rn
00000000000004a0 T crypt_gensalt_ra@@XCRYPT_2.0
0000000000000260 T crypt_gensalt_rn@@XCRYPT_2.0
                 U _crypt_gensalt_scrypt_rn
                 U _crypt_gensalt_sha512crypt_rn
                 U _crypt_gensalt_yescrypt_rn
                 U _crypt_get_random_bytes
                 U _crypt_make_failure_token
0000000000000570 T crypt_preferred_method@@XCRYPT_4.4
0000000000000180 T crypt_ra@@XCRYPT_2.0
0000000000000000 T crypt_rn@@XCRYPT_2.0
0000000000000220 T crypt_r@@XCRYPT_2.0
0000000000000070 t do_crypt
                 U __errno_location
                 U __explicit_bzero_chk
                 U free
0000000000000390 t get_hashfn
0000000000000000 d hash_algorithms
0000000000000000 r .L.str
0000000000000001 r .L.str.1
0000000000000005 r .L.str.2
000000000000000a r .L.str.3
000000000000000f r .L.str.4
0000000000000014 r .L.str.5
0000000000000019 r .L.str.6
000000000000001d r .L.str.7
0000000000000021 r .L.str.8
                 U malloc
                 U realloc
                 U __stack_chk_fail
                 U strcspn
                 U strlen
                 U strncmp

./libxcrypt-4.4.36/lib/.libs/libcrypt_la-util-xbzero.o:

./libxcrypt-4.4.36/lib/.libs/libcrypt_la-alg-gost3411-2012-core.o:
0000000000000000 r Ax
0000000000004300 r buffer0
0000000000004000 r C
0000000000000000 T _crypt_GOST34112012_Cleanup
0000000000000350 T _crypt_GOST34112012_Final
0000000000000020 T _crypt_GOST34112012_Init
0000000000000070 T _crypt_GOST34112012_Update
                 U __explicit_bzero_chk
0000000000000600 t g
0000000000000000 r .LCPI1_0
                 U memcpy
                 U memset
                 U __stack_chk_fail
0000000000000140 t stage2

./libxcrypt-4.4.36/lib/.libs/libcrypt_la-crypt-sha512.o:
                 U _crypt_ascii64
0000000000000000 T _crypt_crypt_sha512crypt_rn
0000000000000d00 T _crypt_gensalt_sha512crypt_rn
                 U _crypt_gensalt_sha_rn
                 U _crypt_SHA512_Final
                 U _crypt_SHA512_Init
                 U _crypt_SHA512_Update
                 U __errno_location
                 U __isoc23_strtoul
0000000000000000 r .L.str
0000000000000004 r .L.str.1
                 U memcpy
0000000000000004 r sha512_rounds_prefix
0000000000000000 r sha512_salt_prefix
                 U __snprintf_chk
                 U __stack_chk_fail
                 U strcspn
                 U strncmp

./libxcrypt-4.4.36/lib/.libs/libcrypt_la-util-xstrcpy.o:
                 U __assert_fail
0000000000000000 T _crypt_strcpy_or_abort
000000000000001f r .L__PRETTY_FUNCTION__._crypt_strcpy_or_abort
0000000000000000 r .L.str
000000000000000c r .L.str.1
000000000000005b r .L.str.2
0000000000000067 r .L.str.3
                 U memcpy
                 U memset
                 U strlen

./libxcrypt-4.4.36/lib/.libs/libcrypt_la-alg-yescrypt-common.o:
0000000000000000 r atoi64_partial
                 U _crypt_ascii64
0000000000001bd0 T _crypt_crypto_scrypt
                 U _crypt_SHA256_Final
                 U _crypt_SHA256_Init
                 U _crypt_SHA256_Update
0000000000000e90 T _crypt_yescrypt
0000000000000000 b _crypt_yescrypt.buf
0000000000000180 T _crypt_yescrypt_decode64
0000000000000000 T _crypt_yescrypt_encode64
0000000000001bb0 T _crypt_yescrypt_encode_params
0000000000000090 b _crypt_yescrypt_encode_params.buf
00000000000011e0 T _crypt_yescrypt_encode_params_r
                 U _crypt_yescrypt_free_local
                 U _crypt_yescrypt_init_local
                 U _crypt_yescrypt_kdf
0000000000000300 T _crypt_yescrypt_r
0000000000000f30 T _crypt_yescrypt_reencrypt
0000000000000af0 t decode64_uint32
00000000000019d0 t encode64_uint32
                 U __explicit_bzero_chk
0000000000000000 r .L.str
                 U memcpy
                 U __stack_chk_fail
                 U strlen
                 U strncmp
                 U strrchr
0000000000000bf0 t yescrypt_sha256_cipher

./libxcrypt-4.4.36/lib/.libs/libcrypt_la-alg-sha512.o:
0000000000001090 T _crypt_SHA512_Buf
0000000000000f60 T _crypt_SHA512_Final
0000000000000000 T _crypt_SHA512_Init
0000000000000080 T _crypt_SHA512_Update
                 U __explicit_bzero_chk
0000000000000000 r K
                 U memcpy
0000000000000280 r PAD
0000000000000150 t SHA512_Transform
                 U __stack_chk_fail

./libxcrypt-4.4.36/lib/.libs/libcrypt_la-alg-sha256.o:
                 U __assert_fail
0000000000000820 T _crypt_HMAC_SHA256_Buf
0000000000000750 T _crypt_HMAC_SHA256_Final
00000000000003b0 T _crypt_HMAC_SHA256_Init
00000000000006f0 T _crypt_HMAC_SHA256_Update
0000000000000920 T _crypt_PBKDF2_SHA256
00000000000002f0 T _crypt_SHA256_Buf
0000000000000160 T _crypt_SHA256_Final
0000000000000000 T _crypt_SHA256_Init
0000000000000020 T _crypt_SHA256_Update
                 U __explicit_bzero_chk
0000000000000450 t _HMAC_SHA256_Init
0000000000000000 r initial_state
0000000000000060 r Krnd
0000000000000000 r .LCPI7_0
0000000000000010 r .LCPI7_1
0000000000000034 r .L__PRETTY_FUNCTION__._crypt_PBKDF2_SHA256
0000000000000000 r .L.str
0000000000000023 r .L.str.1
0000000000000000 r .L.str.2
                 U memcpy
0000000000000020 r PAD
00000000000001e0 t _SHA256_Final
0000000000001010 t SHA256_Transform
0000000000000080 t _SHA256_Update
                 U __stack_chk_fail

./libxcrypt-4.4.36/lib/.libs/libcrypt_la-crypt-bcrypt.o:
                 U bcmp
00000000000010f0 r BF_atoi64
0000000000000680 t BF_crypt
0000000000002310 t BF_decode
0000000000002400 t BF_encode
0000000000000020 t BF_full_crypt
0000000000000000 r BF_full_crypt.test_key
0000000000000000 r BF_full_crypt.test_setting_init
00000000000002e0 t BF_gensalt
000000000000007c r BF_init_state
0000000000000020 r BF_itoa64
00000000000010d0 r BF_magic_w
0000000000002170 t BF_set_key
0000000000000600 T _crypt_crypt_bcrypt_a_rn
0000000000000000 T _crypt_crypt_bcrypt_rn
0000000000000640 T _crypt_crypt_bcrypt_y_rn
0000000000000620 T _crypt_gensalt_bcrypt_a_rn
00000000000002c0 T _crypt_gensalt_bcrypt_rn
0000000000000660 T _crypt_gensalt_bcrypt_y_rn
                 U __errno_location
0000000000000060 r flags_by_subtype
0000000000000000 r .LCPI1_0
0000000000000000 r .L.str.2
                 U memcpy
000000000000000c r reltable.BF_full_crypt
                 U __stack_chk_fail

./libxcrypt-4.4.36/lib/.libs/libcrypt_la-alg-yescrypt-opt.o:
0000000000000e90 t alloc_region
                 U __assert_fail
0000000000002b00 t blockmix
00000000000030f0 t blockmix_salsa8
00000000000045e0 t blockmix_salsa8_xor
0000000000001f80 t blockmix_xor
0000000000003af0 t blockmix_xor_save
                 U _crypt_HMAC_SHA256_Buf
                 U _crypt_PBKDF2_SHA256
                 U _crypt_SHA256_Buf
0000000000000d90 T _crypt_yescrypt_digest_shared
0000000000000000 b _crypt_yescrypt_digest_shared.digest
0000000000000e50 T _crypt_yescrypt_free_local
0000000000000e00 T _crypt_yescrypt_free_shared
0000000000000e40 T _crypt_yescrypt_init_local
0000000000000a70 T _crypt_yescrypt_init_shared
0000000000000000 T _crypt_yescrypt_kdf
                 U __errno_location
                 U __explicit_bzero_chk
00000000000000d3 r .L__PRETTY_FUNCTION__.blockmix
0000000000000050 r .L__PRETTY_FUNCTION__.blockmix_xor
000000000000013a r .L__PRETTY_FUNCTION__.blockmix_xor_save
0000000000000000 r .L.str
0000000000000011 r .L.str.1
0000000000000022 r .L.str.2
000000000000002d r .L.str.3
0000000000000039 r .L.str.4
                 U memcpy
                 U mmap
                 U munmap
0000000000000f50 t smix
0000000000001350 t smix1
0000000000001a80 t smix2
                 U __stack_chk_fail
0000000000000250 t yescrypt_kdf_body

./libxcrypt-4.4.36/lib/gen-des-tables.o:
0000000000000000 r bits32
0000000000000000 r bits8
000000000000e000 b comp_maskl_
000000000000f000 b comp_maskr_
0000000000000300 r comp_perm
0000000000011200 b final_perm
0000000000008000 b fp_maskl_
000000000000a000 b fp_maskr_
                 U fwrite
0000000000011240 b init_perm
00000000000112c0 b inv_comp_perm
0000000000011280 b inv_key_perm
0000000000000280 r IP
0000000000004000 b ip_maskl_
0000000000006000 b ip_maskr_
00000000000002c0 r key_perm
000000000000c000 b key_perm_maskl_
000000000000d000 b key_perm_maskr_
0000000000000000 r .L.str
0000000000000007 r .L.str.1
0000000000000065 r .L.str.10
0000000000000086 r .L.str.11
000000000000008a r .L.str.12
000000000000008f r .L.str.13
0000000000000098 r .L.str.14
000000000000009e r .L.str.15
00000000000000a1 r .L.str.16
00000000000000c3 r .L.str.17
0000000000000010 r .L.str.2
0000000000000019 r .L.str.3
0000000000000022 r .L.str.4
000000000000002b r .L.str.5
000000000000003a r .L.str.6
0000000000000049 r .L.str.7
0000000000000054 r .L.str.8
000000000000005f r .L.str.9
0000000000000000 T main
0000000000000000 b m_sbox_
0000000000000000 r pbox
                 U __printf_chk
0000000000010000 b psbox_
                 U puts
0000000000000080 r sbox
                 U stdout
0000000000011300 b un_pbox
0000000000011000 b u_sbox
00000000000011b0 t write_table_u32
Click to expand libcrypt.map
/* Generated from libcrypt.map.in by gen-libcrypt-map.  DO NOT EDIT.  */
XCRYPT_2.0 {
  global:
    crypt;
    crypt_gensalt;
    crypt_gensalt_r;
    crypt_gensalt_ra;
    crypt_gensalt_rn;
    crypt_r;
    crypt_ra;
    crypt_rn;
    xcrypt;
    xcrypt_gensalt;
    xcrypt_gensalt_r;
    xcrypt_r;
  local:
    *;
};
XCRYPT_4.3 {
  global:
    crypt_checksalt;
} XCRYPT_2.0;
XCRYPT_4.4 {
  global:
    crypt_preferred_method;
} XCRYPT_4.3;

Can be reproduced if you have nix available (on x86_64-linux at least)

And reproducible on aarch64-linux as well. It's probably an issue regardless of CPU architecture.

I think this is really caused by a change in lld where --undefined-version is the default in v16+ and is an error in v17+ (more context here).


The five missing symbols appear to be for <=v3.1.1 compatiblility:

# Interfaces for code compatibility with libxcrypt v3.1.1 and earlier.
# No longer available to new binaries.
crypt_gensalt_r - XCRYPT_2.0
xcrypt - XCRYPT_2.0
xcrypt_r - XCRYPT_2.0
xcrypt_gensalt - XCRYPT_2.0
xcrypt_gensalt_r - XCRYPT_2.0

And they seem to only be "exported" if __REDIRECT_NTH is available:

/* For backward compatibility with older versions (v3.1.1 and earlier)
of libcrypt, this header declares xcrypt, xcrypt_r, xcrypt_gensalt,
and xcrypt_gensalt_r as alternative names for crypt, crypt_r,
crypt_gensalt, and crypt_gensalt_rn, respectively. If glibc's
<sys/cdefs.h> macro __REDIRECT_NTH (which declares an alternative
name at the object-file level) is available, we use it. */
#ifdef __REDIRECT_NTH
extern char * __REDIRECT_NTH (xcrypt, (const char *__phrase,
const char *__setting), crypt);
extern char * __REDIRECT_NTH (xcrypt_r, (const char *__phrase,
const char *__setting,
struct crypt_data *__restrict __data), crypt_r);
extern char * __REDIRECT_NTH (xcrypt_gensalt, (const char *__prefix,
unsigned long __count, const char *__rbytes,
int __nrbytes), crypt_gensalt);
extern char * __REDIRECT_NTH (xcrypt_gensalt_r, (const char *__prefix,
unsigned long __count, const char *__rbytes,
int __nrbytes, char *__output,
int __output_size), crypt_gensalt_rn);
#else
# define xcrypt crypt
# define xcrypt_r crypt_r
# define xcrypt_gensalt crypt_gensalt
# define xcrypt_gensalt_r crypt_gensalt_rn
#endif

Would it be possible to "gate" these symbols in the generated libcrypt.map accordingly?