Re: gmp 6.2.0 test failures on sparc64-solaris10

2020-06-14 Thread Marc Glisse

On Sat, 13 Jun 2020, Bruno Haible wrote:


* The ‘configure’ options you used when building GMP, if any.

No options, just './configure'.
The environment variable CC is set to 'cc -xarch=v9', as recommended in
https://gmplib.org/manual/ABI-and-ISA .


?
The manual says to set ABI to 64. configure itself then takes care of 
adding -xarch=v9 as it sees fit.



$ cc -V
cc: Sun C 5.8 Patch 121015-07 2009/04/22
usage: cc [ options] files.  Use 'cc -flags' for details


Not the most interesting compiler to support. Maybe the newest version 
would make sense. But the whole product has been discontinued, they are 
only providing a few patches to paying customers to respect the service 
contracts.



* The output from running ‘uname -a’.

SunOS *** 5.10 Generic_150400-17 sun4v sparc SUNW,SPARC-Enterprise-T5220


Solaris 10 is EOL, it only has a few years of extended support left, and 
that's normally for people who cannot upgrade anything, in particular not 
people who compile new versions of GMP.



$ ./config.guess
./config.guess: syntax error at line 284: `(' unexpected

$ ./configfsf.guess
-bash: ./configfsf.guess: Permission denied


bash ./config.guess
bash ./configfsf.guess

(maybe we should add execute permission to configfsf.guess)

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


Re: gmp 6.2.0 build failure in 32-bit mode on Linux/mips

2020-06-14 Thread Niels Möller
Bruno Haible  writes:

> I've read the first 10 lines of that chapter again, and I cannot see the
> solution of the adventure game through which you want to chase me.

Please set "ABI" on the configure command line. Adding ABI-changing
flags to CC causes confusion (even if it works fine with other packages,
and possibly for gmp too *if* configured with --disable-assembly). Don't
do that.

The relation between C and asm files is a bit intricate, and you have to
either leave ABI choice completely to configure, or tell it in the
documented way what you want.

Regards,
/Niels

-- 
Niels Möller. PGP-encrypted email is preferred. Keyid 368C6677.
Internet email is subject to wholesale government surveillance.
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


[SOLVED] gmp 6.2.0 build failure in 32-bit mode on Linux/mips

2020-06-14 Thread Bruno Haible
I wrote:
> tmp-add_n.s: Assembler messages:
> tmp-add_n.s:54: Warning: macro instruction expanded into multiple instructions
> tmp-add_n.s:55: Warning: macro instruction expanded into multiple instructions
> tmp-add_n.s:57: Error: opcode not supported on this processor: mips2 (mips2) 
> `daddiu $7,$7,-1'
> tmp-add_n.s:62: Error: opcode not supported on this processor: mips2 (mips2) 
> `dsubu $7,$7,$9'

Passing the option '--disable-assembly' solved the problem.

Bruno

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


Re: gmp 6.2.0 test failures on sparc64-solaris10

2020-06-14 Thread Bruno Haible
Marc Glisse wrote:
> > * The ‘configure’ options you used when building GMP, if any.
> >
> > No options, just './configure'.
> > The environment variable CC is set to 'cc -xarch=v9', as recommended in
> > https://gmplib.org/manual/ABI-and-ISA .
> 
> ?
> The manual says to set ABI to 64.

No, it doesn't say that I *must* set ABI.

In https://gmplib.org/manual/Build-Options it says
  "By default GMP chooses the best ABI available, but a particular ABI can be
   selected."

In https://gmplib.org/manual/ABI-and-ISA it says
  "By default GMP chooses the best ABI available for a given system, and this
   generally gives significantly greater speed. But an ABI can be chosen
   explicitly..."

This is good. For consistency with other GNU packages, which accept CC,
CFLAGS, CPPFLAGS, and LDFLAGS variables at configure time [1] and deduce
as much configuration details from these.

I've built gmp-6.2.0 on many platforms, and on most of them setting ABI
was not necessary, if I set CC appropriately like I do for the other GNU
packages.

[1] 
https://www.gnu.org/software/automake/manual/html_node/Standard-Configuration-Variables.html

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


Re: gmp 6.2.0 build failure in 32-bit mode on Linux/mips

2020-06-14 Thread Bruno Haible
Niels Möller wrote:
> Please set "ABI" on the configure command line.

The manual https://gmplib.org/manual/ABI-and-ISA does not list any allowed
values for ABI on Linux/mips.

> Adding ABI-changing
> flags to CC causes confusion (even if it works fine with other packages,
> and possibly for gmp too *if* configured with --disable-assembly). Don't
> do that.

It is possible to determine the ABI from the $CC $CFLAGS variables [1].
For the distinction between the 3 ABIs on MIPS, two tests are needed at
configure time (works also when cross-compiling):

  #if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)  => then it's ABI=64
  #else
#if (_MIPS_SIM == _ABIN32)  => then it's ABI=n32
#else   => then it's ABI=32

If you were to put this logic into the GMP configure, GMP would determine
the correct ABI to use in one more case. (It already does so in many cases.)

Bruno

[1] 
https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=m4/host-cpu-c-abi.m4

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


Re: gmp 6.2.0 build failure in 32-bit mode on Linux/mips

2020-06-14 Thread Torbjörn Granlund
Bruno Haible  writes:

  No options, just './configure'.
  The environment variable CC is set to 'cc -xarch=v9', as recommended in
  https://gmplib.org/manual/ABI-and-ISA .

No, the manual certainly does NOT recommended that.

  No, it doesn't say that I *must* set ABI.

Er?  I think the documentation is extremely clear on that point.  It
builds for one ABI (determined to be the "best").  Are you saying that
we should add "if you want a different ABI, GMP will not be able to
deduce that from your attitude or wishes, but you MUST set ABI."

  The manual https://gmplib.org/manual/ABI-and-ISA does not list any allowed
  values for ABI on Linux/mips.

Or for many other systems.  So?  Use your deductive ability instead of
trying your best to fail.

Or are you trying to tell me, that you, Bruno Haible, is not able to
make an educated guess about what ABIs might be available for GNU/Linux
from the information you see about IRIX?

(Sure, we could list more systems there (and purge a few obsolete ones.)

You may not like how the GMP build system works, but lobbying for us to
rewrite it by trying you best to fail might not be the wisest strategy.

  Passing the option '--disable-assembly' solved the problem.

That's just silly and does not prove your point.


-- 
Torbjörn
Please encrypt, key id 0xC8601622
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs


building in 32-bit mode on Linux/s390x produces 64-bit mode binaries

2020-06-14 Thread Bruno Haible
Hi,

On a Linux/s390x machine, a build of gmp-6.2.0, configured in the same way
as dozens of other GNU packages to build 32-bit mode binaries, in fact
produces 64-bit mode binaries.

* The GMP version number, and if pre-packaged or patched then say so.

6.2.0, unmodified, from the source tarball on ftp.gnu.org.

* A test program that makes it possible for us to reproduce the bug. Include 
instructions on how to run the program.

Build through
  $ ../configure --prefix=$HOME/prefix32 CC="gcc -m31"
  $ make
  $ make install
  $ cd $HOME/prefix32/lib; file libgmp.so.*.*

* A description of what is wrong. If the results are incorrect, in what way. If 
you get a crash, say so.

  $ cd $HOME/prefix32/lib; file libgmp.so.*.*
  libgmp.so.10.4.0: ELF 64-bit MSB shared object, IBM S/390, version 1 (SYSV), 
dynamically linked, BuildID[sha1]=c3065c005af6fe702a681b8c1c936b8e37266d08, not 
stripped

The expectation (from
https://www.gnu.org/software/automake/manual/html_node/Standard-Configuration-Variables.html)
is that the $CC variable gets used and therefore the result is a binary
in 31/32-bit mode (arch = s390).

* If you get a crash, include a stack backtrace from the debugger if it’s 
informative (‘where’ in gdb, or ‘$C’ in adb).

n/a

* Please do not send core dumps, executables or straces.

n/a

* The ‘configure’ options you used when building GMP, if any.

CC="gcc -m31"
export CC
../configure --prefix=$HOME/prefix32 CPPFLAGS="-I$HOME/prefix32/include -Wall" 
LDFLAGS=-L$HOME/prefix32/lib

I did not pass an ABI option, since no such value is documented for Linux/s390x
in https://gmplib.org/manual/ABI-and-ISA .

Don't ask me to guess:
  1. Experience tells that it's a bad idea to rely on undocumented internals
 of a package.
  2. It's not even clear what the possible values would be: ABI=s390 ? ABI=31 ?
 ABI=32 ?

* The output from ‘configure’, as printed to stdout, with any options used.

Attached: file 'log1'.

* The name of the compiler and its version. For gcc, get the version with ‘gcc 
-v’, otherwise perhaps ‘what `which cc`’, or similar.

$ $CC -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/s390x-linux-gnu/4.9/lto-wrapper
Target: s390x-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.9.2-10' 
--with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs 
--enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr 
--program-suffix=-4.9 --enable-shared --enable-linker-build-id 
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix 
--with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls 
--with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug 
--enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libitm 
--disable-libsanitizer --disable-libquadmath --enable-plugin --with-system-zlib 
--disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo 
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-s390x/jre --enable-java-home 
--with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-s390x 
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-s390x 
--with-arch-directory=s390x --with-ecj-jar=/usr/share/java/eclipse-ecj.jar 
--enable-objc-gc --enable-multiarch --with-long-double-128 --enable-multilib 
--enable-checking=release --build=s390x-linux-gnu --host=s390x-linux-gnu 
--target=s390x-linux-gnu
Thread model: posix
gcc version 4.9.2 (Debian 4.9.2-10) 

* The output from running ‘uname -a’.

Linux  3.16.0-4-s390x #1 SMP Debian 3.16.36-1+deb8u2 (2016-10-19) s390x 
GNU/Linux

(*** hidden for privacy reasons)

* The output from running ‘./config.guess’, and from running 
‘./configfsf.guess’ (might be the same).

$ ./config.guess
z196-ibm-linux-gnu

$ ./configfsf.guess
-bash: ./configfsf.guess: Permission denied

$ sh ./configfsf.guess
s390x-ibm-linux-gnu

* If the bug is related to ‘configure’, then the compressed contents of 
config.log.

Attached. Hostname hidden for privacy reasons.

* If the bug is related to an asm file not assembling, then the contents of 
config.m4 and the offending line or lines from the temporary mpn/tmp-.s. 

n/a

checking build system type... z196-ibm-linux-gnu
checking host system type... z196-ibm-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking ABI=64
checking compiler gcc -m31 -O2 -pedantic -fomit-frame-pointer -m64 
-I/home/bruno/prefix32/include -Wall... yes
checking compiler gcc -m31 -O2 -pedantic -fomit-frame-pointer -m64 
-I/home/bruno/prefix32/include -Wall -march=z196... yes
checking for gcc... gcc -m31
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suff

Re: building in 32-bit mode on Linux/s390x produces 64-bit mode binaries

2020-06-14 Thread Torbjörn Granlund
Bruno Haible  writes:

  On a Linux/s390x machine, a build of gmp-6.2.0, configured in the same way
  as dozens of other GNU packages to build 32-bit mode binaries, in fact
  produces 64-bit mode binaries.

  * The GMP version number, and if pre-packaged or patched then say so.

  6.2.0, unmodified, from the source tarball on ftp.gnu.org.

  * A test program that makes it possible for us to reproduce the bug. Include 
instructions on how to run the program.

  Build through
$ ../configure --prefix=$HOME/prefix32 CC="gcc -m31"
$ make
$ make install
$ cd $HOME/prefix32/lib; file libgmp.so.*.*

Please ignore this "bug report".  GMP works as intended and as
documented.

Mr Haible is on a crusade against how GMP handles ABI selection.

-- 
Torbjörn
Please encrypt, key id 0xC8601622
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs