I believe that what happens is that gcc analyzes the function void sincos(double x, double *sx, double *cx) { *sx = sin(x); *cx = cos(x); }
and determines that it is equivalent to the call sincos(x, sx, cx); at runtime, this of course becomes a nonterminating recursive call. gcc documents, more or less, that it is permitted to do this in the info section "Other Builtins". (sin and cos are treated as builtins, and one valid optimization of these builtins is to turn one call to each into a single sincos call) The -fno-builtin-sin flag is enough to prevent this optimization. With that in mind, it seems to me that only in sincos.c is it necessary to avoid the use of the builtin functions. Consequently, I wonder what happens if you *do* fix the export of the sincos symbol, then do something like the below patch (untested) FWIW Alec Ari has been working on what is effectively a fork of RTAI at https://github.com/NTULINUX/RTAI -- after some IRC discussion about what I think is the same issue, he ended up adding -ffreestanding to rtai-config --cflags, which inhibits recognition of *all* built-in functions except when used with the __builtin_ prefix. Jeff -- >8 -- Subject: [PATCH] sincos: restrict no-builtin to just one location --- src/libnml/posemath/sincos.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libnml/posemath/sincos.c b/src/libnml/posemath/sincos.c index 4ea47b8..a10c2a8 100644 --- a/src/libnml/posemath/sincos.c +++ b/src/libnml/posemath/sincos.c @@ -32,6 +32,9 @@ #include "posemath.h" +__attribute__((optimize("no-builtin-sin"))) +__attribute__((optimize("no-builtin-cos"))) +__attribute__((optimize("no-builtin-sincos"))) void sincos(double x, double *sx, double *cx) { *sx = sin(x); -- 2.1.0 ------------------------------------------------------------------------------ Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk _______________________________________________ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers