[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] gcc-4.5.2-mint-20110128

Vincent Rivière wrote:
3) As a pleasant side effects, GCC's math-68881.h is now used transparently.

Paweł has discovered a very annoying bug by compiling the tiff library.
That math-68881.h distributed with GCC is not compatible with the standards C99 or GNU99.

If you include math.h in multiple files (usually, you do) and you compile with:
-m68020-60 -O2 -std=c99 (or gnu99)
then you get multiple definitions of _sin, _cos, etc.

The behavior of inlines have been well defined in x99 standards.
The rules are quite obscure:

Basically, with the default options, inlining may or may not occur, but the functions will never been externally visible. In x99 standard, they are :-(
Also those inlines use "extern inline", I wonder how this could be useful.

I believe math-68881.h has currently a design bug and has never been adapted for the x99 standards.
I will probably report this problem to the GCC team.

As a workaround, I advice to use -DNO_INLINE_MATH whenever -std=c99 or -std=gnu99 is used. This will solve the link problem, but of course no inlining will occur and libm will be used.

Vincent Rivière