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

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



hi Calayrac

>Thanks for your help. I’ve proceed to the change in the mhs file as you 
>recommand.
>But now when I compile I obtain a error. (I’m afraid its due to the cvs update 
>of uClinux-dist and uClinux-2.4.x).
>I previoulsy have compilation error fixed when I apply the patch
>http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux/Downloads/patches.html
>
>If I try to apply this patch again it comes out with error message (I supposed 
>that its part o the update know).
>
>  
>
if you are using current CVS (2.4.31.u0) with mb-gcc-3.4, you are 
required to apply the latest patch (uClinux-dist.diff) from john.

>The actual error message is:
>make[2]: Entering directory
>
>`/home/alayrac/uClinux-2.4.x/arch/microblaze/kernel'make[2]: *** Pas de règle 
>pour fabriquer la cible « /usr/local/MicroBlaze-elf-tools/bin/../lib/gcc-
>lib/microblaze/2.95.3-4/include/stdarg.h
>
>», nécessaire pour « microblaze_defs.h ». Arrêt.
>make[2]: Leaving directory `/home/alayrac/uClinux-2.4.x/arch/microblaze/kernel'
>make[1]: *** [_dir_arch/microblaze/kernel] Erreur 2
>make[1]: Leaving directory `/home/alayrac/uClinux-2.4.x'
>make: *** [linux] Erreur 1
>
>  
>
Jason
--- Begin Message ---
Hi David,

There is a bunch of small patches pending in the SnapGear tree that have
not yet made it to the public CVS for uClinux-dist.

Can you please try the attached patch?

Regards,

John

Deli Geng (David) wrote:

> Hi, there,
> 
> I got some errors on making the uClinux for MicroBlaze.
> 
> I'm using microblaze-elf-tools-20050308 and the source checked out from the
> CVS. 
> 
> First, when I type "make" after all the configuration (Xilinx ML401). I got
> an "ln" error in the dist/include folder. The message said "include/gcc"
> already exists when trying to create the symbol link. So I changed the "ln
> -s" in the Makefile to "ln -sf". The making then passed this stage.
> 
> However, I got another error in the dist/lib/zlib folder. It complained
> about not being able to find some include files, e.g. "string.h". I found
> there is the "-nostdinc" option. OK, I manually compiled it without the
> "-nostdinc" option. It passed anyway. But I'm still wondering if it is
> really ok?????
> 
> Next, there is a similar error as attached. It looks like the similar error
> with the zlib folder. However, I don't think it's a good idea to keep
> manually compiling it.
> 
> So my questions are:
> 
> 1. Will the force link "ln -sf" cause the later "include file can not find"
> problem?
> 
> 2. Is the source checked from CVS reliable? Or I should apply some patch
> first? BTW, the MicroBlaze-vendors-20050215.patch does not work well with
> the CVS source.
> 
> 3. Is there any special procedure for setting up the microblaze-elf-tools so
> that some include files can be "seen" even with the "-nostdinc" option?
> 
> I feel it might just several lines setting up things. Could anyone shed me
> some light on it?
> 
> Apologize in advance if I asked stupid questions as a freshman.
> 
> Thanks a lot for any help.
> 
> Regards
> David
> 
> Attached the error message.
> 
> make[2]: Entering directory
> `/home/deli/uclinux/src/uClinux-dist/user/agetty'
> mb-gcc  -Os -g -fomit-frame-pointer -fno-common -Wall   -mno-xl-soft-mul
> -mxl-barrel-shift -mno-xl-soft-div -Dlinux -D__linux__ -Dunix -D__uClinux__
> -DEMBED -nostdinc -I/home/deli/uclinux/src/uClinux-dist/include
> -I/home/deli/uclinux/src/uClinux-dist/include/include -fno-builtin
> -D__USE_BSD   -c -o agetty.o agetty.c
> agetty.c:13: stdio.h: No such file or directory
> agetty.c:14: unistd.h: No such file or directory
> agetty.c:15: stdlib.h: No such file or directory
> agetty.c:16: sys/ioctl.h: No such file or directory
> agetty.c:17: termio.h: No such file or directory
> agetty.c:18: signal.h: No such file or directory
> agetty.c:19: errno.h: No such file or directory
> agetty.c:20: sys/types.h: No such file or directory
> agetty.c:21: sys/stat.h: No such file or directory
> agetty.c:22: fcntl.h: No such file or directory
> agetty.c:23: stdarg.h: No such file or directory
> agetty.c:24: ctype.h: No such file or directory
> agetty.c:25: utmp.h: No such file or directory
> agetty.c:26: getopt.h: No such file or directory
> agetty.c:27: memory.h: No such file or directory
> agetty.c:28: sys/file.h: No such file or directory
> agetty.c:31: sys/param.h: No such file or directory
> agetty.c:39: syslog.h: No such file or directory
> 
> 
> ___________________________
> 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/


-- 
Dr John Williams, Research Fellow,
Embedded Systems Group / Reconfigurable Computing
School of ITEE, The University of Queensland, Brisbane, Australia
(p) +61 7 33652185  (f) +61 7 33654999 (m) +61 403969243
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 */
--- End Message ---