[U-Boot-Users] Can't Compile u-boot-1.1.5_atmel_1.2!!

Hi!
I am trying to compile u-boot-1.1.5 for at91sam9261ek with arm926ejs cpu. I am using the eldk cross toolchain 4.1 which is using gcc 4.0.0. When I try to compile u-boot I get following error
25an@25an-desktop :/opt/x-compile/eldk/workingarea/u-boot-1.1.5_atmel_1.2$make ARCH=arm CROSS_COMPILE=arm-linux- for dir in tools examples post post/cpu ; do make -C $dir _depend ; done make[1]: Entering directory `/opt/x-compile/eldk/workingarea/u- boot-1.1.5_atmel_1.2/tools' make[1]: Nothing to be done for `_depend'. make[1]: Leaving directory `/opt/x-compile/eldk/workingarea/u- boot-1.1.5_atmel_1.2/tools' make[1]: Entering directory `/opt/x-compile/eldk/workingarea/u- boot-1.1.5_atmel_1.2/examples' make[1]: Nothing to be done for `_depend'. make[1]: Leaving directory `/opt/x-compile/eldk/workingarea/u- boot-1.1.5_atmel_1.2/examples' make[1]: Entering directory `/opt/x-compile/eldk/workingarea/u- boot-1.1.5_atmel_1.2/post' make[1]: Nothing to be done for `_depend'. make[1]: Leaving directory `/opt/x-compile/eldk/workingarea/u- boot-1.1.5_atmel_1.2/post' make[1]: Entering directory `/opt/x-compile/eldk/workingarea/u- boot-1.1.5_atmel_1.2/post/cpu' make[1]: Nothing to be done for `_depend'. make[1]: Leaving directory `/opt/x-compile/eldk/workingarea/u- boot-1.1.5_atmel_1.2/post/cpu' make -C tools all make[1]: Entering directory `/opt/x-compile/eldk/workingarea/u- boot-1.1.5_atmel_1.2/tools' make[1]: Leaving directory `/opt/x-compile/eldk/workingarea/u- boot-1.1.5_atmel_1.2/tools' make -C examples all make[1]: Entering directory `/opt/x-compile/eldk/workingarea/u- boot-1.1.5_atmel_1.2/examples ' arm-linux-gcc -g -Os -fno-strict-aliasing -fno-common -ffixed-r8 -msoft-float -fno-strict-aliasing -fno-common -ffixed-r8 -msoft-float -D__KERNEL__ -DTEXT_BASE=0x23f00000 -I/opt/x-compile/eldk/workingarea/u- boot-1.1.5_atmel_1.2/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/x-compile/eldk/usr/bin/../lib/gcc/arm-linux/4.0.0/include -pipe -DCONFIG_ARM -D__ARM__ -march=armv4 -mabi=apcs-gnu -mapcs-32 -march=armv5te -mtune=arm926ejs -Wall -Wstrict-prototypes -c -o hello_world.o hello_world.c
cc1: error: invalid option 'apcs-32' hello_world.c:1: error: bad value (arm926ejs) for -mtune= switch make[1]: *** [hello_world.o] Error 1 make[1]: Leaving directory `/opt/x-compile/eldk/workingarea/u- boot-1.1.5_atmel_1.2/examples' make: *** [examples] Error 2
Any ideas? I would also appreciate any suggestion how to locate the error since right now I have not even managed to locate were the flag is set.
Thanks

Hi Måns,
On 27.02.2007 09:49, Måns Zigher wrote:
Hi!
I am trying to compile u-boot-1.1.5 for at91sam9261ek with arm926ejs cpu. I am using the eldk cross toolchain 4.1 which is using gcc 4.0.0. When I try to compile u-boot I get following error
[snip]
Any ideas?
Use the latest U-Boot sources from http://www.denx.de/en/Software/GIT.
I would also appreciate any suggestion how to locate the error since right now I have not even managed to locate were the flag is set.
The CPU-specific flags are set by including cpu/arm926ejs/config.mk in the Makefile.
Regards, Daniel

I manged to solve the problem but now I get another one. The first problem was solved by edit the cpu/arm926ejs/at91sam926x/config.mk file accordingly
#PLATFORM_CPPFLAGS += -mapcs-32 -march=armv5te -mtune=arm926ejs PLATFORM_CPPFLAGS += -march=armv5te -Wa,-mapcs-32 -mtune=arm926ej-s
the first error was fixed by changing the -mtune option from arm926ejs till arm926ej-s the second error was fixed by changing -mapcs-32 with -Wa,-mapcs-32 this was done after reading following post
http://www.at91.com/phpbb/viewtopic.php?t=2312
-mapcs-32 option generates code for a processor running with a 32-bit program counter and conforming to the function calling standards for the APCS 32-bit option If interested in what APCS is google after ARM APCS.
the option -Wa,-mapcs-32 is doing the following
-Wa,option Pass option as an option to the assembler. If option contains commas, it is split into multiple options at the commas.
Now the error that I am getting is
usb_ohci.c: In function 'usb_lowlevel_init': usb_ohci.c:1659: error: invalid lvalue in assignment make[1]: *** [usb_ohci.o] Error 1 make[1]: Leaving directory `/opt/x-compile/eldk/workingarea/u-boot-1.1.5_atmel_1.2/cpu/arm926ejs/at91sam926x' make: *** [cpu/arm926ejs/at91sam926x/libat91sam926x.a] Error 2
Again any help is appreciated
Daniel Hobi wrote:
Hi Måns,
On 27.02.2007 09:49, Måns Zigher wrote:
Hi!
I am trying to compile u-boot-1.1.5 for at91sam9261ek with arm926ejs cpu. I am using the eldk cross toolchain 4.1 which is using gcc 4.0.0. When I try to compile u-boot I get following error
[snip]
Any ideas?
Use the latest U-Boot sources from http://www.denx.de/en/Software/GIT.
I would also appreciate any suggestion how to locate the error since right now I have not even managed to locate were the flag is set.
The CPU-specific flags are set by including cpu/arm926ejs/config.mk in the Makefile.
Regards, Daniel
Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=D... _______________________________________________ U-Boot-Users mailing list U-Boot-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/u-boot-users

