in reply to Re^4: [C Question] Determine if gcc provides erfl() function
in thread [C Question] Determine if gcc provides erfl() function

... so I might investigate that path instead.
Why? From what I see, the smoker is working as intended. The functions are not available on that platform and trying to use them ends in failure.

Standard C gives the specification for many functions; this allows the compiler to make optimizations. Such as replacing a memcpy() with immediate moves. Or replacing a printf() by puts(), etc. Or eliminating a function call that has no effect...

What you need to test is the presence of a function *in the system library*. Thus, for the purpose of said test, you can (a) make a sufficiently complicated test, avoiding constants; (b) disable the compilers awareness of those functions by disabling c99 mode, or by using -fno-builtin.

Gcc defines its internal builtins with the expectation that fallback is available. But if the libm is deficient... Using gnu tools on a non-gnu platform, you may run into problems like that.

  • Comment on Re^5: [C Question] Determine if gcc provides erfl() function

Replies are listed 'Best First'.
Re^6: [C Question] Determine if gcc provides erfl() function
by syphilis (Archbishop) on Jun 04, 2015 at 09:40 UTC
    (a) make a sufficiently complicated test, avoiding constants

    Ok - I'll start with that, keeping the other options in mind.
    I'll reply to this post, giving details of the solution I used when I find that solution.

    Thanks for your input.

    Cheers,
    Rob
      I'll reply to this post, giving details of the solution I used when I find that solution.

      Avoiding constants in the test-executable seems to have done the trick, and I can understand how that would have worked.
      At least, there have been no FAIL reports from any NetBSD machines (and only one FAIL all up.).

      However, I was expecting that the NetBSD FAIL reports should have been replaced with UNKNOWN NetBSD reports.
      The Makefile.PL should be doing an "exit 0;", and an "exit 0;" from the Makefile.PL is supposed to result in an UNKNOWN report, isn't it ? But there have been *no* reports at all from NetBSD.

      So, I don't really know that my current version of the module has even been looked at by a NetBSD machine. (In the past, the NetBSD reports have begun filtering through within 24 hours, but that doesn't really count for much.)

      Cheers,
      Rob

        Suppose the test was to merely pass a flag like -DMISSING_foo, and that in your XS you'd provide a respective stub instead of the missing function? (The stub would raise an exception ie die.) Is the lack of powl/erfl so critical that there'd be no point in providing the package without them?