nanogui: Thread: Re: ARM, C++ and -mstructure-size-boundary=8


[<<] [<] Page 1 of 1 [>] [>>]
Subject: FW: ARM, C++ and -mstructure-size-boundary=8
From: Fabrice Gautier ####@####.####
Date: 24 Sep 2002 18:52:54 -0000
Message-Id: <B1F6452C89AFD411AE0800A0CC734C239DBD37@EMAIL1>

[resend to good address, thanks alex]

Hi,

When linking a C++ program to microwindows, we found out that the size of
the MWPALENTRY structure was 4 bytes in the C++ routines and 3 bytes in
Microwindows code (in C).

I also noticed that microwindows was compiled, for the ARM targets, with
-mstructure-boundary-size=8. I didnt compile the C++ program with this
option, but I removed it from the microwindows source code and now the
sizeof(MWPALENTRY) is always 4.

I noticed in the changelog that this gcc option was supposed to fix a bug,
can someone tell me more about this ?

Thanks

-- 
Fabrice Gautier, 
####@####.####
Subject: Re: [nanogui] FW: ARM, C++ and -mstructure-size-boundary=8
From: "Greg Haerr" ####@####.####
Date: 26 Sep 2002 01:09:20 -0000
Message-Id: <068a01c264f8$26ec90e0$3aba46a6@xmission.com>

: When linking a C++ program to microwindows, we found out that the size of
: the MWPALENTRY structure was 4 bytes in the C++ routines and 3 bytes in
: Microwindows code (in C).
: 
: I also noticed that microwindows was compiled, for the ARM targets, with
: -mstructure-boundary-size=8. I didnt compile the C++ program with this
: option, but I removed it from the microwindows source code and now the
: sizeof(MWPALENTRY) is always 4.
: 
: I noticed in the changelog that this gcc option was supposed to fix a bug,
: can someone tell me more about this ?

You've basically found the bug and the original solution.  The
CVS version of Microwindows adds a dummy UCHAR to the
MWPALENTRY structure so that the -mstructure-boundary-size
option should no longer be needed.

I originally ran into this when porting Doom to Nano-X/ARM, since
Doom requires byte-padded rather than long-padded structures.

Regards,

Greg

Subject: RE: [nanogui] FW: ARM, C++ and -mstructure-size-boundary=8
From: Fabrice Gautier ####@####.####
Date: 26 Sep 2002 20:06:29 -0000
Message-Id: <B1F6452C89AFD411AE0800A0CC734C239DBD3E@EMAIL1>

Well, I still dont really understand the bug, the option or the solution,
but it works for me without the option.

As for the 4th dummy uchar, why not use it for the alpha channel?


-- 
Fabrice Gautier, 
####@####.####


> -----Original Message-----
> From: Greg Haerr ####@####.####
> Sent: Wednesday, September 25, 2002 6:01 PM
> To: Fabrice Gautier; ####@####.####
> Subject: Re: [nanogui] FW: ARM, C++ and -mstructure-size-boundary=8
> 
> You've basically found the bug and the original solution.  The
> CVS version of Microwindows adds a dummy UCHAR to the
> MWPALENTRY structure so that the -mstructure-boundary-size
> option should no longer be needed.
> 
> I originally ran into this when porting Doom to Nano-X/ARM, since
> Doom requires byte-padded rather than long-padded structures.
> 
> Regards,
> 
> Greg
> 
[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.