classification
Title: Can't compile with -O3, on ARM, with gcc 3.4.4
Type: Stage:
Components: Build Versions: Python 3.2
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, loewis, metageek, skrah
Priority: normal Keywords:

Created on 2008-12-08 16:07 by metageek, last changed 2010-08-21 23:17 by georg.brandl. This issue is now closed.

Messages (9)
msg77315 - (view) Author: John Stracke (metageek) Date: 2008-12-08 16:07
I downloaded the source to Python 3.0 onto my Nokia N810, an ARM-based
Linux machine.  The native gcc is 3.4.4 (upgrading might be possible,
but would certainly be a pain).  I was able to build only by switching
from -O3 to -O2; -O3 caused a compiler crash.

Now, this isn't really Python's fault; gcc really shouldn't be crashing.
 However, it'd be nice if configure had a way to specify the
optimization level--I had to go in and edit the generated Makefile by
hand.  Better yet would be if configure could recognize the platform and
set the -O level accordingly.
msg77357 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2008-12-08 22:40
> Now, this isn't really Python's fault; gcc really shouldn't be crashing.
>  However, it'd be nice if configure had a way to specify the
> optimization level--I had to go in and edit the generated Makefile by
> hand. 

Well, Python does have a way - the way you have been using.

However, as yet another way, you can set the OPT environment variable,
to define the optimization flags to be used (and other non-essential
compiler flags).

> Better yet would be if configure could recognize the platform and
> set the -O level accordingly.

I'm opposed. Selecting such a thing by platform and compiler version
is too transient to be maintainable. It would be different if the
platform would have been around for 10 years, and had seen no compiler
change for 8 years, but in this case, this likely is fixed before the
next Python release is even made. Please report this to the system
vendor.
msg77414 - (view) Author: John Stracke (metageek) Date: 2008-12-09 13:46
The OPT env var is good.  Maybe it could be documented in configure --help?

And, yeah, recognizing the platform is messy.  I'll dig and see whether
gcc3 does the same thing on x86, though; if so, some logic to say "use
-O2 for gcc <4" shouldn't be so bad.
msg77416 - (view) Author: John Stracke (metageek) Date: 2008-12-09 13:58
OK, nope, gcc 3.4.6 on x86-64 builds fine.  So, please, just have
configure --help mention OPT.
msg77460 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2008-12-09 22:10
> OK, nope, gcc 3.4.6 on x86-64 builds fine.  So, please, just have
> configure --help mention OPT.

Can you contribute a patch? I'm skeptical it whether it is even possible
to influence the output of --help.
msg77564 - (view) Author: John Stracke (metageek) Date: 2008-12-10 18:58
You may be right; I haven't used autoconf before, so I don't know.

But I'll give it a shot.
msg114587 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-08-21 22:46
Any progress?
msg114596 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2010-08-21 23:05
The new CFLAGS logic is capable of overriding configure options and
CFLAGS are mentioned in ./configure --help. I think OPT is somewhat
obsolete now, so perhaps this could be closed.


$ make CFLAGS="-O2"
gcc -pthread -c -ftest-coverage -fprofile-arcs -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes  -O2  -I. -IInclude -I./Include    -DPy_BUILD_CORE -o Objects/bytesobject.o Objects/bytesobject.c
msg114604 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-08-21 23:17
OK, sounds reasonable.
History
Date User Action Args
2010-08-21 23:17:11georg.brandlsetstatus: open -> closed
resolution: out of date
messages: + msg114604
2010-08-21 23:06:54skrahsetkeywords: - needs review
2010-08-21 23:05:52skrahsetkeywords: + needs review
nosy: + skrah
messages: + msg114596

2010-08-21 22:48:11eric.araujosetversions: + Python 3.2, - Python 3.0
2010-08-21 22:46:39georg.brandlsetnosy: + georg.brandl
messages: + msg114587
2008-12-10 18:58:43metageeksetmessages: + msg77564
2008-12-09 22:10:35loewissetmessages: + msg77460
2008-12-09 13:58:01metageeksetmessages: + msg77416
2008-12-09 13:46:34metageeksetmessages: + msg77414
2008-12-08 22:40:21loewissetnosy: + loewis
messages: + msg77357
2008-12-08 16:07:30metageekcreate