clang default options lead to incorrect code

Bug #1157691 reported by Bob Wilkinson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Raspbian
Fix Released
Undecided
Unassigned

Bug Description

http://www.raspberrypi.org/phpBB3/viewtopic.php?f=33&t=36898

In brief, by default, clang produces code which links with the -lm library to produce incorrect results on the Pi. If clang is invoked with the -mfpu=vfp option, then it produces correct code. However, this fix is not documented in "man clang"

It seems that http://www.raspbian.org/RaspbianFAQ#What_compilation_options_should_be_set_Raspbian_code.3F is not being followed for clang?

Revision history for this message
peter green (plugwash) wrote :

It sounds to me like clang is not correctly using the hard float ABI. Using -mfpu=vfp is probablly just masking the real problem by making clang do the square root inline rather than using the math library.

I will bring this up with debian after the wheezy release. In the meantime I would suggest using gcc to build c code (out of interest why were you using clang anyway?).

Revision history for this message
peter green (plugwash) wrote :

should be fixed now

Changed in raspbian:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.