[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] tinycc fails to parse mathcalls.h on armel
From: |
Thomas Preud'homme |
Subject: |
Re: [Tinycc-devel] tinycc fails to parse mathcalls.h on armel |
Date: |
Tue, 24 Aug 2010 17:50:57 +0200 |
User-agent: |
KMail/1.13.5 (Linux/2.6.32-5-686; KDE/4.4.5; i686; ; ) |
Le jeudi 12 août 2010 17:27:34, Thomas Preud'homme a écrit :
> Le jeudi 12 août 2010 11:41:08, grischka a écrit :
> > Thomas Preud'homme wrote:
> > > So to conclude, it seems a bug exist in the way parse_btype look for
> > > long long and long double. If not, please correct me quickly as I'll
> > > fix this this WE or earlier.
> >
> > Well, normally tinycc has no problem with "long long" or "long double".
> > It could help if you preprocess the source (using tcc -E) and then look
> > at the tokens that exactly cause the error.
>
> Sorry, I wasn't thinking enough. My reasoning was completely false as the
> break in parse_btype makes the execution exit the switch but not the while.
>
> Ok I'll try to get tcc -E run by someone on a porterbox.
I could reproduce the bug on an armel qemu environment.
In short: does tinycc have a mechanism like asm alias like the __REDIRECT_NTH
in gcc?
=========== Long story ===========
So the problem is about __NO_LONG_DOUBLE_MATH not being defined on arm
architecture (as it doesn't support long double). Thus, the math functions
resolve to things like:
extern long double __REDIRECT_NTH(acosl, (long double __x), acos);
The libc headers include a conditional definition of __REDIRECT_NTH for gcc >=
2 (__GNUC__ must be greater or equal than 2) like this:
# define __REDIRECT_NTH(name, proto, alias) \
name proto __asm__ (__ASMNAME (#alias)) __THROW
but nothing is defined for other compilers of course. The mechanism is to
alias long double functions to double functions on architecture not having
long double. So if tcc can do such alias then a __REDIRECT_NTH should be done
in tinycc but if it can't, then there is no way to make tcc compiles itself on
arm architecture (and I would disable the bootstrap test for arch armel in
Debian in order for the package to build).
The bug didn't show up before because long double functions were defined in
the headers whenever the library on the target arch could handle long double
or not.
Best regards,
Thomas Preud'homme
>
> Best regards,
>
> > --- grischka
>
> Thomas Preud'homme
signature.asc
Description: This is a digitally signed message part.