This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: -moptions,

> 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

> Thanks and Regards,
> --thomas 
> - Yahoo! Briefcase
> - Save your important files online for easy access!

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]