[ECOS] cyg_thread vs Cyg_Thread size mismatch

Woller, Thomas twoller@crystal.cirrus.com
Tue Dec 11 08:14:00 GMT 2001


Greetings, I am experiencing the same problem (as the thread
archive below Sept 5, 2001) with a structure size mismatch with
the cyg_thread and the Cyg_Thread compare.  I checked into the
archives and found a thread from Christoph with the same problem,
but i did not see any resolution in the archives.  
Is there a compiler directive that i need to add? to pack (or not
pack) the structures, but not sure. 
thanks for any information or insight into this issue
using GCC 3.0.1, should i use 2.96? or 2.95?

here is my compiler command line from the ecos make
-----------
make -r -C kernel/current build
make[1]: Entering directory
`/usr/local/src/ecos-20011206-jsh/ecos-work/kernel/current'
mips-r3000-elf-gcc -c
-I/usr/local/src/ecos-20011206-jsh/ecos-work/install/include
-I/usr/local/src/ecos/packages/kernel/current
-I/usr/local/src/ecos/packages/kernel/current/src
-I/usr/local/src/ecos/packages/kernel/current/tests -I.
-I/usr/local/src/ecos/packages/kernel/current/src/common/ -Wall
-Wpointer-arith -Wstrict-prototypes -Winline -Wundef
-Woverloaded-virtual -g -O2 -ffunction-sections -fdata-sections
-fno-rtti -fno-exceptions -finit-priority -mcpu=r3000 -mips1
-Wp,-MD,src/common/kapi.tmp -o src/common/kernel_kapi.o
/usr/local/src/ecos/packages/kernel/current/src/common/kapi.cxx
mips-r3000-elf-ar rcs
/usr/local/src/ecos-20011206-jsh/ecos-work/install/lib/libtarget.
a src/common/kernel_kapi.o
---------------
here is the make from the hello.c
---------------
mips-r3000-elf-gcc -c -o hello.o -g -Wall
-I/usr/local/src/ecos/packages/kernel/current/include
-I/usr/local/src/ecos/ecos-work/install/include
-ffunction-sections -fdata-sections -mcpu=r3000 -mips1 hello.c
mips-r3000-elf-gcc -nostartfiles
-L/usr/local/src/ecos/ecos-work/install/lib -Wl,--gc-sections
-Wl,-Map=example.map -o hello hello.o -Ttarget.ld -nostdlib
mips-r3000-elf-objcopy -O binary hello
--------------
Tom
twoller@crystal.cirrus.com 
THREAD FROM LIST >>>>
cyg_thread vs. Cyg_Thread
*	To: eCos mailing list <ecos-discuss at sources dot redhat
dot com> 
*	Subject: [ECOS] cyg_thread vs. Cyg_Thread 
*	From: Christoph Csebits <christoph dot csebits at
frequentis dot com> 
*	Date: Wed, 5 Sep 2001 08:34:59 +0200 
*	References: <20010904164640.A12696@frequentis.com
<msg00043.html>> <20010904165529.J7347@biferten.ma.tech.ascom.ch
<msg00044.html>> <20010904180727.A31123@frequentis.com
<msg00046.html>> <20010904184905.M7347@biferten.ma.tech.ascom.ch
<msg00047.html>> 

On Tue, Sep 04, 2001 at 06:49:05PM +0200, Andrew Lunn wrote:
> The assertion is saying that the C struct cyg_thread, as
defined in
> kapidata.h is a different size to the C++ clase Cyg_Thread as
defined
> in thread.hxx. These two should be identical, member for
member. 

I have a snapshot from 30-Jul-2001(it works)
and from 04-Sep-2001 (doesn't work).
(MPC860T based platform, MBX based port, gcc 2.95.2)

Fact is that both versions of thread.hxx
(where Cyg_Thread is defined) files are identical.

In the working twothreads application (i get no asserts)
sizeof( cyg_thread ) is 176 and sizeof( Cyg_Thread ) must
be the same.

In the not-working application (version 04-Sep)
sizeof( cyg_thread ) is 186.

Since thread.hxx didn't change beetween the two versions its
clear that i get the an assert on
CYG_ASSERT_SIZES( cyg_thread, Cyg_Thread ); (186 != 176).

maybe there is problem in how the compiler packs the struct
cyg_thread.




More information about the Ecos-discuss mailing list