Hello Ralf, Thanks very much for answering my questions - again! > Another thing you could do is write a config.site file with the right > settings preseeded. I generate these by running > configure -C Great, a matter of fact I took this advise rather seriously and created a test project. I ran a series of different compiler option combinations. I have been wondering for some time about the intrinsic functions in relation to interix and this enlightened me a bit from my prevailing darkness - good! I actually also found a probable bug regarding LP64 labs in the Interix system headers.
It seems that 2 functions are always intrinsic: _alloca and _setjmp. A test
for these will always fail unless a proper prototype is supplied. Also, any
attempt to supply another implementation to these functions will never work
(fine!). Some of the intrinsic math functions are not implemented in the
Interix LIBC, so they could be an extra bonus if they are added to the
headers. They are (or should be) the long double, 80-bit precision data type
functions from 16bit CRT, considered obsolete by MS (long double are now
normally 64bit and are casted so in SUA C++ cmath).
For anyone interested, I attach a template config.site and a header with
prototypes which could be added (well, a test may be needed first).
Worth mentioning, the compiler automatically sets -O2 (which implies -Oi
intrinsics) if not set. So, a good rule would be to set -O1 (optimize for
size, which suppresses intrinsics) in the cc script (or whatever used). If
-O2 is really wanted, it's easy to later change the Makefiles produced by
configure.
> Yep. Fixing this inside Autoconf isn't trivial either, though
> (at least insofar noone has put forth a good suggestion yet).
AN_FUNCTION - what is it? Could it not be used as some sort of a filter with
some conditionalis before the function is sent to the test?
Anyway, I may have a simple solution for the intrinsic functions, like this:
c.m4(262)
+ #if defined _MSC_VER
+ #pragma push_macro(" $1 ")
+ #endif
#undef $1
Needed to be tested a bit more though (e.g. compiler versions, intel
compiler). If it turns out well, what are the chances that it will make it
into autoconf?
Thanks Erik/Jerker
> Hello Erik, Jerker, however you call yourself ;-)
Aeeh, confusing right ... Jerker = old Nordic name for Erik
// MS compiler intrinsic (builtin) functions // Listed functions are not implemented in the Interix SDK // However, they can be used as intrinsic functions. // // created by Jerker Bäck 2007-08-23 for [email protected] #pragma once #ifdef __cplusplus extern "C" { #endif #if defined(_MSC_VER) && defined(USE_INTRINSIC) // intrinsic string functions not in Interix SDK char * __cdecl _strset(char *, int)); char * __cdecl strset(char *,int)); wchar_t * __cdecl _wcsset(wchar_t *, wchar_t)); #pragma intrinsic(_strset) #pragma intrinsic(strset) #pragma intrinsic(_wcsset) // I >assume< these are the (test needed) // long double, 80-bit precision data type mathematical functions // see SUA math.h and cmath for more info e.g the #if __ISO_C_VISIBLE >= 1999 long double __cdecl acosl(long double); long double __cdecl asinl(long double); long double __cdecl atan2l(long double, long double); long double __cdecl atanl(long double); long double __cdecl coshl(long double); long double __cdecl cosl(long double); long double __cdecl expl(long double); long double __cdecl fmodl(long double, long double); long double __cdecl log10l(long double); long double __cdecl logl(long double); long double __cdecl powl(long double, long double); long double __cdecl sinhl(long double); long double __cdecl sinl(long double); long double __cdecl sqrtl(long double); long double __cdecl tanhl(long double); long double __cdecl tanl(long double); long double __cdecl ceill(long double) long double __cdecl floorl(long double) #pragma intrinsic(acosl) #pragma intrinsic(asinl) #pragma intrinsic(atan2l) #pragma intrinsic(atanl) #pragma intrinsic(coshl) #pragma intrinsic(cosl) #pragma intrinsic(expl) #pragma intrinsic(fmodl) #pragma intrinsic(log10l) #pragma intrinsic(logl) #pragma intrinsic(powl) #pragma intrinsic(sinhl) #pragma intrinsic(sinl) #pragma intrinsic(sqrtl) #pragma intrinsic(tanhl) #pragma intrinsic(tanl) #pragma intrinsic(ceill) #pragma intrinsic(floorl) #endif // _MSC_VER && USE_INTRINSIC #ifdef __cplusplus } #endif
config.site
Description: Binary data
