public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: "Doyle, Patrick" <WPD@dtccom.com>
To: "'Andrew Lunn'" <andrew@lunn.ch>
Cc: "'ecos-discuss@ecos.sourceware.org'" 	
	<ecos-discuss@ecos.sourceware.org>
Subject: RE: [ECOS] JFFS2 on ARM target
Date: Thu, 09 Mar 2006 20:11:00 -0000	[thread overview]
Message-ID: <3EDBCCE80E95E744A99895CA464987C4A7D295@dtcsrvr09> (raw)

[-- Attachment #1: Type: text/plain, Size: 1894 bytes --]

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 Øyvind's patch (suitably updated to reflect
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 

struct jffs2_unknown_node marker = {
	.magic =	cpu_to_je16(JFFS2_MAGIC_BITMASK),
	.nodetype =	cpu_to_je16(JFFS2_NODETYPE_CLEANMARKER),
	.totlen =	cpu_to_je32(c->cleanmarker_size)
};

I was gratified to see Øyvind'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



[-- Attachment #2: mtd.patch --]
[-- Type: application/octet-stream, Size: 1281 bytes --]

Index: fs/jffs2/erase.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/erase.c,v
retrieving revision 1.92
diff -u -r1.92 erase.c
--- fs/jffs2/erase.c	21 Jan 2006 21:50:44 -0000	1.92
+++ fs/jffs2/erase.c	9 Mar 2006 19:54:57 -0000
@@ -388,15 +388,14 @@
 	} else {
 
 		struct kvec vecs[1];
-		struct jffs2_raw_ebh ebh = {
-			.magic =        cpu_to_je16(JFFS2_MAGIC_BITMASK),
-			.nodetype =     cpu_to_je16(JFFS2_NODETYPE_ERASEBLOCK_HEADER),
-			.totlen =       cpu_to_je32(c->ebh_size),
-			.reserved =     0,
-			.compat_fset =  JFFS2_EBH_COMPAT_FSET,
-			.incompat_fset = JFFS2_EBH_INCOMPAT_FSET,
-			.rocompat_fset = JFFS2_EBH_ROCOMPAT_FSET,
-		};
+
+                memset(&marker, 0, sizeof(marker));
+                marker.magic         = cpu_to_je16(JFFS2_MAGIC_BITMASK);
+                marker.nodetype      = cpu_to_je16(JFFS2_NODETYPE_ERASEBLOCK_HEADER);
+                marker.totlen        = cpu_to_je32(c->cleanmarker_size);
+                marker.compat_fset   = JFFS2_EBH_COMPAT_FSET;
+                marker.incompat_fset = JFFS2_EBH_INCOMPAT_FSET;
+                marker.rocompat_fset = JFFS2_EBH_ROCOMPAT_FSET;
 
 		ebh_ref = jffs2_alloc_raw_node_ref();
 		if (!ebh_ref) {

[-- Attachment #3: ecos.patch --]
[-- Type: application/octet-stream, Size: 2642 bytes --]

Index: packages/fs/jffs2/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/fs/jffs2/current/ChangeLog,v
retrieving revision 1.50
diff -u -r1.50 ChangeLog
--- packages/fs/jffs2/current/ChangeLog	3 Aug 2005 20:39:51 -0000	1.50
+++ packages/fs/jffs2/current/ChangeLog	9 Mar 2006 19:58:56 -0000
@@ -1,3 +1,12 @@
+2006-03-09  Patrick Doyle  <wpd@dtccom.com>
+
+	* src/fs-ecos.c: Removed (nonworking) test for gcc-3.2.x for the
+	arm. 
+
+	* src/erase.c (jffs2_mark_erased_block): Worked around a arm-elf
+	gcc-3.2.x compiler bug by initializing members of a structure
+	explicitly rather than using designated initializers.
+
 2005-08-03  Andrew Lunn  <andrew.lunn@ascom.ch>
 
 	* tests/jffs2_1.c: Include <stdio.h> to stop compiler warning.
Index: packages/fs/jffs2/current/src/erase.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/fs/jffs2/current/src/erase.c,v
retrieving revision 1.10
diff -u -r1.10 erase.c
--- packages/fs/jffs2/current/src/erase.c	30 Jul 2005 15:30:42 -0000	1.10
+++ packages/fs/jffs2/current/src/erase.c	9 Mar 2006 19:58:57 -0000
@@ -382,11 +382,12 @@
 	} else {
 
 		struct kvec vecs[1];
-		struct jffs2_unknown_node marker = {
-			.magic =	cpu_to_je16(JFFS2_MAGIC_BITMASK),
-			.nodetype =	cpu_to_je16(JFFS2_NODETYPE_CLEANMARKER),
-			.totlen =	cpu_to_je32(c->cleanmarker_size)
-		};
+		struct jffs2_unknown_node marker;
+
+                memset(&marker, 0, sizeof(marker));
+                marker.magic    = cpu_to_je16(JFFS2_MAGIC_BITMASK);
+                marker.nodetype = cpu_to_je16(JFFS2_NODETYPE_CLEANMARKER);
+                marker.totlen   = cpu_to_je32(c->cleanmarker_size);
 
 		marker_ref = jffs2_alloc_raw_node_ref();
 		if (!marker_ref) {
Index: packages/fs/jffs2/current/src/fs-ecos.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/fs/jffs2/current/src/fs-ecos.c,v
retrieving revision 1.38
diff -u -r1.38 fs-ecos.c
--- packages/fs/jffs2/current/src/fs-ecos.c	30 Jul 2005 15:30:42 -0000	1.38
+++ packages/fs/jffs2/current/src/fs-ecos.c	9 Mar 2006 19:58:58 -0000
@@ -21,11 +21,6 @@
 #include <string.h>
 #include <cyg/io/config_keys.h>
 
-#if (__GNUC__ == 3) && (__GNUC_MINOR__ == 2) && defined (__ARM_ARCH_4__)
-#error This compiler is known to be broken. Please see:
-#error http://ecos.sourceware.org/ml/ecos-patches/2003-08/msg00006.html
-#endif
-
 //==========================================================================
 // Forward definitions
 


[-- Attachment #4: Type: text/plain, Size: 148 bytes --]

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

             reply	other threads:[~2006-03-09 20:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-09 20:11 Doyle, Patrick [this message]
2006-03-09 20:39 ` Andrew Lunn
  -- strict thread matches above, loose matches on Subject: below --
2006-03-09 16:18 Doyle, Patrick
2006-03-09 20:42 ` Andrew Lunn
2006-06-20 14:35   ` Jürgen Lambrecht
2006-03-08 20:00 Doyle, Patrick
2006-03-08 21:58 ` Andrew Lunn
2006-03-08 23:03   ` Newsgroups Reader

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3EDBCCE80E95E744A99895CA464987C4A7D295@dtcsrvr09 \
    --to=wpd@dtccom.com \
    --cc=andrew@lunn.ch \
    --cc=ecos-discuss@ecos.sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).