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

Re: RE :RE : [microblaze-uclinux] Kernell Boot Error on SpartanIIELC



Hi David

>This patch does not seem to work well with the CVS source. When I patch it,
>I got,
>
>patch -p0 < ../uClinux-dist.diff
>(Stripping trailing CRs from patch.)
>patching file vendors/config/microblaze/config.arch
>Hunk #1 FAILED at 81.
>Hunk #2 succeeded at 84 with fuzz 2 (offset -7 lines).
>Hunk #4 succeeded at 159 (offset -7 lines).
>Hunk #5 FAILED at 182.
>Hunk #6 FAILED at 196.
>3 out of 6 hunks FAILED -- saving rejects to file
>vendors/config/microblaze/config.arch.rej
>(Stripping trailing CRs from patch.)
>patching file vendors/Xilinx/uclinux-auto/Makefile
>Hunk #1 succeeded at 126 (offset -12 lines).
>Hunk #2 FAILED at 205.
>Hunk #3 succeeded at 301 (offset -7 lines).
>1 out of 3 hunks FAILED -- saving rejects to file
>vendors/Xilinx/uclinux-auto/Makefile.rej
>(Stripping trailing CRs from patch.)
>patching file tools/ucfront/ucfront.c
>Hunk #1 FAILED at 722.
>1 out of 1 hunk FAILED -- saving rejects to file tools/ucfront/ucfront.c.rej
>
>  
>
I just did a clean CVS download from John's machine and only apply 
uClinux-dist.diff. There were no errors during patch. Maybe you can try 
to make a clean download of uClinux-dist, see if this works.

>I manually fixed the Makefile. Then here we go,
>
>gzio.c:10: stdio.h: No such file or directory
>In file included from gzio.c:12:
>zutil.h:19: stddef.h: No such file or directory
>zutil.h:20: string.h: No such file or directory
>zutil.h:21: stdlib.h: No such file or directory
>zutil.h:26: errno.h: No such file or directory
>gzio.c:523: stdarg.h: No such file or directory
>make[2]: *** [gzio.o] Error 1
>make[2]: Leaving directory `/home/deli/uclinux/src/uClinux-dist/lib/zlib'
>make[1]: *** [all] Error 2
>make[1]: Leaving directory `/home/deli/uclinux/src/uClinux-dist/lib'
>make: *** [subdirs] Error 1
>
>
>
>I got similar error. And I believe I have zlib and zlib-devel installed.
>
>$ rpm -q zlib
>zlib-1.1.4-8.1
>$ rpm -q zlib-devel
>zlib-devel-1.1.4-8.1
>
>BTW, how would the zlib and zlib-devel on my host computer affect the cross
>compiling of another kernel? Do I need to checkout a kind of "uCLinux" copy
>of the zlib separately from the CVS procedure? Please advise.
>  
>
uClinux still need zlib to compressed the data (most likely for MTD and 
JFFS2 support).
I got similar problem before, everything sort out after i install zlib, 
zlib-devel and few other packages (can't remember right now O:-) ) .
 From the error message, you can try install "dev86" package, see if it 
works.

The simplex way is to install complete Linux development tools so you 
don't have to figure out which included files are missing.

cheers,

Jason

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 */