[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [microblaze-uclinux] It there another CVS rather than cvs.linux.org?



Hi David

Nope. I just rsync from John's CVS (probability CVS-test),
I did try download the CVS from uclinux.org, it seems there are still bunch of patches missing.
Maybe this is why you having problems with the uClinux-dist patch.
Anyway, the attachments are the patches to update your CVS from uclinux.org.
Make sure you apply uClinux-dist.diff last.

You shouldn't get any errors/problems with these patches or during kernel compilation, I have tested in my machine.

Regards,

Jason

Hi, there,

Since I got errors when applying the patch and Jason did well without
problems, I wondered if I checked out wrong CVS. The link published on
John's web, as far as I can find, is 

cvs -z3 -d:pserver:anonymous@cvs.uclinux.org:/var/cvs co uClinux-dist 

I find from cvs.uclinux.org that

File:  [uClinux Local Repository] / uClinux-dist / vendors / config /
microblaze / config.arch
Revision 1.1.1.3 (vendor branch): download - view: text, annotated - select
for diffs
Wed Aug 10 00:28:23 2005 UTC (4 weeks, 2 days ago) by davidm
Branches: uClinux-dist, MAIN
CVS tags: uClinux-dist-test-20050808, HEAD

However, in uClinux-dist.diff there is 

diff -N -r -u -x CVS -x '\.svn' vendors/config/microblaze/config.arch
/opt/svn/RSC/software/linux/uClinux-dist/vendors/config/microblaze/config.ar
ch
--- vendors/config/microblaze/config.arch       2005-08-25
10:59:09.000000000 +1000

So, is the uClinux-dist.diff made based on the 2005-08-25 version of the
config.arch? However, the uclinux.org CVS holds the version of 2005-08-10
version. 

Is there any more updated CVS I should use?

Regards

David


___________________________
microblaze-uclinux mailing list
microblaze-uclinux@itee.uq.edu.au
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/

  

diff -Naur -x '.*' -x '*CVS*' -x '*.o' -x '*.a' /home/wu/tmp/test/uClinux-dist-test/include/Makefile include/Makefile
--- /home/wu/tmp/test/uClinux-dist-test/include/Makefile	2005-09-10 18:13:02.000000000 +1000
+++ include/Makefile	2005-08-25 10:59:09.000000000 +1000
@@ -98,8 +98,10 @@
 			ln -s $$i $$dst/.; \
 		done ; \
 	done
+	@rm -f gcc
 	@ln -s `$(CC) -print-file-name=include` gcc
 	@echo "Making include/c++ symlink to compiler c++ includes"
+	@rm -f c++
 	@ln -s /usr/local/include/g++-v3 c++
 	@for i in `$(CXX) -v -xc++ /dev/null 2>&1 | sed -e '/^Reading specs/,/^#include <\.\.\.>/d' -e '/End of search list/Q'`; do \
 		if [ -f $$i/new ]; then rm -f c++; ln -s $$i c++; break; fi; \
diff -Naur -x '.*' -x '*CVS*' -x '*.o' -x '*.a' /home/wu/tmp/test/uClinux-dist-test/tools/ucfront/ucfront.c tools/ucfront/ucfront.c
--- /home/wu/tmp/test/uClinux-dist-test/tools/ucfront/ucfront.c	2005-09-10 18:14:00.000000000 +1000
+++ tools/ucfront/ucfront.c	2005-08-25 10:59:09.000000000 +1000
@@ -114,7 +114,7 @@
 		}
 		args_add_prefix(orig_args, p);
 	}
-
+	
 	if (ucfront_debug) {
 		cc_log("Bypass: ");
 		log_args(orig_args);
@@ -718,6 +718,14 @@
 		}
 		args_add_prefix(stripped_args, p);
 	}
+
+	/* Hack by JW to allow forcing specific args right at the 
+	   end of the stripped arg list.  This works around cruftiness
+	   in mb-gcc-2.95.x, however it may be useful somewhere else */
+	if((e=getenv("UCFRONT_LINK_SUFFIX")) && (mode==MODE_LINK) ) {
+		args_add(stripped_args,e);
+	}
+
 }
 
 /* the main ucfront driver function */
