Discussion:
__builtin_nanf with -fPIC
Szabolcs Nagy
2012-08-06 14:27:09 UTC
Permalink
for some reason __builtin_nanf is not recongnized when -fPIC
is used (without -fPIC everything is fine)

i guess this is not intentional

int main()
{
double x = __builtin_nanf("");
return 0;
}


pcc -fPIC -c a.c

then a.o will have an undefined __builtin_nanf symbol
Szabolcs Nagy
2012-08-08 10:30:19 UTC
Permalink
Post by Szabolcs Nagy
for some reason __builtin_nanf is not recongnized when -fPIC
is used (without -fPIC everything is fine)
it seems in cc/ccom/builtins.c NANX is defined differently than VALX

that is suspicious as NAN and INFINITY have the same requirements..
(and these are the only places where builtins need to be used)

currently code using NAN cannot be compiled with -fPIC
Anders Magnusson
2012-08-09 11:54:18 UTC
Permalink
Post by Szabolcs Nagy
Post by Szabolcs Nagy
for some reason __builtin_nanf is not recongnized when -fPIC
is used (without -fPIC everything is fine)
it seems in cc/ccom/builtins.c NANX is defined differently than VALX
that is suspicious as NAN and INFINITY have the same requirements..
(and these are the only places where builtins need to be used)
currently code using NAN cannot be compiled with -fPIC
It should be fixed now. The argument were converted early to
something pc-relative, so I needed to rewrite large parts of the
builtin handling to make this work.

-- Ragge

Loading...