Aw: Re: gmp-6.1.2, acinclude.m4, configure

Ralf Gerhauser Ralf.Gerhauser at gmx.de
Wed Apr 17 12:37:53 UTC 2019


Thanks for your reply.

> A snapshot from more than a year ago might not be an ideal place to
> look,
>
Well, I first looked at https://github.com/Cl3Kener/gmp but this source
states "Latest commit 5645786 on Apr 10, 2016", so gmp-6.1.99-20180106
looked more recent.  Later I found https://gmplib.org/repo/gmp-6.1/
which is the real repository - sorry for the confusion.

> but if you're saying that the snapshot is fine and 6.1.2 is not,
> it seems that the issue at hand has been solved.  Right?
>
Not really.  Current "acinclude.m4" still uses calloc() and a
step width of 23 for GMP_PROG_CC_WORKS_PART_MAIN.

As stated in my original mail, this seems not to work because:

(1) When using 23 instead of 22 (22 was used in older releases) the
loop terminates before reaching offset 2048 (0x800), leaving the
buffer unmodified at this location.

(2) As far as I understand, the test criteria checks 2048..2054 if it
has been changed *to zero*.  With calloc() the buffer is initially zero,
so the test never calls abort() regardless of the behaviour of lshift_com().
Therefore I think, the buffer must be initialized with non-zero values,
e.g. 0x3F.

With 6.1.2 the effect is different because malloc() was used, leaving
memory uninitialized.  So it just depends on the initial state of memory.
I observed SuSE Linux 42.3 to have heap memory set to 0xBABABABA, so
configure fails on this platform.  With Lubuntu 18.04 memory was zero
and GMP_PROG_CC_WORKS_PART_MAIN passed.

Best regards,

Ralf Gerhauser




> Gesendet: Mittwoch, 17. April 2019 um 11:42 Uhr
> Von: "Torbjörn Granlund" <tg at gmplib.org>
> An: "Ralf Gerhauser" <Ralf.Gerhauser at gmx.de>
> Cc: gmp-bugs at gmplib.org
> Betreff: Re: gmp-6.1.2, acinclude.m4, configure
>
> "Ralf Gerhauser" <Ralf.Gerhauser at gmx.de> writes:
> 
>   checking whether make supports nested variables... yes
>   checking whether to enable maintainer-specific portions of Makefiles... no
>   checking ABI=64
>   checking compiler gcc -O2
>   -I/home/rage/Development/OpenWrt/openwrt/staging_dir/host/include
>   -I/home/rage/Development/OpenWrt/openwrt/staging_dir/host/include
>   ... no, mpn_lshift_com optimization 2, program does not run
>   checking ABI=x32
>   checking compiler gcc -O2
>   -I/home/rage/Development/OpenWrt/openwrt/staging_dir/host/include
>   -I/home/rage/Development/OpenWrt/openwrt/staging_dir/host/include
>   ... no, mpn_lshift_com optimization 2, program does not run
>   checking ABI=32
>   checking compiler gcc -O2
>   -I/home/rage/Development/OpenWrt/openwrt/staging_dir/host/include
>   -I/home/rage/Development/OpenWrt/openwrt/staging_dir/host/include
>   ... no, mpn_lshift_com optimization 2, program does not run
>   configure: error: could not find a working compiler, see config.log for details
> 
> You seems to have passed--explicitly or via environment variables--a
> non-working compiler to GMP's configure.  Make sure to get a good
> configure run by cleaning up that (i.e., plain "configure" without
> overriding any variables, and first unsetting any CC, CFLAGS, etc,
> variables).
> 
> Then work from there.
> 
>   My second try was to compile it on a Lubuntu 18.04 system.  It did, without any problems.
>   Next I checked the compiler versions: gcc-4.8 on my SuSE system, gcc-7 on the Lubuntu system.
>   I installed gcc-7 on SuSE - gmp-6.1.2 still failed in the same manner.
> 
> Are you saying that two compilers on one system make GMP configure fail?
> My advice a few lines above should help!
> 
>   Next I found and downloaded the file "snapshot" from ftp://gmplib.org/pub/ which unpacks as
>   version gmp-6.1.99-20180106. I tried to compile this on SuSE, and it worked either.
> 
> I don't understand that sentence.  Did it work or did it not work?
> 
> A snapshot from more than a year ago might not be an ideal place to
> look, but if you're saying that the snapshot is fine and 6.1.2 is not,
> it seems that the issue at hand has been solved.  Right?
> 
> 
> -- 
> Torbjörn
> Please encrypt, key id 0xC8601622
>


More information about the gmp-bugs mailing list