This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: -moptions,
- From: Jan Hubicka <jh at suse dot cz>
- To: thomas joseph <thomascanny at yahoo dot co dot nz>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 24 May 2002 11:31:10 +0200
- Subject: Re: -moptions,
- References: <20020524084013.55190.qmail@web14701.mail.yahoo.com>
> Hi All,
> We are trying to port GCC to a new architecture.
> Our machine works in two addressing modes.
>
> 1) BYTE addressing mode (BITS_PER_UNIT is 8)
> 2) Word addressing mode (BITS_PER_UNIT is 32.)
>
> Now my question is can I have a single executable of
> gcc , and can the user select for which mode he wants
> to compile at compiling the application using
> -mswitch ? Atleast it needs to know the size of char
> at compile time. (cexp.c ? )
>
> It looks like not possible ?
> Any suggestions would be of great help ....
I didn't so for BITS_PER_UNIT, but for long long type size it is easy
to define the macro to be computed at runtime and teach cpp to not
define the type size internally and pass it using spec file hackery.
THis is done for most 32bit/64bit platforms.
I don't see cexp.c in my tree, so perhaps you are using some older,
but I guess BITS_PER_UNIT is similar. The drawback is that GCC do _a
lot_ of divisions by BITS_PER_UNIT, so maybe it would be preferrable to
not do that at runtime because of inacceptable compilation time costs.
Even for defining Pmode differently is expensive, this can be even
worse.
Honza
>
> Thanks and Regards,
> --thomas
>
> http://briefcase.yahoo.com.au - Yahoo! Briefcase
> - Save your important files online for easy access!