classification
Title: Make python build with gcc-4.2 on OS X 10.4.9
Type: compile error Stage:
Components: Build Versions: Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ronaldoussoren Nosy List: jyasskin, mark.dickinson, ronaldoussoren
Priority: normal Keywords: patch

Created on 2007-08-23 00:02 by jyasskin, last changed 2008-03-17 14:43 by jyasskin. This issue is now closed.

Files
File name Uploaded Description Edit
gcc42_compile.diff jyasskin, 2007-08-23 00:02 Patch to configure.in and autoconf'ed configure
apple_gcc_flags.diff ronaldoussoren, 2007-08-28 18:03
Messages (8)
msg53048 - (view) Author: Jeffrey Yasskin (jyasskin) * (Python committer) Date: 2007-08-23 00:02
I tested the change with Apple's gcc and gcc-4.2, but only on an Intel mac. http://gcc.gnu.org/ml/gcc/2005-12/msg00368.html says that -no-cpp-precomp is obsolete, and there weren't any warnings about long doubles, so I just removed those two, and because I'm paranoid, I added a test compile for -mno-fused-madd.
msg53049 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2007-08-23 04:15
Also works for me on a PowerPC mac (OS X 10.4.10/G4), with gcc4.2 from macports:  compiles successfully and all tests pass.  This should fix bug 1450807.

What happens with earlier versions of OS X?   It looks as though the -Wno-long-double flag was added just to suppress warnings, so nothing dire should happen if it's removed.  Might the -no-cpp-precomp still be required
for 10.2 or earlier?

 Would it make sense to remove these two flags only for 10.3 and above, or only when using non Apple-supplied gcc?  Or to test for existence of the -no-cpp-precomp flag?
msg55161 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2007-08-23 17:15
Why does you patch test for -mno-fused-madd? If it isn't actually needed 
for something I'd rather not have that logic in the configure file, 
determining which bits of that file are actually needed for supported 
OS-es is hard enough as it is.

-Wno-long-double is needed when compiling on old versions of OSX, where 
"long double" worked but wasn't actually useful. Keeping that option 
seems to be harmless.

-no-cpp-precomp was necessary for several packages on older releases of 
OSX. I'll test on a 10.3 box when I have time (which is the oldest I can 
test on).
msg55209 - (view) Author: Jeffrey Yasskin (jyasskin) * (Python committer) Date: 2007-08-23 20:52
In http://gcc.gnu.org/ml/gcc/2005-12/msg00368.html, Mike Stump
<mrs@apple.com> said "This flag [-no-cpp-precomp] should be removed from
the compile, it hasn't been needed in a long while (since gcc-3.1)."
which was released in 2002.

I'm happy to remove -mno-fused-madd if you say it's unnecessary.

Ronald, do you mean "Removing that option [-Wno-long-double] seems to be
harmless"? Keeping it harms compiles with non-apple gcc's, but I could
add it to a block like -mno-fused-madd.
msg55379 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2007-08-28 17:57
jyasskin: could you test apple_gcc_flags.diff? That's a version of your 
patch where configure tests if GCC supports -Wno-long-double and -no-
cpp-precomp.

NOTE: the patch doesn't update configure, you'll have to run autoconf 
after applying it.

NOTE2: the patch is relative to python's trunk, but should apply to 
2.5.x as well.
msg55380 - (view) Author: Jeffrey Yasskin (jyasskin) * (Python committer) Date: 2007-08-28 18:04
I'm not going to get to this for about a week, but I'll test the patch then.
msg60019 - (view) Author: Jeffrey Yasskin (jyasskin) * (Python committer) Date: 2008-01-17 07:09
Sorry for taking so long to get to this. gcc 4.2.1 still produces the
following errors with this patch:

gcc -c -fno-strict-aliasing -mno-fused-madd -no-cpp-precomp -g -Wall
-Wstrict-prototypes  -I. -IInclude -I./Include -I/opt/local/include 
-DPy_BUILD_CORE -o Objects/boolobject.o Objects/boolobject.c
gcc: unrecognized option '-no-cpp-precomp'
cc1: error: unrecognized command line option "-mno-fused-madd"
make: *** [Objects/boolobject.o] Error 1

I see you dropped the test for -mno-fused-madd. Since gcc-4.2 doesn't
support it, I meant I didn't mind if you dropped the flag entirely. It
looks like -no-cpp-precomp stuck around because it doesn't actually
cause the compile to fail, just to produce a warning message.
msg63646 - (view) Author: Jeffrey Yasskin (jyasskin) * (Python committer) Date: 2008-03-17 14:43
I've fixed this in r61436 with a bunch of back pointers to the previous
issues. If anyone on old versions sees problems, we can add the flags
back conditionally.
History
Date User Action Args
2008-03-17 14:43:32jyasskinsetstatus: open -> closed
type: compile error
resolution: accepted -> fixed
messages: + msg63646
2008-03-14 22:38:29jyasskinlinkissue1450807 superseder
2008-01-17 07:09:36jyasskinsetmessages: + msg60019
2007-08-28 18:04:54jyasskinsetmessages: + msg55380
2007-08-28 18:03:25ronaldoussorensetfiles: - apple_gcc_flags.diff
2007-08-28 18:03:11ronaldoussorensetfiles: + apple_gcc_flags.diff
2007-08-28 17:57:22ronaldoussorensetfiles: + apple_gcc_flags.diff
resolution: accepted
messages: + msg55379
2007-08-23 20:52:34jyasskinsetmessages: + msg55209
2007-08-23 17:15:20ronaldoussorensetassignee: ronaldoussoren
messages: + msg55161
nosy: + ronaldoussoren
2007-08-23 00:02:35jyasskincreate