From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11490 invoked by alias); 9 Mar 2006 20:11:11 -0000 Received: (qmail 11481 invoked by uid 22791); 9 Mar 2006 20:11:10 -0000 X-Spam-Check-By: sourceware.org Received: from dns2-ana.paetec.net (HELO dns2-ana.paetec.net) (66.251.33.7) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 09 Mar 2006 20:11:09 +0000 Received: from dtcnt40s4.dtccom.com ([66.153.88.146]) by dns2-ana.paetec.net (8.13.5/8.13.5) with ESMTP id k29KB203025467; Thu, 9 Mar 2006 15:11:07 -0500 (EST) Received: by DTCNT40S4 with Internet Mail Service (5.5.2658.3) id ; Thu, 9 Mar 2006 15:08:02 -0500 Message-ID: <3EDBCCE80E95E744A99895CA464987C4A7D295@dtcsrvr09> From: "Doyle, Patrick" To: "'Andrew Lunn'" Cc: "'ecos-discuss@ecos.sourceware.org'" Date: Thu, 09 Mar 2006 20:11:00 -0000 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----_=_NextPart_000_01C643B6.B884D620" X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: RE: [ECOS] JFFS2 on ARM target X-SW-Source: 2006-03/txt/msg00105.txt.bz2 ------_=_NextPart_000_01C643B6.B884D620 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-length: 1865 Hello again Andrew, OK, I've poked around a bit... What I've seen is that the jffs2 tree has migrated a bit since it was imported into the eCos tree. The other thing I've seen is an "ecos" directory which has your fingerprints all over it :-) I'm not in a position right now to upgrade eCos to the latest jffs2, so what I would like to do is to submit =D8yvind's patch (suitably updated to refle= ct the latest changes in jffs2) to the jffs2 maintainer while simultaneously submitting the same patch (suitably not updated) for integration into eCos. Basically, what I've seen (and what I've seen others see) is that there is a bug in the gcc-3.2.x ARM compiler when optimizing constructs such as=20 struct jffs2_unknown_node marker =3D { .magic =3D cpu_to_je16(JFFS2_MAGIC_BITMASK), .nodetype =3D cpu_to_je16(JFFS2_NODETYPE_CLEANMARKER), .totlen =3D cpu_to_je32(c->cleanmarker_size) }; I was gratified to see =D8yvind's patch that looked identical to the one I = was preparing. I've looked around, and this construct is used in the "compr_*.c" files to initialize static variables (which should be fine) and in "erase.c" to initialize an automatic variable (which is not fine). Before I go bursting into the mtd scene saying, "Would you mind applying this patch to work around a compiler bug that some folks using eCos are fighting...", I thought I would check in with you first, since you seem to be the designated eCos representative. I have (perhaps) attached both patches for your review. On an almost different topic... This structure also shows up in a few other files I see (well, my perl script sees) in the eCos tree: net/ftpclient/current/tests/ftp_var_example.c devs/eth/phy/current/include/eth_phy.h devs/spi/arm/at91/current/src/spi_at91.c devs/spi/arm/eb55/current/src/spi_eb55.c But these all seem to be static initializers. --wpd ------_=_NextPart_000_01C643B6.B884D620 Content-Type: application/octet-stream; name="mtd.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="mtd.patch" Content-length: 1552 Index: fs/jffs2/erase.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /home/cvs/mtd/fs/jffs2/erase.c,v=0A= retrieving revision 1.92=0A= diff -u -r1.92 erase.c=0A= --- fs/jffs2/erase.c 21 Jan 2006 21:50:44 -0000 1.92=0A= +++ fs/jffs2/erase.c 9 Mar 2006 19:54:57 -0000=0A= @@ -388,15 +388,14 @@=0A= } else {=0A= =20=0A= struct kvec vecs[1];=0A= - struct jffs2_raw_ebh ebh =3D {=0A= - .magic =3D cpu_to_je16(JFFS2_MAGIC_BITMASK),=0A= - .nodetype =3D cpu_to_je16(JFFS2_NODETYPE_ERASEBLOCK_HEADER),=0A= - .totlen =3D cpu_to_je32(c->ebh_size),=0A= - .reserved =3D 0,=0A= - .compat_fset =3D JFFS2_EBH_COMPAT_FSET,=0A= - .incompat_fset =3D JFFS2_EBH_INCOMPAT_FSET,=0A= - .rocompat_fset =3D JFFS2_EBH_ROCOMPAT_FSET,=0A= - };=0A= +=0A= + memset(&marker, 0, sizeof(marker));=0A= + marker.magic =3D cpu_to_je16(JFFS2_MAGIC_BITMASK);= =0A= + marker.nodetype =3D cpu_to_je16(JFFS2_NODETYPE_ERASEB= LOCK_HEADER);=0A= + marker.totlen =3D cpu_to_je32(c->cleanmarker_size);= =0A= + marker.compat_fset =3D JFFS2_EBH_COMPAT_FSET;=0A= + marker.incompat_fset =3D JFFS2_EBH_INCOMPAT_FSET;=0A= + marker.rocompat_fset =3D JFFS2_EBH_ROCOMPAT_FSET;=0A= =20=0A= ebh_ref =3D jffs2_alloc_raw_node_ref();=0A= if (!ebh_ref) {=0A= ------_=_NextPart_000_01C643B6.B884D620 Content-Type: application/octet-stream; name="ecos.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="ecos.patch" Content-length: 3449 Index: packages/fs/jffs2/current/ChangeLog=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvs/ecos/ecos/packages/fs/jffs2/current/ChangeLog,v=0A= retrieving revision 1.50=0A= diff -u -r1.50 ChangeLog=0A= --- packages/fs/jffs2/current/ChangeLog 3 Aug 2005 20:39:51 -0000 1.50=0A= +++ packages/fs/jffs2/current/ChangeLog 9 Mar 2006 19:58:56 -0000=0A= @@ -1,3 +1,12 @@=0A= +2006-03-09 Patrick Doyle =0A= +=0A= + * src/fs-ecos.c: Removed (nonworking) test for gcc-3.2.x for the=0A= + arm.=20=0A= +=0A= + * src/erase.c (jffs2_mark_erased_block): Worked around a arm-elf=0A= + gcc-3.2.x compiler bug by initializing members of a structure=0A= + explicitly rather than using designated initializers.=0A= +=0A= 2005-08-03 Andrew Lunn =0A= =20=0A= * tests/jffs2_1.c: Include to stop compiler warning.=0A= Index: packages/fs/jffs2/current/src/erase.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvs/ecos/ecos/packages/fs/jffs2/current/src/erase.c,v=0A= retrieving revision 1.10=0A= diff -u -r1.10 erase.c=0A= --- packages/fs/jffs2/current/src/erase.c 30 Jul 2005 15:30:42 -0000 1.10= =0A= +++ packages/fs/jffs2/current/src/erase.c 9 Mar 2006 19:58:57 -0000=0A= @@ -382,11 +382,12 @@=0A= } else {=0A= =20=0A= struct kvec vecs[1];=0A= - struct jffs2_unknown_node marker =3D {=0A= - .magic =3D cpu_to_je16(JFFS2_MAGIC_BITMASK),=0A= - .nodetype =3D cpu_to_je16(JFFS2_NODETYPE_CLEANMARKER),=0A= - .totlen =3D cpu_to_je32(c->cleanmarker_size)=0A= - };=0A= + struct jffs2_unknown_node marker;=0A= +=0A= + memset(&marker, 0, sizeof(marker));=0A= + marker.magic =3D cpu_to_je16(JFFS2_MAGIC_BITMASK);=0A= + marker.nodetype =3D cpu_to_je16(JFFS2_NODETYPE_CLEANMARKER= );=0A= + marker.totlen =3D cpu_to_je32(c->cleanmarker_size);=0A= =20=0A= marker_ref =3D jffs2_alloc_raw_node_ref();=0A= if (!marker_ref) {=0A= Index: packages/fs/jffs2/current/src/fs-ecos.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvs/ecos/ecos/packages/fs/jffs2/current/src/fs-ecos.c,v=0A= retrieving revision 1.38=0A= diff -u -r1.38 fs-ecos.c=0A= --- packages/fs/jffs2/current/src/fs-ecos.c 30 Jul 2005 15:30:42 -0000 1.38= =0A= +++ packages/fs/jffs2/current/src/fs-ecos.c 9 Mar 2006 19:58:58 -0000=0A= @@ -21,11 +21,6 @@=0A= #include =0A= #include =0A= =20=0A= -#if (__GNUC__ =3D=3D 3) && (__GNUC_MINOR__ =3D=3D 2) && defined (__ARM_ARC= H_4__)=0A= -#error This compiler is known to be broken. Please see:=0A= -#error http://ecos.sourceware.org/ml/ecos-patches/2003-08/msg00006.html=0A= -#endif=0A= -=0A= //=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =0A= // Forward definitions=0A= =20=0A= =0A= ------_=_NextPart_000_01C643B6.B884D620 Content-Type: text/plain; charset=us-ascii Content-length: 148 -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss ------_=_NextPart_000_01C643B6.B884D620--