lots of "undefined reference" from /bin/ld under Debian

Vincent Lefevre vincent at vinc17.net
Fri Feb 23 17:11:55 CET 2024


On a Debian/unstable x86_64 (amd64) machine, I've configured
GMP 18465:7ecb3b2beea1 with

  ./configure --prefix=$HOME/opt/gmp-devel

but "make check" fails with:

/bin/ld: t-bswap.o: in function `main':
t-bswap.c:(.text.startup+0x29): undefined reference to `__gmpn_random'
/bin/ld: ./.libs/libtests.a(refmpn.o): in function `refmpn_sublsh_n':
refmpn.c:(.text+0x2614): undefined reference to `__gmpn_lshift'
/bin/ld: refmpn.c:(.text+0x2628): undefined reference to `__gmpn_sub_n'
/bin/ld: ./.libs/libtests.a(refmpn.o): in function `refmpn_rsblsh_n':
refmpn.c:(.text+0x2864): undefined reference to `__gmpn_lshift'
/bin/ld: refmpn.c:(.text+0x2878): undefined reference to `__gmpn_sub_n'
/bin/ld: ./.libs/libtests.a(refmpn.o): in function `refmpn_rsh1add_n':
refmpn.c:(.text+0x2a11): undefined reference to `__gmpn_add_n'
/bin/ld: refmpn.c:(.text+0x2a27): undefined reference to `__gmpn_rshift'
/bin/ld: ./.libs/libtests.a(refmpn.o): in function `refmpn_rsh1sub_n':
refmpn.c:(.text+0x2ab1): undefined reference to `__gmpn_sub_n'
/bin/ld: refmpn.c:(.text+0x2ac7): undefined reference to `__gmpn_rshift'
/bin/ld: ./.libs/libtests.a(refmpn.o): in function `refmpn_redc_1':
refmpn.c:(.text+0x5e26): undefined reference to `__gmpn_add_n'
/bin/ld: ./.libs/libtests.a(refmpn.o): in function `refmpn_random':
refmpn.c:(.text+0x6111): undefined reference to `__gmpn_random'
/bin/ld: ./.libs/libtests.a(refmpn.o): in function `refmpn_random2':
refmpn.c:(.text+0x6121): undefined reference to `__gmpn_random2'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_tdiv_qr'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_gcd_1'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_cnd_sub_n'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_set_str'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_sqr_basecase'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_divrem_2'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_perfect_power_p'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_mod_1_1p'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_com'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_rootrem'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_div_q'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_mul_basecase'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_gcdext'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_cnd_swap'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_mod_1s_4p_cps'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_scan0'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_preinv_mod_1'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmp_jacobi_table'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_sub_nc'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_divexact_1'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_toom_interpolate_8pts'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_modexact_1c_odd'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_toom_interpolate_7pts'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_sqr'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_toom_interpolate_6pts'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_div_qr_2n_pi1'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_mul_n'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_submul_1'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_sqrlo'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_toom_interpolate_5pts'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_get_str'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_mod_1_1p_cps'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_gcd'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_mod_1s_2p_cps'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_mul'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_divrem_1'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_popcount'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_modexact_1_odd'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_hamdist'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_mod_1s_2p'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_add_nc'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_jacobi_n'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_mullo_n'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_div_qr_2u_pi1'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_mod_34lsub1'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_fib2m'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_invertappr'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_fib2_ui'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_scan1'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_lshiftc'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_divisible_p'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_divrem'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_sqrtrem'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_addmul_1'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_mod_1s_4p'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_mul_1'
/bin/ld: /home/vlefevre/software/gmp/.libs/libgmp.so: undefined reference to `__gmpn_cnd_add_n'
collect2: error: ld returned 1 exit status

Note: this is not specific to "make check". If I do "make install" and
try to compile/link my own simple program, I get the same errors.

-- 
Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


More information about the gmp-bugs mailing list