Poster | Thread |
wawa
| |
fpu gcc compilation flags for sam440/460 Posted on 27-Mar-2018 19:14:20
| | [ #1 ] |
|
|
|
Elite Member |
Joined: 21-Jan-2008 Posts: 6259
From: Unknown | | |
|
| i am compiling a c++11 multiplatform portable application that makes direct use of at least two floating point functions: std::isnan and std::isinf. on x86 this compiles alright. however i do get following eror compiling for sam440-ppc target: Quote:
/home/wawa/AROS-source/AROS/local/OdysseyWebBrowser/Source/JavaScriptCore/runtime/MathCommon.cpp:416:14: error: expected unqualified-id before '(' token if (std::isnan(y)) ^ /home/wawa/AROS-source/AROS/local/OdysseyWebBrowser/Source/JavaScriptCore/runtime/MathCommon.cpp:418:14: error: expected unqualified-id before '(' token if (std::isinf(y) && fabs(x) == 1) ^
|
im not sure if im on the right track, but i started to suspect that im lacking some gcc flag to tell cmake that fpu instructions are allowed and how they should be interpreted. though considering https://gcc.gnu.org/onlinedocs/gcc/RS_002f6000-and-PowerPC-Options.html and https://en.wikipedia.org/wiki/Sam440ep im still not sure if sam440/460 does actually have fpu or not and what kind of flags are appropriate for it.
edit: btw this are as far i can tell the only two functions im lacking to get binary built. i can substitute them omitting std:: namespace, but this isnt the right thing to do i suppose. id prefer to have it solved clean.Last edited by wawa on 27-Mar-2018 at 07:19 PM. Last edited by wawa on 27-Mar-2018 at 07:14 PM.
|
|
Status: Offline |
|
|
broadblues
| |
Re: fpu gcc compilation flags for sam440/460 Posted on 27-Mar-2018 21:28:43
| | [ #2 ] |
|
|
|
Amiga Developer Team |
Joined: 20-Jul-2004 Posts: 4446
From: Portsmouth England | | |
|
| @wawa
SAM440 most definetly has an fpu.
Quote:
edit: btw this are as far i can tell the only two functions im lacking to get binary built. i can substitute them omitting std:: namespace, but this isnt the right thing to do i suppose. id prefer to have it solved clean.
|
Depending on the specific c library in use isinf and isnan are generally not functions but macros, which is probably why removing the std:: namepace makes it work.
[edit] A bit of googling shows that c++11 add isinf() as a function too, check your <cmath> header and see how / if they are defined ? I donlt think the error you are getting is FPU related as it's too early in the compile process.Last edited by broadblues on 27-Mar-2018 at 09:38 PM.
_________________ BroadBlues On Blues BroadBlues On Amiga Walker Broad |
|
Status: Offline |
|
|
broadblues
| |
Re: fpu gcc compilation flags for sam440/460 Posted on 27-Mar-2018 22:22:32
| | [ #3 ] |
|
|
|
Amiga Developer Team |
Joined: 20-Jul-2004 Posts: 4446
From: Portsmouth England | | |
|
| @broadblues
Your error report looks suspect.
Some googling suggest that it can occur of math.h included instead of cmath , and infact I can get exactly that error with a pice of text code like so/
#include <iostream> #include <math.h>
int main(int argc, char *argv[]) { std::cout << std::isinf(std::INFINITY) << "\n"; }
g++ test.cpp -o testit In file included from test.cpp:2:0: test.cpp: In function 'int main(int, char**)': test.cpp:6:20: error: expected unqualified-id before '(' token std::cout _________________ BroadBlues On Blues BroadBlues On Amiga Walker Broad
|
|
Status: Offline |
|
|
wawa
| |
Re: fpu gcc compilation flags for sam440/460 Posted on 27-Mar-2018 22:38:26
| | [ #4 ] |
|
|
|
Elite Member |
Joined: 21-Jan-2008 Posts: 6259
From: Unknown | | |
|
| @broadblues
in fact cmath looks exactly the same for both x86 and ppc, it includes math.h while undefining a number of macos. both culprits are not among them however the headers included priorr to math.h originate from respective arch subdirs and differ in detail. i must go through it.
Quote:
#pragma GCC system_header
#include #include #include #define _GLIBCXX_INCLUDE_NEXT_C_HEADERS #include_next #undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS
#ifndef _GLIBCXX_CMATH #define _GLIBCXX_CMATH 1
// Get rid of those macros defined in in lieu of real functions. #undef abs #undef div #undef acos #undef asin #undef atan #undef atan2 #undef ceil #undef cos #undef cosh #undef exp #undef fabs #undef floor #undef fmod #undef frexp #undef ldexp #undef log #undef log10 #undef modf #undef pow #undef sin #undef sinh #undef sqrt #undef tan #undef tanh
|
Last edited by wawa on 27-Mar-2018 at 10:53 PM. Last edited by wawa on 27-Mar-2018 at 10:53 PM.
|
|
Status: Offline |
|
|
wawa
| |
Re: fpu gcc compilation flags for sam440/460 Posted on 27-Mar-2018 23:09:34
| | [ #5 ] |
|
|
|
Elite Member |
Joined: 21-Jan-2008 Posts: 6259
From: Unknown | | |
|
| @wawa
hmm at first glance i dont really see anything that would justify that different behaviour. verey, very unlkely that _GLIBCXX_USE_FLOAT128 in respective c++config.h. thats the only differring header definitions i can spot.
Quote:
--- /home/wawa/aros-x86-630/bin/linux-i386/tools/crosstools/lib/gcc/i386-aros/6.3.0/include/c++/i386-aros/bits/c++config.h +++ /home/wawa/aros-ppc-630/bin/linux-i386/tools/crosstools/lib/gcc/ppc-aros/6.3.0/include/c++/ppc-aros/bits/c++config.h @@ -1385,7 +1385,7 @@ /* #undef _GLIBCXX98_USE_C99_WCHAR */ /* Define if the compiler supports C++11 atomics. */ -/* #undef _GLIBCXX_ATOMIC_BUILTINS */ +#define _GLIBCXX_ATOMIC_BUILTINS 1 /* Define to use concept checking code from the boost libraries. */ /* #undef _GLIBCXX_CONCEPT_CHECKS */ @@ -1496,7 +1496,7 @@ /* #undef _GLIBCXX_USE_FCHMODAT */ /* Define if __float128 is supported on this host. */ -#define _GLIBCXX_USE_FLOAT128 1 +/* #undef _GLIBCXX_USE_FLOAT128 */ /* Defined if gettimeofday is available. */ #define _GLIBCXX_USE_GETTIMEOFDAY 1 @@ -1564,7 +1564,7 @@ #define _GLIBCXX_VERBOSE 1 /* Defined if as can handle rdrand. */ -#define _GLIBCXX_X86_RDRAND 1 +/* #undef _GLIBCXX_X86_RDRAND */ /* Define to 1 if mutex_timedlock is available. */ #define _GTHREAD_USE_MUTEX_TIMEDLOCK 0
|
edit: is that in accordance with os4 header?Last edited by wawa on 27-Mar-2018 at 11:11 PM. Last edited by wawa on 27-Mar-2018 at 11:10 PM.
|
|
Status: Offline |
|
|
wawa
| |
Re: fpu gcc compilation flags for sam440/460 Posted on 28-Mar-2018 1:02:43
| | [ #6 ] |
|
|
|
Elite Member |
Joined: 21-Jan-2008 Posts: 6259
From: Unknown | | |
|
| forget it, it isnt the problem. i might be on track in /OdysseyWebBrowser/Source/WTF/wtf/MathExtras.h:
Quote:
#if OS(AROS)
#undef isinf #undef isnan #undef isfinite #undef signbit
namespace std {
inline bool isinf(double num) { return __isinf(num); } inline bool isnan(double num) { return __isnan(num); } inline bool isfinite(double x) { return __isfinite(x); } inline bool signbit(double num) { return __signbit(num); }
} // namespace std
inline double log2(double num) { return log(num) / 0.693147180559945309417232121458176568; }
inline float log2f(float num) { return logf(num) / 0.693147180559945309417232121458176568f; } #endif
|
Last edited by wawa on 28-Mar-2018 at 01:03 AM.
|
|
Status: Offline |
|
|
wawa
| |
Re: fpu gcc compilation flags for sam440/460 Posted on 2-Apr-2018 6:10:24
| | [ #7 ] |
|
|
|
Elite Member |
Joined: 21-Jan-2008 Posts: 6259
From: Unknown | | |
|
| after i commited all changes necessary for x86 i again turn to ppc and m68k.
can someone point me to current os4 or morphos sources for comparison, or is it all up to date in deadwoods odyssey source im working with? |
|
Status: Offline |
|
|
samo79
| |
Re: fpu gcc compilation flags for sam440/460 Posted on 2-Apr-2018 11:20:50
| | [ #8 ] |
|
|
|
Elite Member |
Joined: 13-Feb-2003 Posts: 3505
From: Italy, Perugia | | |
|
| |
Status: Offline |
|
|