Hi Måns,
On 27.02.2007 15:23, 25an wrote:
I manged to solve the problem but now I get another one. The first problem was solved by edit the cpu/arm926ejs/at91sam926x/config.mk file accordingly
#PLATFORM_CPPFLAGS += -mapcs-32 -march=armv5te -mtune=arm926ejs PLATFORM_CPPFLAGS += -march=armv5te -Wa,-mapcs-32 -mtune=arm926ej-s
I suggest not using -mtune at all, it will most likely not produce different (more efficient) code than using -march=armv5te alone when compiling U-Boot.
The gcc flag -mapcs-32 was deprecated since gcc-3.4.0 and finally removed in gcc-4.0.0 which unconditionally generates 32bit ARM code. You should not need to pass this flag to the assembler either.
Now the error that I am getting is
usb_ohci.c: In function 'usb_lowlevel_init': usb_ohci.c:1659: error: invalid lvalue in assignment make[1]: *** [usb_ohci.o] Error 1 make[1]: Leaving directory `/opt/x-compile/eldk/workingarea/u-boot-1.1.5_atmel_1.2/cpu/arm926ejs/at91sam926x' make: *** [cpu/arm926ejs/at91sam926x/libat91sam926x.a] Error 2
Again, update to a more recent version of U-Boot. Or, if that is not possible, use an older toolchain/compiler (for example gcc-3.4.6 should work with U-Boot 1.1.5).
U-Boot 1.1.5 DOES NOT WORK with gcc-4.x! Expect more (hidden) problems!
Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64
Please post plain-text messages to this list.
Regards, Daniel

Recompiled u-boot-1.1.5_atmel_1.2 with gcc version 3.3.3 (DENX ELDK 3.1.1 3.3.3-9) with config PLATFORM_CPPFLAGS += -march=armv5te -mapcs-32 and it passed.
Couldn't get a patch for my board for git u-boot..
Tnx Daniel Take care Måns

Ok I managed to compile u-boot-1.1.5_armel_1.2 with ELDK 4.1 and gcc 4.0. I solved it by the editing the following files.
In the main Makefile at line 228 i removed the example
from:
SUBDIRS = tools \ examples \ post \ post/cpu
to:
SUBDIRS = tools \ post \ post/cpu .PHONY : $(SUBDIRS)
then I edit in the file cpu/arm926ejs/at91sam926x/config.mk
from:
PLATFORM_CPPFLAGS += -mapcs-32 -march=armv5te -mtune=arm926ejs
to:
PLATFORM_CPPFLAGS += -march=armv5te -Wa,-mapcs-32 -mtune=arm926ej-s
and then in the file cpu/arm926ejs/at91sam926x/usb_ohci.c at line 1659
from:
writel (gohci.hc_control = OHCI_USB_RESET, &gohci.regs->control);
to:
gohci.hc_control = OHCI_USB_RESET; writel (gohci.hc_control, &gohci.regs->control);
now I passed the compilation but I have not yet tried it on the board but I will let you know if it worked or not. I you have the same problem try this or compile it with ELDK 3.1 which is using gcc 3.3.3

It worked!
25an wrote:
Ok I managed to compile u-boot-1.1.5_armel_1.2 with ELDK 4.1 and gcc 4.0. I solved it by the editing the following files.
In the main Makefile at line 228 i removed the example
from:
SUBDIRS = tools \ examples \ post \ post/cpu .PHONY : $(SUBDIRS)
to:
SUBDIRS = tools \ post \ post/cpu .PHONY : $(SUBDIRS)
then I edit in the file cpu/arm926ejs/at91sam926x/config.mk
from:
PLATFORM_CPPFLAGS += -mapcs-32 -march=armv5te -mtune=arm926ejs
to:
PLATFORM_CPPFLAGS += -march=armv5te -Wa,-mapcs-32 -mtune=arm926ej-s
and then in the file cpu/arm926ejs/at91sam926x/usb_ohci.c at line 1659
from:
writel (gohci.hc_control = OHCI_USB_RESET, &gohci.regs->control);
to:
gohci.hc_control = OHCI_USB_RESET; writel (gohci.hc_control, &gohci.regs->control);
now I passed the compilation but I have not yet tried it on the board but I will let you know if it worked or not. I you have the same problem try this or compile it with ELDK 3.1 which is using gcc 3.3.3
participants (3)
-
25an
-
Daniel Hobi
-
Måns Zigher