[U-Boot-Users] u-boot compilation problem

Hi all,
I am porting the U-boot to my custom board which is arm based. While building the u-boot i get the following compilation error.
armv5b-softfloat-linux-gcc -g -Os -fno-strict-aliasing -fno-common -ffixed-r8 -msoft-float -D__KERNEL__ -DTEXT_BASE=0x00780000 -I/root/isl/heron_old/u-boot-1.1.1/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/crosstool/armv5b-softfloat-linux/gcc-3.4.1-glibc-2.3.3/lib/gcc/armv5b-softfloat-linux/3.4.1/include -pipe -DCONFIG_ARM -D__ARM__ -mapcs-32 -march=armv5te -mbig-endian -Wall -Wstrict-prototypes -c -o hello_world.o hello_world.c armv5b-softfloat-linux-ld -g -EB -Ttext 0x000007fc0 \ -o hello_world -e hello_world hello_world.o libstubs.a \ -L/opt/crosstool/armv5b-softfloat-linux/gcc-3.4.1-glibc-2.3.3/lib/gcc/armv5b-softfloat-linux/3.4.1 -lgcc hello_world.o(.text+0x1c): In function `hello_world': /root/isl/heron_old/u-boot-1.1.1/examples/hello_world.c:44: undefined reference to `printf' hello_world.o(.text+0x20):/root/isl/heron_old/u-boot-1.1.1/examples/hello_world.c:45: undefined reference to `get_version' hello_world.o(.text+0x2c):/root/isl/heron_old/u-boot-1.1.1/examples/hello_world.c:45: undefined reference to `printf' hello_world.o(.text+0x34):/root/isl/heron_old/u-boot-1.1.1/examples/hello_world.c:47: undefined reference to `printf' hello_world.o(.text+0x44):/root/isl/heron_old/u-boot-1.1.1/examples/hello_world.c:49: undefined reference to `printf' hello_world.o(.text+0x6c):/root/isl/heron_old/u-boot-1.1.1/examples/hello_world.c:52: undefined reference to `printf'
Any clue what this problem can Be?
Thanks and regards, Pradip
Yahoo! India Matrimony: Find your life partneronline.

Any clue what this problem can Be?
An undefined reference to printf? Sometimes compiler errors _do_ give useful messages.
It looks to me you are not linking with the file where 'printf' is implemented in.
quick-n-dirty: put the following in your file >:) #define printf(args...) do { } while(0)

In message 20041126060937.99611.qmail@web8502.mail.in.yahoo.com you wrote:
I am porting the U-boot to my custom board which is arm based. While building the u-boot i get the following compilation error.
What did you change for your port?
armv5b-softfloat-linux-gcc -g -Os -fno-strict-aliasing -fno-common -ffixed-r8 -msoft-float -D__KERNEL__ -DTEXT_BASE=0x00780000 -I/root/isl/heron_old/u-boot-1.1.1/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/crosstool/armv5b-softfloat- linux/gcc-3.4.1-glibc-2.3.3/lib/gcc/armv5b-softfloat-linux/3.4.1/include -pipe -DCONFIG_ARM -D__ARM__ -mapcs-32 -march=armv5te -mbig-endian -Wall -Wstrict-prototypes -c -o hello_world.o hello_world.c armv5b-softfloat-linux-ld -g -EB -Ttext 0x000007fc0 \
^^^^^^^^^^^
For example, where is this address coming from?
Any clue what this problem can Be?
Since it compiles find with working toolchains for the existing boards the problem is either in your modifications to the code and/or in your toolchain.
Can you compile your modified code using a working toolchain (like ELDK 3.1) ?
Can you compile other ARM boards using your own toolchain?
--0-87651495-1101449377=:95334 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit
<DIV> <DIV>Hi all,</DIV>
NEVER, NEVER ever post HTML again!
Best regards,
Wolfgang Denk

Hi,
Ya I agree that address is wrong 0x000007fc0. Actually in the U-boot example directory Makefile there is a macro LOAD_ADDR. I wanted the hellow_world program to load at address 0x00007fc0. Hence I thought that by changing this macro i may be able to achive my objective. Is my asumption correct? I am relocating the u-boot code at address 0x0078000. Also When i am going through the U-boot examples directory Makfile I find that hello_world is not getting linked with libcommon.a which is having this printf. So i tried also linking with libcommon.a but it seems it has a lot of dipendencies on other libraries. I donot suspect the tool chain becouse the U-boot builds and also runs fine when i remove the compilation of example directory. I want to compile this hello world example to see that i am able to run a program from memory using go command.
Also I want the printf in Hello_world so that i can see some output on my console. thanks and regards, Pradip
Wolfgang Denk wd@denx.de wrote: In message 20041126060937.99611.qmail@web8502.mail.in.yahoo.com you wrote:
I am porting the U-boot to my custom board which is arm based. While building the u-boot i get the following compilation error.
What did you change for your port?
armv5b-softfloat-linux-gcc -g -Os -fno-strict-aliasing -fno-common -ffixed-r8 -msoft-float -D__KERNEL__ -DTEXT_BASE=0x00780000 -I/root/isl/heron_old/u-boot-1.1.1/include -fno-builtin -ffreestanding -nostdinc -isystem /opt/crosstool/armv5b-softfloat- linux/gcc-3.4.1-glibc-2.3.3/lib/gcc/armv5b-softfloat-linux/3.4.1/include -pipe -DCONFIG_ARM -D__ARM__ -mapcs-32 -march=armv5te -mbig-endian -Wall -Wstrict-prototypes -c -o hello_world.o hello_world.c armv5b-softfloat-linux-ld -g -EB -Ttext 0x000007fc0 \
^^^^^^^^^^^
For example, where is this address coming from?
Any clue what this problem can Be?
Since it compiles find with working toolchains for the existing boards the problem is either in your modifications to the code and/or in your toolchain.
Can you compile your modified code using a working toolchain (like ELDK 3.1) ?
Can you compile other ARM boards using your own toolchain?
--0-87651495-1101449377=:95334 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit
Hi all,
NEVER, NEVER ever post HTML again!
Best regards,
Wolfgang Denk

In message 20041126085345.30072.qmail@web8509.mail.in.yahoo.com you wrote:
Ya I agree that address is wrong 0x000007fc0. Actually in the U-boot example directory Makefile there is a macro LOAD_ADDR. I wanted the hellow_world program to load at address 0x00007fc0. Hence I thought that by changing this macro i may be able to a
Please use shorter lines!! Read the Netiquette!
Are you sure that there is free memory at this address?? What does your memory map look like?
chive my objective. Is my asumption correct? I am relocating the u-boot code at address 0x0078000. Also When i am going through the U-boot examples directory Makfile I find that hello_world is not getting linked with libcommon.a which is having this pr intf. So i tried also linking with libcommon.a but it seems it has a lot of dipendencies on other libraries. I donot suspect the tool chain becouse the U-boot builds and also runs fine when i remove the compilation of example directory. I want to compil
Please don;t try to do thinks which you don't understand. Standalone applications do not link against the U-boot libraries. Please RTFM.
For a start, read doc/README.standalone
Also I want the printf in Hello_world so that i can see some output on my console.
Why don't you just leave the code as is? It is working fine in it's current state. Your modifications just broke it.
Please note that in my previous message I wrote:
NEVER, NEVER ever post HTML again!
AND WHAT ARE YOU DOING?????
Yahoo! India Matrimony: Find your life partneronline. --0-359146068-1101459225=:30010 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit
<DIV>Hi,</DIV>
It is a requirement on this mailing list that you DO NOT POST HTML.
Please accept this rule.
DO NOT POST HTML.
Wolfgang Denk
participants (3)
-
Marc Leeman
-
Pradip Singh
-
Wolfgang Denk