Re: GMP 6.1.2: 32-bit ARM build failure on 64-bit hardware with CFLAGS=-g

2018-01-24 Thread Hans Åberg


> On 24 Jan 2018, at 18:09, Torbjörn Granlund  wrote:
> 
> If you override flags for choosing the architecture level and/or ABI,
> you cannot expect things to work.
> 
>  If so, is there another easy with debug info, without knowing in
>  advance what compiler flags configure would have autodetected?
> 
> Cut and paste?

Automake adds the CXXFLAGS after the AM_CXXFLAGS. So if one in the Makefile.am 
sets
  AM_CXXFLAGS = -std=c++14
then
  ..//configure CXXFLAGS=-std=c++17
gives "-std=c++14 -std=c++17" to the compiler. Then GCC chooses the last one in 
the sequence, so in this case, it is "-std=c++17" that is used, and the compile 
is for C++17.

This way, one can make different builds in parallel directories. It depends 
though on the compiler, and what is does for each setting.


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


Re: GMP 6.1.2: 32-bit ARM build failure on 64-bit hardware with CFLAGS=-g

2018-01-24 Thread Niels Möller
t...@gmplib.org (Torbjörn Granlund) writes:

>   If so, is there another easy with debug info, without knowing in
>   advance what compiler flags configure would have autodetected?
>   
> Cut and paste?

That's what I usually do. Setting CFLAGS really means "I know this
better than configure", and then configure obeys without questioning.
One could have some user option EXTRA_CFLAGS or the like but I'm not
sure that's really worth the effort.

It might also work to set CC='gcc -g', but I haven't tested.

As for -g, I'm not sure why it is disabled by default in gmp builds. I
think GNU standard is to enable -g by default when building with gcc
(which has always had reasonable support for generating useful debug
info also when optimizing).

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


Re: GMP 6.1.2: 32-bit ARM build failure on 64-bit hardware with CFLAGS=-g

2018-01-24 Thread Jay Foad
On 24 January 2018 at 16:55, Marc Glisse  wrote:

> On Wed, 24 Jan 2018, Jay Foad wrote:
>
> I'm trying to build GMP 6.1.2 on a Raspberry Pi 3 Model B (64-bit ARM CPU)
>> running a 32-bit Debian 8 OS. I get:
>>
>> $ ./configure CFLAGS=-g ABI=32 && make
>>
>
> [...]
>
> If I remove the "CFLAGS=-g" the error goes away.
>>
>
> What CFLAGS does GMP use if you don't override its detection?


$ grep ^CFLAGS Makefile
CFLAGS = -O2 -pedantic -fomit-frame-pointer -march=armv8-a -mfloat-abi=hard
-mfpu=neon -mtune=cortex-a53

Is it up to me to include all that in the CFLAGS that I specify? If so, is
there another easy with debug info, without knowing in advance what
compiler flags configure would have autodetected?

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


Re: GMP 6.1.2: 32-bit ARM build failure on 64-bit hardware with CFLAGS=-g

2018-01-24 Thread Torbjörn Granlund
  > What CFLAGS does GMP use if you don't override its detection?
  
  
  $ grep ^CFLAGS Makefile
  CFLAGS = -O2 -pedantic -fomit-frame-pointer -march=armv8-a -mfloat-abi=hard
  -mfpu=neon -mtune=cortex-a53
  
  Is it up to me to include all that in the CFLAGS that I specify?

If you override flags for choosing the architecture level and/or ABI,
you cannot expect things to work.

  If so, is there another easy with debug info, without knowing in
  advance what compiler flags configure would have autodetected?
  
Cut and paste?

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


Re: GMP 6.1.2: 32-bit ARM build failure on 64-bit hardware with CFLAGS=-g

2018-01-24 Thread Marc Glisse

On Wed, 24 Jan 2018, Jay Foad wrote:


I'm trying to build GMP 6.1.2 on a Raspberry Pi 3 Model B (64-bit ARM CPU)
running a 32-bit Debian 8 OS. I get:

$ ./configure CFLAGS=-g ABI=32 && make


[...]


If I remove the "CFLAGS=-g" the error goes away.


What CFLAGS does GMP use if you don't override its detection?

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


GMP 6.1.2: 32-bit ARM build failure on 64-bit hardware with CFLAGS=-g

2018-01-24 Thread Jay Foad
Hi,

I'm trying to build GMP 6.1.2 on a Raspberry Pi 3 Model B (64-bit ARM CPU)
running a 32-bit Debian 8 OS. I get:


$ ./configure CFLAGS=-g ABI=32 && make
[...]
make: Entering directory '/home/pi/jay/gmp-6.1.2/mpn'
/bin/bash ../libtool --mode=compile --tag=CC ../mpn/m4-ccas --m4="m4" gcc
-std=gnu99 -c -DHAVE_CONFIG_H -I. -I..  -D__GMP_WITHIN_GMP -I..
-DOPERATION_`echo lshift | sed 's/_$//'`   -g -Wa,--noexecstack `test -f
'lshift.asm' || echo './'`lshift.asm
libtool: compile:  ../mpn/m4-ccas --m4=m4 gcc -std=gnu99 -c -DHAVE_CONFIG_H
-I. -I.. -D__GMP_WITHIN_GMP -I.. -DOPERATION_lshift -g -Wa,--noexecstack
lshift.asm  -fPIC -DPIC -o .libs/lshift.o
m4  -DHAVE_CONFIG_H -D__GMP_WITHIN_GMP -DOPERATION_lshift -DPIC lshift.asm
>tmp-lshift.s
 gcc -std=gnu99 -c -DHAVE_CONFIG_H -I. -I.. -D__GMP_WITHIN_GMP -I..
-DOPERATION_lshift -g -Wa,--noexecstack tmp-lshift.s -fPIC -DPIC -o
.libs/lshift.o
tmp-lshift.s: Assembler messages:
tmp-lshift.s:106: Error: selected processor does not support ARM mode
`vdup.32 d6,r3'
tmp-lshift.s:108: Error: selected processor does not support ARM mode
`vdup.32 d7,r3'
tmp-lshift.s:113: Error: selected processor does not support ARM mode
`vld1.32 {d19},[r1],r12'
[...]
tmp-lshift.s:203: Error: selected processor does not support ARM mode `vorr
d2,d4,d1'
tmp-lshift.s:204: Error: selected processor does not support ARM mode
`vst1.32 {d2},[r0:64],r12'
tmp-lshift.s:205: Error: selected processor does not support ARM mode
`vst1.32 {d16},[r0]'
Makefile:768: recipe for target 'lshift.lo' failed
make: *** [lshift.lo] Error 1
make: Leaving directory '/home/pi/jay/gmp-6.1.2/mpn'


If I remove the "CFLAGS=-g" the error goes away. I also didn't get the
error when I tried a similar build on 32-bit hardware (a Raspberry Pi Model
B Rev 2).

More info:

$ gcc --version
gcc (Raspbian 4.9.2-10) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ uname -a
Linux dyapi04 4.9.35-v7+ #1014 SMP Fri Jun 30 14:47:43 BST 2017 armv7l
GNU/Linux
$ ./config.guess
armcortexa53neon-unknown-linux-gnueabihf
$ sh ./configfsf.guess
armv7l-unknown-linux-gnueabihf

I've attached the full output of a failing configure/make in "bad.log", and
some other files that might be relevant.

Thanks,
Jay.


pi.tar.gz
Description: GNU Zip compressed data
___
gmp-bugs mailing list
gmp-bugs@gmplib.org
https://gmplib.org/mailman/listinfo/gmp-bugs