Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't compile with -O3, on ARM, with gcc 3.4.4 #48844

Closed
metageek mannequin opened this issue Dec 8, 2008 · 9 comments
Closed

Can't compile with -O3, on ARM, with gcc 3.4.4 #48844

metageek mannequin opened this issue Dec 8, 2008 · 9 comments
Labels
build The build process and cross-build

Comments

@metageek
Copy link
Mannequin

metageek mannequin commented Dec 8, 2008

BPO 4594
Nosy @loewis, @birkenfeld, @skrah

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2010-08-21.23:17:11.889>
created_at = <Date 2008-12-08.16:07:30.728>
labels = ['build']
title = "Can't compile with -O3, on ARM, with gcc 3.4.4"
updated_at = <Date 2010-08-21.23:17:11.888>
user = 'https://bugs.python.org/metageek'

bugs.python.org fields:

activity = <Date 2010-08-21.23:17:11.888>
actor = 'georg.brandl'
assignee = 'none'
closed = True
closed_date = <Date 2010-08-21.23:17:11.889>
closer = 'georg.brandl'
components = ['Build']
creation = <Date 2008-12-08.16:07:30.728>
creator = 'metageek'
dependencies = []
files = []
hgrepos = []
issue_num = 4594
keywords = []
message_count = 9.0
messages = ['77315', '77357', '77414', '77416', '77460', '77564', '114587', '114596', '114604']
nosy_count = 4.0
nosy_names = ['loewis', 'georg.brandl', 'metageek', 'skrah']
pr_nums = []
priority = 'normal'
resolution = 'out of date'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue4594'
versions = ['Python 3.2']

@metageek
Copy link
Mannequin Author

metageek mannequin commented Dec 8, 2008

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.

@metageek metageek mannequin added the build The build process and cross-build label Dec 8, 2008
@loewis
Copy link
Mannequin

loewis mannequin commented Dec 8, 2008

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.

@metageek
Copy link
Mannequin Author

metageek mannequin commented Dec 9, 2008

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.

@metageek
Copy link
Mannequin Author

metageek mannequin commented Dec 9, 2008

OK, nope, gcc 3.4.6 on x86-64 builds fine. So, please, just have
configure --help mention OPT.

@loewis
Copy link
Mannequin

loewis mannequin commented Dec 9, 2008

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.

@metageek
Copy link
Mannequin Author

metageek mannequin commented Dec 10, 2008

You may be right; I haven't used autoconf before, so I don't know.

But I'll give it a shot.

@birkenfeld
Copy link
Member

Any progress?

@skrah
Copy link
Mannequin

skrah mannequin commented Aug 21, 2010

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

@birkenfeld
Copy link
Member

OK, sounds reasonable.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build
Projects
None yet
Development

No branches or pull requests

1 participant