diff -Naur -x '.*' -x '*CVS*' -x '*.o' -x '*.a' /home/wu/tmp/test/uClinux-dist-test/uClibc/libc/sysdeps/linux/microblaze/initfini.awk uClibc/libc/sysdeps/linux/microblaze/initfini.awk
--- /home/wu/tmp/test/uClinux-dist-test/uClibc/libc/sysdeps/linux/microblaze/initfini.awk	1970-01-01 10:00:00.000000000 +1000
+++ uClibc/libc/sysdeps/linux/microblaze/initfini.awk	2005-08-25 10:59:09.000000000 +1000
@@ -0,0 +1,121 @@
+#! /usr/bin/awk -f
+# Contributed by Christian MICHON <christian_michon@yahoo.fr> to
+#   eliminate the compile time dependancy on perl introduced by 
+#   Erik's older initfini.pl 
+# vim:ai:sw=2:
+
+BEGIN \
+{ alignval="";
+  endp=0;
+  end=0;
+  system("touch crt[in].S");
+  system("/bin/rm -f crt[in].S");
+  omitcrti=0;
+  omitcrtn=0;
+  glb_idx = 0;
+  while(getline < "initfini.S")
+  { if(/\.endp/) {endp=1}
+    if(/\.end/) {end=1}
+    if(/\.align/) {alignval=$2}
+# here comes some special stuff for the SuperH targets
+#  We search for all labels, which uses the _GLOBAL_OFFSET_TABLE_
+#  or a call_gmon_start function reference, and store
+#  them in the glb_label array.
+    if(/_init_EPILOG_BEGINS/) {glb_idx=1;glb_idx_arr[glb_idx]=0}
+    if(/_fini_EPILOG_BEGINS/) {glb_idx=2;glb_idx_arr[glb_idx]=0}
+    if(/EPILOG_ENDS/)         {glb_idx=0}
+    if(/_GLOBAL_OFFSET_TABLE_/||/call_gmon_start/) {
+      glb_label[glb_idx,glb_idx_arr[glb_idx]] = last;
+      glb_idx_arr[glb_idx] += 1;
+      glb_label[glb_idx,glb_idx_arr[glb_idx]] = $0;
+      glb_idx_arr[glb_idx] += 1;
+    }
+    last = $1;
+  }
+  close("initfini.S");
+}
+# special rules for the SuperH targets (They do nothing on other targets)
+/SH_GLB_BEGINS/ && glb_idx_arr[1]==0 && glb_idx_arr[2]==0 {omitcrti +=1}
+/_init_SH_GLB/  {glb_idx=1}
+/_fini_SH_GLB/  {glb_idx=2}
+/SH_GLB_ENDS/ {omitcrti -=1}
+/SH_GLB/ \
+{
+  if (glb_idx>0)
+    {
+      for (i=0;i<glb_idx_arr[glb_idx];i+=1) {
+	print glb_label[glb_idx,i] >> "crti.S";
+      }
+      glb_idx = 0;
+    }
+  next;
+}
+# special rules for H8/300 (sorry quick hack)
+/.h8300h/ {end=0}
+
+# rules for all targets
+/HEADER_ENDS/{omitcrti=1;omitcrtn=1;getline}
+/PROLOG_BEGINS/{omitcrti=0;omitcrtn=0;getline}
+/i_am_not_a_leaf/{getline}
+/_init:/||/_fini:/{omitcrtn=1}
+/PROLOG_PAUSES/{omitcrti=1;getline}
+/PROLOG_UNPAUSES/{omitcrti=0;getline}
+/PROLOG_ENDS/{omitcrti=1;getline}
+/EPILOG_BEGINS/{omitcrtn=0;getline}
+/EPILOG_ENDS/{omitcrtn=1;getline}
+/TRAILER_BEGINS/{omitcrti=0;omitcrtn=0;getline}
+/GMON_STUFF_BEGINS/{omitcrtn=1;getline}
+/GMON_STUFF_PAUSES/{omitcrtn=0;getline}
+/GMON_STUFF_UNPAUSES/{omitcrtn=1;getline}
+/GMON_STUFF_ENDS/{omitcrtn=0;getline}
+
+/_GLOBAL_OFFSET_TABLE_/||/gmon_start/ \
+{
+  if(omitcrti==0) {print >> "crti.S";}
+  next;  # no gmon_start or GLOBAL_OFFSET_TABLE references in crtn.S
+}
+
+/END_INIT/ \
+{ if(endp)
+  { gsub("END_INIT",".endp _init",$0)
+  }
+  else
+  { if(end)
+    { gsub("END_INIT",".end _init",$0)
+    }
+    else
+    { gsub("END_INIT","",$0)
+    }
+  }
+}
+
+/END_FINI/ \
+{ if(endp)
+  { gsub("END_FINI",".endp _fini",$0)
+  }
+  else
+  { if(end)
+    { gsub("END_FINI",".end _fini",$0)
+    }
+    else
+    { gsub("END_FINI","",$0)
+    }
+  }
+}
+
+/ALIGN/ \
+{ if(alignval!="")
+  { gsub("ALIGN",sprintf(".align %s",alignval),$0)
+  }
+  else
+  { gsub("ALIGN","",$0)
+  }
+}
+
+omitcrti==0 {print >> "crti.S"}
+omitcrtn==0 {print >> "crtn.S"}
+
+END \
+{ close("crti.S");
+  close("crtn.S");
+}
diff -Naur -x '.*' -x '*CVS*' -x '*.o' -x '*.a' /home/wu/tmp/test/uClinux-dist-test/uClibc/libc/sysdeps/linux/microblaze/initfini.c uClibc/libc/sysdeps/linux/microblaze/initfini.c
--- /home/wu/tmp/test/uClinux-dist-test/uClibc/libc/sysdeps/linux/microblaze/initfini.c	1970-01-01 10:00:00.000000000 +1000
+++ uClibc/libc/sysdeps/linux/microblaze/initfini.c	2005-08-25 10:59:09.000000000 +1000
@@ -0,0 +1,172 @@
+/* Special .init and .fini section support.
+   Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file with other
+   programs, and to distribute those programs without any restriction
+   coming from the use of this file.  (The GNU Lesser General Public
+   License restrictions do apply in other respects; for example, they
+   cover modification of the file, and distribution when not linked
+   into another program.)
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* This file is compiled into assembly code which is then munged by a sed
+   script into two files: crti.s and crtn.s.
+
+   * crti.s puts a function prologue at the beginning of the
+   .init and .fini sections and defines global symbols for
+   those addresses, so they can be called as functions.
+
+   * crtn.s puts the corresponding function epilogues
+   in the .init and .fini sections. */
+
+#include <features.h>
+
+
+/* We use embedded asm for .section unconditionally, as this makes it
+   easier to insert the necessary directives into crtn.S. */
+#define SECTION(x) asm (".section " x );
+
+/* Declare symbols as hidden. Hidden symbols are only seen by
+ * the link editor and not by the dynamic loader. */
+#ifdef __HAVE_DOT_HIDDEN__
+#  define HIDDEN(func)  asm (".hidden  " #func );
+#else
+#  define HIDDEN(func)
+#endif
+
+#if defined(__sh__) && !defined(__SH5__)
+  /* The macro insert this sh specific stuff:
+     @_SH_GLB_BEGINS
+          bra     1f
+	  nop
+	  ALIGN
+     @func_SH_GLB_LABEL
+     1:
+     @_SH_GLB_ENDS
+   */
+#define GLB_STUFF(func)  asm ("\n/*@_SH_GLB_BEGINS*/"); \
+  asm ("\n\tbra\t1f\n\tnop\n\tALIGN\n/*@" #func"_SH_GLB_LABEL*/\n1:"); \
+  asm ("\n/*@_SH_GLB_ENDS*/");
+#else
+#define GLB_STUFF(func)
+#endif
+
+/* The initial common code ends here. */
+asm ("\n/*@HEADER_ENDS*/");
+
+/* To determine whether we need .end and .align: */
+//asm ("\n/*@TESTS_BEGIN*/");
+extern void dummy (void (*foo) (void));
+void
+dummy (void (*foo) (void))
+{
+  if (foo)
+    (*foo) ();
+}
+//asm ("\n/*@TESTS_END*/");
+
+/* The beginning of _init:  */
+asm ("\n/*@_init_PROLOG_BEGINS*/");
+
+#ifdef GMON_SUPPORT
+asm ("\n/*@_init_GMON_STUFF_BEGINS*/");
+static void
+call_gmon_start(void)
+{
+  extern void __gmon_start__ (void) __attribute__ ((weak)); /*weak_extern (__gmon_start__);*/
+  void (*gmon_start) (void) = __gmon_start__;
+
+  if (gmon_start)
+    gmon_start ();
+}
+asm ("\n/*@_init_GMON_STUFF_PAUSES*/");
+#endif
+
+SECTION (".init")
+HIDDEN(_init)
+
+extern void i_am_not_a_leaf (void);
+extern void _init (void);
+void _init (void)
+{
+#ifdef GMON_SUPPORT
+asm ("\n/*@_init_GMON_STUFF_UNPAUSES*/");
+  /* We cannot use the normal constructor mechanism in gcrt1.o because it
+     appears before crtbegin.o in the link, so the header elt of .ctors
+     would come after the elt for __gmon_start__.  One approach is for
+     gcrt1.o to reference a symbol which would be defined by some library
+     module which has a constructor; but then user code's constructors
+     would come first, and not be profiled.  */
+  call_gmon_start ();
+asm ("\n/*@_init_GMON_STUFF_ENDS*/");
+#else
+  asm ("\n/*@_init_PROLOG_PAUSES*/");
+  {
+    /* Let GCC know that _init is not a leaf function by having a dummy
+     * function call here.  We arrange for this call to be omitted from
+     * either crt file.  */
+    i_am_not_a_leaf ();
+  }
+  asm ("\n/*@_init_PROLOG_UNPAUSES*/");
+#endif
+
+  GLB_STUFF(_init)
+  asm ("ALIGN");
+  asm("END_INIT");
+  /* Now the epilog. */
+  asm ("\n/*@_init_PROLOG_ENDS*/");
+  asm ("\n/*@_init_EPILOG_BEGINS*/");
+}
+
+/* End of the _init epilog, beginning of the _fini prolog. */
+asm ("\n/*@_init_EPILOG_ENDS*/");
+asm ("\n/*@_fini_PROLOG_BEGINS*/");
+
+SECTION (".fini")
+HIDDEN(_fini)
+
+extern void i_am_not_a_leaf2 (void);
+extern void _fini (void);
+void _fini (void)
+{
+
+  /* End of the _fini prolog. */
+  GLB_STUFF(_fini)
+  asm ("ALIGN");
+  asm ("END_FINI");
+  asm ("\n/*@_fini_PROLOG_ENDS*/");
+
+  {
+    /* Let GCC know that _fini is not a leaf function by having a dummy
+       function call here.  We arrange for this call to be omitted from
+       either crt file.  */
+    i_am_not_a_leaf2 ();
+  }
+
+  /* Beginning of the _fini epilog. */
+  asm ("\n/*@_fini_EPILOG_BEGINS*/");
+}
+
+/* End of the _fini epilog.  Any further generated assembly (e.g. .ident)
+   is shared between both crt files. */
+asm ("\n/*@_fini_EPILOG_ENDS*/");
+asm ("\n/*@TRAILER_BEGINS*/");
+
+/* End of file. */
diff -Naur -x '.*' -x '*CVS*' -x '*.o' -x '*.a' /home/wu/tmp/test/uClinux-dist-test/uClibc/libc/sysdeps/linux/microblaze/Makefile uClibc/libc/sysdeps/linux/microblaze/Makefile
--- /home/wu/tmp/test/uClinux-dist-test/uClibc/libc/sysdeps/linux/microblaze/Makefile	2005-08-10 10:27:38.000000000 +1000
+++ uClibc/libc/sysdeps/linux/microblaze/Makefile	2005-08-25 10:59:09.000000000 +1000
@@ -21,7 +21,7 @@
 include $(TOPDIR)Rules.mak
 
 #FIXME -- this arch should include its own crti.S and crtn.S
-UCLIBC_CTOR_DTOR=n
+UCLIBC_CTOR_DTOR=y
 
 CFLAGS+=-I..
 ASFLAGS+=-I.. -D__ASSEMBLER -DASM_GLOBAL_DIRECTIVE=.globl
@@ -30,7 +30,7 @@
 
 CRT0_SRC = crt0.S
 CRT0_OBJ = crt0.o crt1.o
-#CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o
+CTOR_TARGETS=$(TOPDIR)lib/crti.o $(TOPDIR)lib/crtn.o
 
 SSRC = setjmp.S __longjmp.S vfork.S
 SOBJS = $(patsubst %.S,%.o, $(SSRC))
@@ -62,25 +62,18 @@
 	$(STRIPTOOL) -x -R .note -R .comment $*.o
 
 ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y)
