Gmp linking problems
Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=150
Reported by @grubba
From: Niels Möller <email@example.com> To: firstname.lastname@example.org Date: 29 Aug 2000 23:07:56 +0200 Subject: Linking problem with Pike-7.0.36
I there's a bug in the Gmp module in Pike-7.0.36. Its definition of __MPN in src/modules/Gmp/my_gmp.h is bogus, and doesn't work at all with gmp-3.x.
I just had a look at Pike-7.0.78 as well. The definition is still present, although the code tries to avoid using mpn_popcount (and uses mpz_popcount instead if that function exists).
Anyway, the symptoms are a runtime link arror as soon as popcount is used; the Gmp.so has a reference to __mpn_popcount, while the symbol name in the library is __gmpn_popcount (from gmp-3.x).
Furthermore, the behavior of popcount(x) when x < 0 seems not to be well defined. In pike-7.0.36 it is an error, while in pike-7.0.78 it returns -1 or UMAX_LONG casted to a pike integer.