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) *  |
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) *  |
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) *  |
Date: 2010-08-21 22:46 |
Any progress? |
|
|
msg114596 - (view) |
Author: Stefan Krah (skrah) *  |
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) *  |
Date: 2010-08-21 23:17 |
OK, sounds reasonable. |
|
|