-crti.o: crti.S
-	$(CC) $(ASFLAGS) -c crti.S -o crti.o
+initfini.S: initfini.c
+	$(CC) $(SAFECFLAGS) -I$(TOPDIR)include -c initfini.c -S -o initfini.S
+
+crti.S crtn.S: initfini.S initfini.awk
+	awk -f initfini.awk initfini.S
 
 $(TOPDIR)lib/crti.o: crti.o
 	$(INSTALL) -d $(TOPDIR)lib/
-	cp crti.o $(TOPDIR)lib/
-
-crtn.o: crtn.S
-	$(CC) $(ASFLAGS) -c crtn.S -o crtn.o
+	$(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o
 
 $(TOPDIR)lib/crtn.o: crtn.o
 	$(INSTALL) -d $(TOPDIR)lib/
-	cp crtn.o $(TOPDIR)lib/
-else
-$(TOPDIR)lib/crti.o:
-	$(INSTALL) -d $(TOPDIR)lib/
-	$(AR) $(ARFLAGS) $(TOPDIR)lib/crti.o
-$(TOPDIR)lib/crtn.o:
-	$(INSTALL) -d $(TOPDIR)lib/
 	$(AR) $(ARFLAGS) $(TOPDIR)lib/crtn.o
 endif
 
@@ -90,4 +83,10 @@
 clean:
 	$(RM) *.[oa] *~ core
 	$(RM) bits/sysnum.h
+	ifeq ($(strip $(UCLIBC_CTOR_DTOR)),y)
+		$(RM) initfini.S
+		$(RM) crti.S
+		$(RM) crto.S
+	endif
+
 
diff -N -r -u -x CVS -x '\.svn' vendors/config/microblaze/config.arch /opt/svn/RSC/software/linux/uClinux-dist/vendors/config/microblaze/config.arch
--- vendors/config/microblaze/config.arch	2005-08-25 10:59:09.000000000 +1000
+++ /opt/svn/RSC/software/linux/uClinux-dist/vendors/config/microblaze/config.arch	2005-08-26 09:39:51.000000000 +1000
@@ -81,6 +81,9 @@
 # compiler flags
 # this is common to both apps and libs
 
+# find where $(CROSS)gcc is living
+GCC_DIR = $(shell $(CC) -v 2>&1|grep specs|sed -e 's/.* \(.*\)specs/\1\./')
+
 # work out which gcc version we are using
 GCC_VER = $(shell $(CC) -v 2>&1|grep version|cut -d " " -f 3)
 
@@ -88,6 +91,9 @@
 GCC_MAJOR = $(shell echo $(GCC_VER) | cut -d '.' -f 1)
 GCC_MINOR = $(shell echo $(GCC_VER) | cut -d '.' -f 2)
 
+# Clear the XILINX_EDK variable - it confuses mb-gcc.. ugh
+XILINX_EDK=
+
 # old style CONFIG defines...
 ifdef CONFIG_MICROBLAZE_HARD_MULT
 	HAS_HARD_MULT := y
@@ -144,6 +150,14 @@
 	ARCH_CPUFLAGS += -mxl-soft-div
 endif
 
+GCC_LIB = $(GCC_DIR)/libgcc.a $(GCC_DIR)/../../../../microblaze/lib/libc$(LIBC_SUFFIX).a 
+
+# Set the UCFRONT_LINK_SUFFIX variable to have this tacked onto the 
+# end of the ucfront command line.  This is such a hack.
+ifeq ($(GCC_MAJOR),2)
+	UCFRONT_LINK_SUFFIX = -lc $(GCC_LIB)  -lc
+endif
+
 ############################################################################
 #
 # General purpose lib building rules,  uClibc.config uses these when
@@ -152,9 +166,6 @@
 
 ifdef UCLINUX_BUILD_LIB
 
-	# find where $(CROSS)gcc is living
-	GCCDIR = $(shell $(CC) -v 2>&1|grep specs|sed -e 's/.* \(.*\)specs/\1\./')
-
   ifdef CONFIG_LIB_DEBUG
 	CFLAGS  :=  $(if $(LOPT),$(LOPT),-O1) -g
   else
@@ -178,8 +189,6 @@
 	CFLAGS  += -D__uClinux__
 	LDFLAGS += -Wl,-elf2flt
 
-	# CFLAGS += -I$(GCCDIR)/include
-
   ifndef DISABLE_MOVE_RODATA
   	LDFLAGS += -Wl,-move-rodata
   endif
@@ -194,25 +203,6 @@
 
 ifdef UCLINUX_BUILD_USER
 
-	# Clear the XILINX_EDK variable - it confuses mb-gcc.. ugh
-	XILINX_EDK=
-
-	# find where $(CROSS)gcc is living
-	GCC_DIR = $(shell $(CC) -v 2>&1|grep specs|sed -e 's/.* \(.*\)specs/\1\./')
-
-	# mb-gcc 2.95.x requires linking against compiler's libc.a - yuck.
-	# There are four different versions, depending on the combination of 
-	# hardware barrel shift and multiplier.  
-	# Config options are used top pick out the right one
-
-	GCC_LIB = $(GCC_DIR)/libgcc.a $(GCC_DIR)/../../../../microblaze/lib/libc$(LIBC_SUFFIX).a 
-
-	# Set the UCFRONT_LINK_SUFFIX variable to have this tacked onto the 
-	# end of the ucfront command line.  This is such a hack.
-	ifeq ($(GCC_MAJOR),2)
-		UCFRONT_LINK_SUFFIX = -lc $(GCC_LIB)  -lc
-	endif
-
   ifdef BUILD_SHARED
 	LIBC          = -Wl,-R,$(ROOTDIR)/lib/libc.gdb $(SLIBC)
   endif
diff -N -r -u -x CVS -x '\.svn' vendors/Xilinx/uclinux-auto/Makefile /opt/svn/RSC/software/linux/uClinux-dist/vendors/Xilinx/uclinux-auto/Makefile
--- vendors/Xilinx/uclinux-auto/Makefile	2005-08-25 11:05:10.000000000 +1000
+++ /opt/svn/RSC/software/linux/uClinux-dist/vendors/Xilinx/uclinux-auto/Makefile	2005-09-01 09:32:50.000000000 +1000
@@ -138,7 +138,7 @@
 	done
 	# these permissions are needed for openpty and family to work
 	# on non-ptmx ptys
-	chmod 620 $(ROMFSDIR)/dev/@[pt]ty[pqrsPQRS][0-9a-f],*
+	chmod 622 $(ROMFSDIR)/dev/@[pt]ty[pqrsPQRS][0-9a-f],*
 	for i in $(FLASH_DEVICES); do \
 		touch $(ROMFSDIR)/dev/flash/@$$i; \
 	done
@@ -217,22 +217,19 @@
 
 # this is the special case, overwrite /etc/init.d/network
 ifdef CONFIG_USER_DHCPCD_NEW_DHCPCD
-ifdef CONFIG_MTD
-ifndef CONFIG_USER_FLATFSD_FLATFSD
-	$(ROMFSINST)  etc/rc/dhcpcd-new.no-resolv.conf /etc/init.d/network
-endif
-else
-	mkdir -p $(ROMFSDIR)/etc/dhcpc
-endif
+ifdef CONFIG_MTD
+ifndef CONFIG_USER_FLATFSD_FLATFSD
+	$(ROMFSINST)  etc/rc/dhcpcd-new.no-resolv.conf \
+			/etc/init.d/network
+endif
+else
+	mkdir -p $(ROMFSDIR)/etc/dhcpc
+endif
 else
 	$(ROMFSINST) etc/rc/ifconfig.lo /etc/init.d/network
-	ifdef CONFIG_NETDEVICES
-		$(ROMFSINST) etc/rc/ifconfig.eth /etc/init.d/network
-	endif
-	ifdef CONFIG_XILINX_ENET
-		$(ROMFSINST) etc/rc/ifconfig.eth /etc/init.d/network
-	endif
-endif
+	$(ROMFSINST) -e CONFIG_NETDEVICES etc/rc/ifconfig.eth /etc/init.d/network
+	$(ROMFSINST) -e CONFIG_XILINX_ENET etc/rc/ifconfig.eth /etc/init.d/network
+endif	
 
 ifdef CONFIG_USER_PORTMAP_PORTMAP
 	$(ROMFSINST) -a " " /etc/init.d/network
@@ -311,7 +308,7 @@
 $(ELFIMAGE): $(ROMFSIMG) $(LINUX)
 	BSS=`$(CROSS)objdump --headers $(LINUX) | \
 		grep "\.bss"` ; \
-	ADDR=`set -- $${BSS} ; echo 0x$${4}` ; \
+	ADDR=`set -- $${BSS} ; echo 0x$${5}` ; \
 	$(CROSS)objcopy --add-section=.romfs=$(ROMFSIMG) \
 		--adjust-section-vma=.romfs=$${ADDR} --no-adjust-warnings \
 		--set-section-flags=.romfs=alloc,load,data   \
diff -N -r -u -x CVS -x '\.svn' tools/ucfront/ucfront.c /opt/svn/RSC/software/linux/uClinux-dist/tools/ucfront/ucfront.c
--- tools/ucfront/ucfront.c	2005-08-25 10:59:09.000000000 +1000
+++ /opt/svn/RSC/software/linux/uClinux-dist/tools/ucfront/ucfront.c	2005-09-01 09:32:51.000000000 +1000
@@ -722,10 +722,23 @@
 	/* Hack by JW to allow forcing specific args right at the 
 	   end of the stripped arg list.  This works around cruftiness
 	   in mb-gcc-2.95.x, however it may be useful somewhere else */
-	if((e=getenv("UCFRONT_LINK_SUFFIX")) && (mode==MODE_LINK) ) {
-		args_add(stripped_args,e);
+	if((e=getenv("UCFRONT_LINK_SUFFIX")) && (mode==MODE_LINK) ) 
+	{
+		/* Break up potentially multiple words into substrings */
+		char *p1;
+
+		/* Duplicate the string - strtok messes with it */
+		char *e2=(char *)malloc(strlen(e)+1);
+		strcpy(e2,e);
+
+		p1=strtok(e2," ");
+
+		while(p1)
+		{
+			args_add(stripped_args,p1);
+			p1=strtok(NULL," ");
+		}
 	}
-
 }
 
 /* the main ucfront driver function */
diff -Naur -x '.*' -x '*CVS*' -x '*.o' -x '*.a' /home/wu/tmp/test/uClinux-dist-test/vendors/config/microblaze/config.arch vendors/config/microblaze/config.arch
--- /home/wu/tmp/test/uClinux-dist-test/vendors/config/microblaze/config.arch	2005-09-10 18:18:24.000000000 +1000
+++ vendors/config/microblaze/config.arch	2005-08-25 10:59:09.000000000 +1000
@@ -55,14 +55,14 @@
 CROSS_COMPILE = mb-
 CROSS         = $(CROSS_COMPILE)
 
-CC        = $(CROSS_COMPILE)gcc $(CPUFLAGS)
+CC        = ucfront-gcc $(CROSS_COMPILE)gcc $(CPUFLAGS)
 AS        = $(CROSS_COMPILE)as $(CPUFLAGS)
-CXX       = $(CROSS_COMPILE)g++ $(CPUFLAGS)
+CXX       = ucfront-g++ $(CROSS_COMPILE)g++ $(CPUFLAGS)
 AR        = $(CROSS_COMPILE)ar
 LD        = $(CROSS_COMPILE)ld
 OBJCOPY   = $(CROSS_COMPILE)objcopy
 RANLIB    = $(CROSS_COMPILE)ranlib
-ELF2FLT   = mb-elf2flt
+ELF2FLT   = $(CROSS_COMPILE)elf2flt
 STRIPTOOL = $(CROSS_COMPILE)strip
 STRIP     = $(STRIPTOOL)
 
@@ -81,6 +81,13 @@
 # compiler flags
 # this is common to both apps and libs
 
+# work out which gcc version we are using
+GCC_VER = $(shell $(CC) -v 2>&1|grep version|cut -d " " -f 3)
+
+# split into major and minor numbers
+GCC_MAJOR = $(shell echo $(GCC_VER) | cut -d '.' -f 1)
+GCC_MINOR = $(shell echo $(GCC_VER) | cut -d '.' -f 2)
+
 # old style CONFIG defines...
 ifdef CONFIG_MICROBLAZE_HARD_MULT
 	HAS_HARD_MULT := y
@@ -153,12 +160,8 @@
   else
 	CFLAGS  :=  $(if $(LOPT),$(LOPT),-O2) -g -fomit-frame-pointer
   endif
-	CFLAGS  += -Wall
-	#CFLAGS  += $(CPUFLAGS)
-	CFLAGS  += $(VENDOR_CFLAGS)
-	CFLAGS  += $(ARCH_CPUFLAGS)
-	CFLAGS  += -fno-builtin
-	CFLAGS  += -DEMBED
+	CFLAGS  += -fno-common -fno-builtin -Wall #-Werror
+	CFLAGS  += $(ARCH_CPUFLAGS) $(VENDOR_CFLAGS) -DEMBED
 
   ifdef BUILD_SHARED
 	CFLAGS  += -mid-shared-library
@@ -168,12 +171,13 @@
 	endif
   endif
 
-	CFLAGS += -nostdinc -I$(ROOTDIR)/include -I$(ROOTDIR)/include/include
 	# don't want all the CFLAGS for uClibc/Config
-	ARCH_CFLAGS = $(CFLAGS)
-	CFLAGS  += -Dlinux -D__linux__ -D__uClinux__ -Dunix
-	CXXFLAGS = $(CFALGS) $(INCCXX) -fno-exceptions
-	LDFLAGS  = $(CFLAGS) -Wl,-elf2flt
+	ARCH_CFLAGS := $(CPUFLAGS) $(CFLAGS)
+
+	CFLAGS  += -Dlinux -D__linux__ -Dunix
+	CFLAGS  += -D__uClinux__
+	LDFLAGS += -Wl,-elf2flt
+
 	# CFLAGS += -I$(GCCDIR)/include
 
   ifndef DISABLE_MOVE_RODATA
@@ -190,62 +194,55 @@
 
 ifdef UCLINUX_BUILD_USER
 
+	# Clear the XILINX_EDK variable - it confuses mb-gcc.. ugh
+	XILINX_EDK=
+
 	# find where $(CROSS)gcc is living
 	GCC_DIR = $(shell $(CC) -v 2>&1|grep specs|sed -e 's/.* \(.*\)specs/\1\./')
 
-	# find the compiler's libc.a  Note that for microblaze there are four 
-	# different versions, depending on the combination of hardware barrel
-	# shift and multiplier.  Config options are used top pick out the right one
+	# mb-gcc 2.95.x requires linking against compiler's libc.a - yuck.
+	# There are four different versions, depending on the combination of 
+	# hardware barrel shift and multiplier.  
+	# Config options are used top pick out the right one
 
 	GCC_LIB = $(GCC_DIR)/libgcc.a $(GCC_DIR)/../../../../microblaze/lib/libc$(LIBC_SUFFIX).a 
 
-	# use -lc (from uClibc) and also the compiler's libc.a as well
-	# I know this is hideous, but we need to relink against libc
-	# after the $GCC_LIB, to avoid some dependency issues
-	# Don't hate me, just fix it! :-) JW
-	
-	SLIBC	     = -lc $(GCC_LIB) -lc
+	# Set the UCFRONT_LINK_SUFFIX variable to have this tacked onto the 
+	# end of the ucfront command line.  This is such a hack.
+	ifeq ($(GCC_MAJOR),2)
+		UCFRONT_LINK_SUFFIX = -lc $(GCC_LIB)  -lc
+	endif
 
   ifdef BUILD_SHARED
 	LIBC          = -Wl,-R,$(ROOTDIR)/lib/libc.gdb $(SLIBC)
   endif
-
-	LDPATH = -L$(ROOTDIR)/lib
-
   ifdef CONFIG_USER_DEBUG
 	CFLAGS  :=  $(if $(UOPT),$(UOPT),-O1) -g
   else
 	CFLAGS  :=  $(if $(UOPT),$(UOPT),-Os) -g -fomit-frame-pointer
   endif
 
-	#CFLAGS += $(CPUFLAGS)
-	CFLAGS += -fno-common -Wall
-	CFLAGS += $(VENDOR_CFLAGS)
-	CFLAGS += $(ARCH_CPUFLAGS)
-	CFLAGS  += -Dlinux -D__linux__ -Dunix -D__uClinux__ -DEMBED
-	CFLAGS  += -nostdinc -I$(ROOTDIR)/include -I$(ROOTDIR)/include/include
-	CFLAGS  += -fno-builtin
+	CFLAGS  += -fno-common -fno-builtin -Wall #-Werror
+	CFLAGS  += $(ARCH_CPUFLAGS) $(VENDOR_CFLAGS) -DEMBED
 
-	CXXFLAGS = $(CFLAGS) $(INCCXX) -fno-exceptions
 
-	LDFLAGS = $(CFLAGS) -Wl,-elf2flt
+	# don't want all the CFLAGS for uClibc/Config
+	ARCH_CFLAGS := $(CFLAGS)
 
-  ifneq ($(LIBCDIR),libc)
-	LDFLAGS += -nostartfiles $(ROOTDIR)/lib/crt0.o
-  endif
+	CFLAGS  += -Dlinux -D__linux__ -Dunix
+	CFLAGS  += -D__uClinux__
 
-	LDFLAGS +=$(LDPATH)
+	CXXFLAGS = $(CFLAGS) -nostdinc++ -fno-exceptions
+	CXXSUP =
 
-	LDLIBS         = $(LIBC)
-	LDLIBS_static  = $(SLIBC)
-	CXXLIBS        = $(LIBSTDCPP) $(LIBIBERTY) $(LIBC) $(LIBGCC)
+#	LDFLAGS += -nostartfiles $(ROOTDIR)/$(LIBCDIR)/lib/crt0.o
+	LDFLAGS += -Wl,-elf2flt
 
   ifndef FLTFLAGS
 	FLTFLAGS :=
   endif
 	export FLTFLAGS
 
-
 	# for anyone still using it
 	CONVERT = /bin/true
 
@@ -258,6 +255,11 @@
 #
 
 ifeq ($(UCLINUX_BUILD_SET),1)
+	EXTRA_CFLAGS := $(CPUFLAGS)
+
+	CXXLIBS = $(LIBSTDCPP) $(CXXSUP)
+
+	LDLIBS = $(LIBBIND)
 endif
 
 ############################################################################
diff -Naur -x '.*' -x '*CVS*' -x '*.o' -x '*.a' /home/wu/tmp/test/uClinux-dist-test/vendors/Xilinx/uclinux-auto/config.linux-2.4.x vendors/Xilinx/uclinux-auto/config.linux-2.4.x
--- /home/wu/tmp/test/uClinux-dist-test/vendors/Xilinx/uclinux-auto/config.linux-2.4.x	2005-09-10 18:18:20.000000000 +1000
+++ vendors/Xilinx/uclinux-auto/config.linux-2.4.x	2005-08-25 10:59:09.000000000 +1000
@@ -427,7 +427,7 @@
 # CONFIG_MTD_SNAPGEODE is not set
 # CONFIG_MTD_NETteluC is not set
 # CONFIG_MTD_MBVANILLA is not set
-# CONFIG_MTD_MB_AUTO is not set
+CONFIG_MTD_MB_AUTO=y
 # CONFIG_MTD_ML401 is not set
 # CONFIG_MTD_SUZAKU is not set
 # CONFIG_MTD_KeyTechnology is not set
@@ -435,6 +435,7 @@
 # CONFIG_MTD_UCLINUX is not set
 # CONFIG_MTD_PCI is not set
 # CONFIG_MTD_PCMCIA is not set
+CONFIG_FLASH_8MB=y
 
 #
 # Self-contained MTD device drivers
diff -Naur -x '.*' -x '*CVS*' -x '*.o' -x '*.a' /home/wu/tmp/test/uClinux-dist-test/vendors/Xilinx/uclinux-auto/etc/hosts vendors/Xilinx/uclinux-auto/etc/hosts
--- /home/wu/tmp/test/uClinux-dist-test/vendors/Xilinx/uclinux-auto/etc/hosts	1970-01-01 10:00:00.000000000 +1000
+++ vendors/Xilinx/uclinux-auto/etc/hosts	2005-08-25 10:59:09.000000000 +1000
@@ -0,0 +1,3 @@
+127.0.0.1	localhost.localdomain	localhost
+
+
diff -Naur -x '.*' -x '*CVS*' -x '*.o' -x '*.a' /home/wu/tmp/test/uClinux-dist-test/vendors/Xilinx/uclinux-auto/etc/hosts.rej vendors/Xilinx/uclinux-auto/etc/hosts.rej
--- /home/wu/tmp/test/uClinux-dist-test/vendors/Xilinx/uclinux-auto/etc/hosts.rej	1970-01-01 10:00:00.000000000 +1000
+++ vendors/Xilinx/uclinux-auto/etc/hosts.rej	2005-09-10 16:30:44.000000000 +1000
@@ -0,0 +1,6 @@
+***************
+*** 0 ****
+--- 1,3 ----
++ 127.0.0.1	localhost.localdomain	localhost
++ 
++ 
diff -Naur -x '.*' -x '*CVS*' -x '*.o' -x '*.a' /home/wu/tmp/test/uClinux-dist-test/vendors/Xilinx/uclinux-auto/etc/rc/ifconfig.eth vendors/Xilinx/uclinux-auto/etc/rc/ifconfig.eth
--- /home/wu/tmp/test/uClinux-dist-test/vendors/Xilinx/uclinux-auto/etc/rc/ifconfig.eth	1970-01-01 10:00:00.000000000 +1000
+++ vendors/Xilinx/uclinux-auto/etc/rc/ifconfig.eth	2005-08-25 10:59:09.000000000 +1000
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+IP_ADDRESS=192.168.10.54
+
+PATH=/bin:/sbin:/usr/bin:/usr/sbin
+
+echo "Setting up interface lo: "
+ifconfig lo up 127.0.0.1
+
+echo "Setting up interface eth0: "
+ifconfig eth0 $IP_ADDRESS
+
diff -Naur -x '.*' -x '*CVS*' -x '*.o' -x '*.a' /home/wu/tmp/test/uClinux-dist-test/vendors/Xilinx/uclinux-auto/etc/rc/ifconfig.eth.rej vendors/Xilinx/uclinux-auto/etc/rc/ifconfig.eth.rej
--- /home/wu/tmp/test/uClinux-dist-test/vendors/Xilinx/uclinux-auto/etc/rc/ifconfig.eth.rej	1970-01-01 10:00:00.000000000 +1000
+++ vendors/Xilinx/uclinux-auto/etc/rc/ifconfig.eth.rej	2005-09-10 16:30:46.000000000 +1000
@@ -0,0 +1,15 @@
+***************
+*** 0 ****
+--- 1,12 ----
++ #!/bin/sh
++ 
++ IP_ADDRESS=192.168.10.54
++ 
++ PATH=/bin:/sbin:/usr/bin:/usr/sbin
++ 
++ echo "Setting up interface lo: "
++ ifconfig lo up 127.0.0.1
++ 
++ echo "Setting up interface eth0: "
++ ifconfig eth0 $IP_ADDRESS
++ 
diff -Naur -x '.*' -x '*CVS*' -x '*.o' -x '*.a' /home/wu/tmp/test/uClinux-dist-test/vendors/Xilinx/uclinux-auto/etc/rc/ifconfig.lo vendors/Xilinx/uclinux-auto/etc/rc/ifconfig.lo
--- /home/wu/tmp/test/uClinux-dist-test/vendors/Xilinx/uclinux-auto/etc/rc/ifconfig.lo	1970-01-01 10:00:00.000000000 +1000
+++ vendors/Xilinx/uclinux-auto/etc/rc/ifconfig.lo	2005-08-25 10:59:09.000000000 +1000
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+PATH=/bin:/sbin:/usr/bin:/usr/sbin
+
+echo "Setting up interface lo: "
+ifconfig lo up 127.0.0.1
diff -Naur -x '.*' -x '*CVS*' -x '*.o' -x '*.a' /home/wu/tmp/test/uClinux-dist-test/vendors/Xilinx/uclinux-auto/etc/rc/ifconfig.lo.rej vendors/Xilinx/uclinux-auto/etc/rc/ifconfig.lo.rej
--- /home/wu/tmp/test/uClinux-dist-test/vendors/Xilinx/uclinux-auto/etc/rc/ifconfig.lo.rej	1970-01-01 10:00:00.000000000 +1000
+++ vendors/Xilinx/uclinux-auto/etc/rc/ifconfig.lo.rej	2005-09-10 16:30:48.000000000 +1000
@@ -0,0 +1,9 @@
+***************
+*** 0 ****
+--- 1,6 ----
++ #!/bin/sh
++ 
++ PATH=/bin:/sbin:/usr/bin:/usr/sbin
++ 
++ echo "Setting up interface lo: "
++ ifconfig lo up 127.0.0.1
diff -Naur -x '.*' -x '*CVS*' -x '*.o' -x '*.a' /home/wu/tmp/test/uClinux-dist-test/vendors/Xilinx/uclinux-auto/Makefile vendors/Xilinx/uclinux-auto/Makefile
--- /home/wu/tmp/test/uClinux-dist-test/vendors/Xilinx/uclinux-auto/Makefile	2005-09-10 18:18:20.000000000 +1000
+++ vendors/Xilinx/uclinux-auto/Makefile	2005-08-25 11:05:10.000000000 +1000
@@ -40,7 +40,8 @@
 DEVICES =								      \
 	tty,c,5,0      console,c,5,1   mem,c,1,1     kmem,c,1,2    null,c,1,3 \
 									      \
-	ttyS0,c,4,64							      \
+	ttyS0,c,4,64   ttyS1,c,4,65    ttyS2,c,4,66  ttyS3,c,4,67	      \
+	rtc,c,10,135   nvram,c,10,144					      \
 									      \
 	zero,c,1,5     random,c,1,8    urandom,c,1,9			      \
 									      \
@@ -73,6 +74,16 @@
 	fslfifo6,c,10,198 fslfifo7,c,10,199
 endif
 
+ifdef CONFIG_XILINX_SYSACE                                                  
+DEVICES +=    \
+	xsysacea,b,254,0        xsysacea1,b,254,1       xsysacea2,b,254,2  \
+	xsysacea3,b,254,3       xsysacea4,b,254,4       xsysacea5,b,254,5  \
+	xsysacea6,b,254,6       xsysacea7,b,254,7       xsysacea8,b,254,8  \
+	xsysacea9,b,254,9       xsysacea10,b,254,10     xsysacea11,b,254,11 \
+	xsysacea12,b,254,12     xsysacea12,b,254,13     xsysacea14,b,254,14 \
+	xsysacea15,b,254,15 
+endif 
+       
 I2C_MAJOR = 89
 
 FLASH_DEVICES = \
@@ -116,7 +127,8 @@
 	$(ROMFSINST) -e CONFIG_USER_FLATFSD_FLATFSD \
 		-s /etc/config/fstab /etc/fstab
 
-	$(ROMFSINST) -s /etc/config/passwd /etc/passwd
+	$(ROMFSINST) -e CONFIG_USER_FLATFSD_FLATFSD \
+		-s /etc/config/passwd /etc/passwd
 
 	$(ROMFSINST) -s /bin /sbin
 
@@ -133,9 +145,9 @@
 	$(ROMFSINST) -s /var/tmp /tmp
 
 	# make I2C nodes if necessary 
-ifdef CONFIG_XILINX_IIC_0_INSTANCE
+ifdef CONFIG_I2C
 	for i in 0 1 2 3 4 5 6 7; do \
-		touch $(ROMFSDIR)/dev/i2c-$$i,c,$(I2C_MAJOR),$$i; \
+		touch $(ROMFSDIR)/dev/@i2c-$$i,c,$(I2C_MAJOR),$$i; \
 	done
 endif #IIC
 
@@ -199,7 +211,8 @@
 else
 	[ -f etc/resolv.conf ] && $(ROMFSINST) etc/resolv.conf $(ETCDIR)/resolv.conf
 	[ -f etc/hosts ] && $(ROMFSINST) etc/hosts $(ETCDIR)/hosts
-	$(ROMFSINST) -s /etc/config/hosts /etc/hosts
+	$(ROMFSINST) -e CONFIG_USER_FLATFSD_FLATFSD \
+		-s /etc/config/hosts /etc/hosts
 endif
 
 # this is the special case, overwrite /etc/init.d/network
@@ -212,7 +225,13 @@
 	mkdir -p $(ROMFSDIR)/etc/dhcpc
 endif
 else
-	$(ROMFSINST) etc/rc/ifconfig /etc/init.d/network
+	$(ROMFSINST) etc/rc/ifconfig.lo /etc/init.d/network
+	ifdef CONFIG_NETDEVICES
+		$(ROMFSINST) etc/rc/ifconfig.eth /etc/init.d/network
+	endif
+	ifdef CONFIG_XILINX_ENET
+		$(ROMFSINST) etc/rc/ifconfig.eth /etc/init.d/network
+	endif
 endif
 
 ifdef CONFIG_USER_PORTMAP_PORTMAP