C99 Math library incomplete in GCC 4.9.* ARM

Bug #1511761 reported by Daniel Frenzel
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
GNU Arm Embedded Toolchain
Confirmed
Undecided
Unassigned

Bug Description

I try to build the Eigen library on a ARM with cxx11. The library builds with ARM GCC 4.8.* but not with ARM 4.9.*
It also builds on a native environment. See: https://travis-ci.org/diydrones/ardupilot/builds/88184030
Other people reported the same problems: http://lists.freebsd.org/pipermail/freebsd-current/2014-January/048130.html
As parts of GCC's standard library are protected by guard DEFs, compilation on GCC 4.8 was only possible with such a construct, but with GCC 4.9.* I get new problems (see below):

    #pragma once
    #pragma GCC diagnostic push
        #define RAND_MAX __RAND_MAX
        #pragma GCC diagnostic ignored "-Wshadow"
        #pragma GCC diagnostic ignored "-Wfloat-equal"
        #define _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC 1
    ..

Here is the short version of my compiler error:

/home/travis/build/diydrones/ardupilot/libraries/AP_Eigen/AP_Eigen.h:17:81: note: #pragma message: std::lgamma*() does not exist in this environment.
             #pragma message("std::lgamma*() does not exist in this environment.")
                                                                                 ^
In file included from /home/travis/opt/gcc-arm-none-eabi-4_9-2015q3/arm-none-eabi/include/c++/4.9.3/random:51:0,
                 from /home/travis/opt/gcc-arm-none-eabi-4_9-2015q3/arm-none-eabi/include/c++/4.9.3/bits/stl_algo.h:66,
                 from /home/travis/opt/gcc-arm-none-eabi-4_9-2015q3/arm-none-eabi/include/c++/4.9.3/algorithm:62,
                 from /home/travis/build/diydrones/ardupilot/libraries/AP_Eigen/eigen/Eigen/Core:160,
                 from /home/travis/build/diydrones/ardupilot/libraries/AP_Eigen/AP_Eigen.h:32,
                 from /home/travis/build/diydrones/ardupilot/libraries/Filter/LowPassFilter2p.cpp:100:
/home/travis/opt/gcc-arm-none-eabi-4_9-2015q3/arm-none-eabi/include/c++/4.9.3/bits/random.tcc: In member function 'void std::poisson_distribution<_IntType>::param_type::_M_initialize()':
/home/travis/opt/gcc-arm-none-eabi-4_9-2015q3/arm-none-eabi/include/c++/4.9.3/bits/random.tcc:1408:55: error: no matching function for call to 'max(float, const double&)'
    _M_d = std::round(std::max(6.0, std::min(__m, __dx)));
                                                       ^
compilation terminated due to -Wfatal-errors.

Please fix this fast, it cannot be that half of the standard library cannot be used with ARM.

description: updated
Changed in gcc-arm-embedded:
status: New → Confirmed
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.