Opened 9 years ago

Closed 7 years ago

#48637 closed defect (fixed)

python25 @2.5.6_5: clang: error: unknown argument: '-mno-fused-madd'

Reported by: fhgwright (Fred Wright) Owned by: larryv (Lawrence Velázquez)
Priority: Normal Milestone:
Component: ports Version: 2.3.3
Keywords: Cc: snarkhunter (Steve Langer), mmpagani (Marco Pagani), petrrr, ryandesign (Ryan Carsten Schmidt)
Port: python25

Description (last modified by ryandesign (Ryan Carsten Schmidt))

An "upgrade outdated" attempted to rebuild python25, but the build failed with a bunch of errors from clang like:

:info:build clang: error: unknown argument: '-mno-fused-madd'

Given the way Python changes from one version to the next, it's useful to keep older versions around for testing.

Attaching full log.

Attachments (1)

main.log (77.8 KB) - added by fhgwright (Fred Wright) 9 years ago.
Logfile from failed build

Download all attachments as: .zip

Change History (10)

Changed 9 years ago by fhgwright (Fred Wright)

Attachment: main.log added

Logfile from failed build

comment:1 Changed 9 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Summary: python25 won't installpython25 @2.5.6_5: clang: error: unknown argument: '-mno-fused-madd'

What version of clang? (run /usr/bin/clang -v)

comment:2 in reply to:  1 Changed 9 years ago by fhgwright (Fred Wright)

Replying to ryandesign@…:

What version of clang? (run /usr/bin/clang -v)

MacPro:~ fw$ which -a clang
/Library/Developer/CommandLineTools/usr/bin/clang
/usr/bin/clang
MacPro:~ fw$ for c in $(which -a clang); do $c -v; done
Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix

comment:3 Changed 9 years ago by snarkhunter (Steve Langer)

Cc: stephen.langer@… added

Cc Me!

comment:4 Changed 9 years ago by mmpagani (Marco Pagani)

Cc: pgnmrc69@… added

Cc Me!

comment:5 Changed 9 years ago by petrrr

Cc: petr@… added

Cc Me!

comment:6 Changed 8 years ago by larryv (Lawrence Velázquez)

Owner: changed from macports-tickets@… to larryv
Status: newaccepted

comment:7 Changed 8 years ago by larryv (Lawrence Velázquez)

Relevant upstream bug report: http://bugs.python.org/issue1779871

comment:8 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign added

The problem is that the -mno-fused-madd flag is unknown to clang, and as of clang 3.4 from Xcode 5.1, clang considers unknown flags to be an error.

Here's the commit that fixed that upstream bug:

https://github.com/python/cpython/commit/1b4e45bab940d385386e9442de5f5fbc7983dd50

It just removed -Wno-long-double -no-cpp-precomp -mno-fused-madd from $BASECFLAGS for python 2.6 and later.

MacPorts already removed -Wno-long-double -no-cpp-precomp from $BASECFLAGS in [2675b181e576879eb901c6e5c125a2e8494a92b4/macports-ports] for python24 and [2c612b374253451055485ad1ad2b640c8aab17be/macports-ports] for python25, apparently for the benefit of gcc 4.2 on Snow Leopard.

It looks like we discovered way back in #2029 that -mno-fused-madd is a PowerPC-only option, and removed it only for non-PowerPC systems in [1f2207ac14f5a209fcb73354eb0f6594b5f7817f/macports-ports] for python23, and we have the same patch in python24. That patch was never added to python25 however.

What does the option do? Here's a description from An Introduction to GCC:

The POWER/PowerPC processors include a combined "multiply and add" instruction a * x + b, which performs the two operations simultaneously for speed--this is referred to as a fused multiply and add, and is used by GCC by default. Due to differences in the way intermediate values are rounded, the result of a fused instruction may not be exactly the same as performing the two operations separately. In cases where strict IEEE arithmetic is required, the use of the combined instructions can be disabled with the option -mno-fused-madd.

So on the theory that this option may do something important for PowerPC systems, I'll fix the issue by doing for python25 what we already do for python24 and did for python23 before it was deleted and keep the option for PowerPC systems.

comment:9 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: acceptedclosed

In 3d4f53db83d3c702ac48e8247ae42883a19a1e4b/macports-ports:

python25: Don't use -mno-fused-madd on non-PowerPC systems

Closes: #48637

Note: See TracTickets for help on using tickets.