Hi,
I'm compiling nettle for the Arch Linux multilib repository (32bit libraries for a 64bit system so people can run skype and wine without needing a chroot). Looks like the new ecc code doesn't properly handle integer type sizes.
Here[1] is the output of make, make check along with the PKGBUILD used to build this and a sample of the generated ecc-*.h files.
[1]: http://flo.server-speed.net/tmp/lib32-nettle/
Can I fix that by setting some env variable or does it need code changes?
If you need any more files, please tell me.
Florian Pritz bluewind@xinu.at writes:
Here[1] is the output of make, make check along with the PKGBUILD used to build this and a sample of the generated ecc-*.h files.
Not entirely sure what's happening, but I suspect something is wrong with your GMP installation. I take it you configure nettle with CC='gcc -m32'? Nettle's configure detects that you are building for the 32-bit ABI. But then the test
checking for GMP limb size... 64 bits
indicates that you are using a gmp.h for a 64-bit installation. Also the warning
ecc-mod.c:48:3: warning: left shift count >= width of type [enabled by default] if (bp[bn-1] < ((mp_limb_t) 1 << (GMP_NUMB_BITS - 1)))
indicates that the definitions of mp_limb_t and GMP_NUMB_BITS (both in gmp.h) are inconsistent. So you probably have a gmp.h with
typedef unsigned long mp_limb_t; #define GMP_LIMB_BITS 64 #define GMP_NUMB_BITS 64
which is typical for a 64-bit installation of GMP, but is bogus if unsigned long is only 32 bits.
Maybe you can fix it by setting CPPFLAGS (or passing the --with-include-path option to Nettle's configure) to point out a directory with a 32-bit installation of the gmp.h header file.
Regards, /Niels
On 27.04.2013 22:45, Niels Möller wrote:
indicates that you are using a gmp.h for a 64-bit installation. [..]
Maybe you can fix it by setting CPPFLAGS (or passing the --with-include-path option to Nettle's configure) to point out a directory with a 32-bit installation of the gmp.h header file.
Adding --with-include-path=/usr/lib32/gmp worked like a charm.
Thank you very much
nettle-bugs@lists.lysator.liu.se