-ffast-math trick is not working

Bug #1586808 reported by RJ Skerry-Ryan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mixxx
Fix Released
Low
Daniel Schürmann
mixxx (Debian)
Fix Released
Unknown

Bug Description

Bug #1524561 introduced a dedicated object in our binary that is built without -ffast-math.

Our header macro tricks are causing failing builds on some systems.

https://github.com/mixxxdj/mixxx/commit/7e9bba7e88842b5bbb5e7b4ee602b410c455892d#commitcomment-17448450

And:

m0r13 (IRC)
hey guys, I'm having a problem building mixxx on arch linux
got the error output and gcc version (6.1.1) here: https://gist.github.com/m0r13/daea7e93ab04b349039a5acb12472972
M
I was able to build mixxx from sources until I got gcc 6 I think, unfortunately I can't try it again with gcc 5 or 4, as I'm getting errors too building those from aur

RJ Skerry-Ryan (rryan)
Changed in mixxx:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Daniel Schürmann (daschuer) wrote :

> Changing that cmath to #include "/usr/include/c++/6.1.1/math.h"
did the trick.

We may also move verify that we include util/math.h before all external include files that
use fpclassify and friends.

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

> Changing that cmath to #include "/usr/include/c++/6.1.1/math.h"
did the trick.

That's just a workaround though -- not a real fix.

> We may also move verify that we include util/math.h before all external include files that
use fpclassify and friends.

Correct me if I'm wrong -- but if we include util/math.h and a file we include afterwards includes cmath, then we will see the same problem, right? What about headers outside of our control?

Revision history for this message
Daniel Schürmann (daschuer) wrote :

>> Changing that cmath to #include "/usr/include/c++/6.1.1/math.h"
did the trick.

> That's just a workaround though -- not a real fix.

IMHO that is the fix for all plain fpclassify calls nim Mixxx and in external headers.
I have no solution for explicit "std::fclassify" calls or "using" statements in external code though.

Do you think we should prepare defines for that or just ignore that case?
For now I am not aware of a single fclassify call in any header. So the issue might be only a hypothetical one.

> Correct me if I'm wrong -- but if we include util/math.h and a file we include afterwards includes cmath, then we will see the same problem, right? What about headers outside of our control?

From gcc version 6.1.1 <math.h> includes <cmath> and the include guards will prevent the issues.
In previous gcc version math.h cmath seams to be independent. So i am not sure if it works on all compilers versions and targets, hopefully it will not reintroduce other math header issues. So I am afraid we can just do try and error.

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

> IMHO that is the fix for all plain fpclassify calls nim Mixxx and in external headers.

I was responding to the "/usr/include" and "6.6.1" in the path -- that's definitely not going to work on systems that don't locate the library in /usr/include or don't have version 6.6.1 of libc++/libstdc++, right?

Revision history for this message
Daniel Schürmann (daschuer) wrote :

Oh, I had missed that.
Just #include <math.h> should work as well.

Revision history for this message
Daniel Schürmann (daschuer) wrote :
Changed in mixxx:
status: Confirmed → In Progress
assignee: nobody → Daniel Schürmann (daschuer)
milestone: none → 2.1.0
Changed in mixxx:
status: In Progress → Fix Committed
Changed in mixxx (Debian):
status: Unknown → New
Changed in mixxx (Debian):
status: New → Fix Released
Changed in mixxx:
status: Fix Committed → Fix Released
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/8562

lock status: Metadata changes locked and limited to project staff
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.