Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[partialy SOLVED] gnat-gpl and gnat-gcc fail on CPU flag
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
vesperto
n00b
n00b


Joined: 21 May 2015
Posts: 34

PostPosted: Thu Mar 03, 2016 3:20 pm    Post subject: [partialy SOLVED] gnat-gpl and gnat-gcc fail on CPU flag Reply with quote

Hi,

I'm trying to install an Ada compiler and they both fail on the same reason, namely:

Code:
configure:4278: error: in `/var/tmp/portage/dev-lang/gnat-gcc-4.6.4/work/build':
configure:4282: error: C compiler cannot create executables
See `config.log' for more details.


Which has
Code:
configure:4231: /var/tmp/portage/dev-lang/gnat-gcc-4.6.4/work/usr/bin/gnatgcc -march=corei7-avx -O2 -pipe  -L/var/tmp/portage/dev-lang/gnat-gcc-4.6.4/work/usr/lib conftest.c  >&5
conftest.c:1: error: bad value (corei7-avx) for -march= switch
conftest.c:1: error: bad value (corei7-avx) for -mtune= switch


Looking at the wiki, i'm using
Code:
CFLAGS="-march=corei7-avx -O2 -pipe"

with this CPU:
Code:
$ grep -m1 -A3 "vendor_id" /proc/cpuinfo
vendor_id   : GenuineIntel
cpu family   : 6
model      : 42
model name   : Intel(R) Core(TM) i5-2520M CPU @ 2.50GHz

and haven't had an issue over it yet, until now.

Is this the correct flag? If not, can i use something like
Code:
CFLAGS="-march=native" emerge ...


I've seen other threads where a file is missing or the bootstrap flag is needed on SPARC, but the ones mentioning CFLAGS have no solutions.
_________________
I moved to Gentoo in search of choice in the Linux ecosystem... found it!


Last edited by vesperto on Sat Mar 05, 2016 1:19 am; edited 1 time in total
Back to top
View user's profile Send private message
vesperto
n00b
n00b


Joined: 21 May 2015
Posts: 34

PostPosted: Fri Mar 04, 2016 11:25 pm    Post subject: Reply with quote

Incidentally, i managed to compile dev-lang/gnat-gcc-4.6.4:4.6 in another system with a Phenom II X4, using
Code:
CFLAGS="-march=amdfam10 ..."


So, is my i5 flag correct?
_________________
I moved to Gentoo in search of choice in the Linux ecosystem... found it!
Back to top
View user's profile Send private message
vesperto
n00b
n00b


Joined: 21 May 2015
Posts: 34

PostPosted: Sat Mar 05, 2016 1:19 am    Post subject: Reply with quote

It seems this isn't new, there are other forum threads ([01], [02], [03]) and bug reports (212105, 231769, 251489, 266306, 371983) on this.

Due to however gnat is build, the CFLAGS in make.conf can cause trouble, these are mine:
Code:
CFLAGS="-march=corei7-avx -O2 -pipe"

The "offending" bit is -march, which can confuse gcc in this specific scenario (a chicken-and-egg thing regarding bootstrap-compiling). Since i didn't want to change my flags, as i feel that kind of defeats the purpose of using gentoo, i emerged with:
Code:
CFLAGS="-O2 -pipe" emerge --ask dev-lang/gnat-gcc

(i.e. removing the offending compiler option) and it worked. Well, the paths are are messy and i haven't gotten a Hello World yet but the compiler's there and it's complaining.

What did not work was compiling dev-lang/gnat-gpl. While it didn't die on the CFLAGS issue, it just died way down the line. And so i created bug 576482 :D

If someone could pin one of these topics or a clear and detailed solution or perhaps update the wki... that would be nifty...
_________________
I moved to Gentoo in search of choice in the Linux ecosystem... found it!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum