I need to compile an old version of GCC and it requires also old version of several libs.
One of them is gmp-4.2.
When trying to build gmp 4.2, ./configure is performed without errors, but make is terminated with hundreds of duplicite symbols, follows just a beginning fragment:
/usr/bin/ld: .libs/compat.o: in function `__gmpz_abs':
compat.c:(.text+0x0): multiple definition of `__gmpz_abs'; .libs/assert.o:assert.c:(.text+0x0): first defined here
/usr/bin/ld: .libs/compat.o: in function `__gmpz_fits_uint_p':
compat.c:(.text+0x20): multiple definition of `__gmpz_fits_uint_p'; .libs/assert.o:assert.c:(.text+0x20): first defined here
/usr/bin/ld: .libs/compat.o: in function `__gmpz_fits_ulong_p':
compat.c:(.text+0x60): multiple definition of `__gmpz_fits_ulong_p'; .libs/assert.o:assert.c:(.text+0x60): first defined here
/usr/bin/ld: .libs/compat.o: in function `__gmpz_fits_ushort_p':
compat.c:(.text+0x80): multiple definition of `__gmpz_fits_ushort_p'; .libs/assert.o:assert.c:(.text+0x80): first defined here
/usr/bin/ld: .libs/compat.o: in function `__gmpz_get_ui':
compat.c:(.text+0xc0): multiple definition of `__gmpz_get_ui'; .libs/assert.o:assert.c:(.text+0xc0): first defined here
/usr/bin/ld: .libs/compat.o: in function `__gmpz_getlimbn':
compat.c:(.text+0xe0): multiple definition of `__gmpz_getlimbn'; .libs/assert.o:assert.c:(.text+0xe0): first defined here
/usr/bin/ld: .libs/compat.o: in function `__gmpz_neg':
compat.c:(.text+0x110): multiple definition of `__gmpz_neg'; .libs/assert.o:assert.c:(.text+0x110): first defined here
/usr/bin/ld: .libs/compat.o: in function `__gmpz_perfect_square_p':
compat.c:(.text+0x130): multiple definition of `__gmpz_perfect_square_p'; .libs/assert.o:assert.c:(.text+0x130): first defined here
/usr/bin/ld: .libs/compat.o: in function `__gmpz_popcount':
Why gmp-4.2 can't be compiled? I expect any official release of so essential part of GNU platform must work without any issues - how was the lib compiled by Linux distros maintainers? What could be wrong and how to solve it? What is purpose of assert.o which obviously causes the failure? Google hasn't found any useful information as well as AI chatbots.