Re: GMP 6.3.0: Failure building on MinGW (defaulting to ABI=64)

2023-12-11 Thread sisyphus
On Mon, Dec 11, 2023 at 7:40 PM Simon Sobisch  wrote:

> [snip]
> The question is still why the ABI 64 is chosen on this system. Any idea?
>

You might get some hints if you compare the config.log for this
(succeeding) build against the config.log for the (failing) build for which
no ABI argument was provided.

With mingw-w64 port of 32-bit gcc-13.2.0 on Windows 11 I find no need to
specify "ABI=32" when building gmp-6.3.0.

However, I did strike  the same issue as you've found when I built gmp on
Windows 7 using mingw-w64 port of 32-bit gcc-5.3.0.
That was a while ago, and I simply opted to specify the ABI, as you have
done.
I haven't tried to determine where the blame lay.

Cheers,
Rob
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


Re: GMP 6.3.0: Failure building on MinGW (defaulting to ABI=64)

2023-12-11 Thread Simon Sobisch



Am 10.12.2023 um 22:51 schrieb Marc Glisse:

On Sun, 10 Dec 2023, Simon Sobisch wrote:


$ ./config.guess && gcc --version && as --version


gcc -v file.c
gives more information about the assembler that is really used.


Thank you for the note, I'll use this next time.
On this specific machine there is only the old GNU assembler available, 
so it is quite sure that this was used.





gcc.exe (MinGW.org GCC Build-2) 9.2.0


gcc-9 is old.


Yes. I also run some GCC 4 on an old Linux kernel (also 32 bit) from 
time to time (but haven't checked GMP 6.3 there).


I did not found a note about the minimal GCC version to build GMP - is 
there a documentation about that? (I see no reason why GCC 9 should not 
work)



Isn't mingw.org abandoned? I thought everyone had moved to mingw-w64.org.


"partial"; osdn.net is down so the downloading does not work any more so 
you can only install from a mirror or a backup, but of course existing 
installations still work.


I _guess_ binaries from mingw-w64.org will need a "relative recent" 
version of the Windows operating system; "good old MinGW" still works 
fine with Windows XP (last time I've checked also with older versions); 
therefore using it to keep "legacy" environments up-to-date is still 
reasonable.
... and most other mingw binaries I've seen are much bigger than the 
ones originally distributed by mingw.org.





using ABI="64"
 CC="gcc"
 CFLAGS="-Wno-attribute"


Specifying CFLAGS yourself is not a great idea, it prevents GMP from 
adding nice optimization flags. If you really want to pass 
-Wno-attribute, either put it in CPPFLAGS, or run configure once without 
CFLAGS to see what GMP wants to use, and add -Wno-attribute to that.


Good point. I've moved it to CPFFLAGS:

  configure ABI=64 CPPFLAGS="-Wno-attributes -Wno-ignored-attributes"

The question is still why the ABI 64 is chosen on this system. Any idea?

This error seems to be related to changing the ABI after the initial 
configure. Using "make distclean" fixes this.


I therefore think that something like `AC_ARG_VAR([ABI], [Application 
Binary Interface to use])` (maybe also reference 
https://gmplib.org/manual/ABI-and-ISA in its description) should be 
added to configure.ac to make that error on an ABI change and also 
adding this missing piece to configure's help output.


You mean this?
https://gmplib.org/repo/gmp-6.3/file/tip/configure.ac#l455

I think it has been there for a while.


Yes, exactly this. And executing
   ../configure --help | grep ABI
I also see the help output.

But somehow the documented result [1] of being precious

> The value of variable when configure was launched is saved in the
> cache, including if it was not specified on the command line but via
> the environment.
> variable is checked for consistency between two configure runs

did not trigger: first not specifying [and leading to ABI=64], then 
specifying as ABI=32, did neither resulting in a configure error nor did 
it reused the old value.


Simon

[1]: 
https://www.gnu.org/software/autoconf/manual/autoconf-2.64/html_node/Setting-Output-Variables.html

___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs