2010-07-10 18:49:25     Kernel compile error (flat vs. elf)

Document created by Aaronwu Employee on Aug 22, 2013
Version 1Show Document
  • View in full screen mode

2010-07-10 18:49:25     Kernel compile error (flat vs. elf)

Wojtek Skulski (UNITED STATES)

Message: 91129   

 

Hi: this is the first attempt to build the uCLinux kernel under a fresh installation of both the toolchain and the kernel. It fails with what looks like a make file problem. The compilation trace is attached. I installed the following files:

 

u-boot-2008.10-2009R1.1-rc1.tar.bz2    (did not try to compile yet)

 

uClinux-dist-2009R1.1-RC4.tar.bz2

 

blackfin-toolchain-09r1.1-2.i386.tar.bz2  (FLAT toolchain)

 

I unpacked the toolchain as root. I unpacked the kernel and the uBoot as user uclinux. I ran the compilation as a regular user uclinux. Before attempting to compile I typed "make menuconfig", selected Analog Devices as the vendor, and selected BF561 EZ-KIT. I also selected silicon revision 0.5 and disabled Core B. After leaving menuconfig I typed "make". It failed. Then I typed "make clean", "make menuconfig" again. It turned out that the settings were remembered, so I quit menuconfig and again typed "make". It failed again with the same error message. The error is that the ELF is attempted, while the installed toolchain is FLAT. See the attached file with the compilation trace.

 

bfin-elf-gcc -pipe -Wall -g -O2      -mcpu=bf561-0.5 -Wall -mmulticore -mcoreb   -c -o test_c.o test_c.c

make[5]: bfin-elf-gcc: Command not found

 

Why did the build process go that far, and suddenly it attempted to invoke ELF? Any suggestions what to do?

 

Kernel_Compile_Error2.txt

QuoteReplyEditDelete

 

 

2010-07-10 20:55:03     Re: Kernel compile error (flat vs. elf)

Wojtek Skulski (UNITED STATES)

Message: 91130   

 

As much as I am afraid to even look at these makefiles (not my specialty), I did have a look. The bug is in the Makefile in the directory

 

/home/uclinux/uClinux-dist/user/blkfin-apps/corebld/example

 

That file starts like this right at the top:

 

CC = bfin-elf-gcc

CXX = bfin-elf-g++

 

So the selection of the toolchain, flat vs. elf, is disregarded in that makefile. Now I start wondering how come this release has ever compiled at all?

QuoteReplyEditDelete

 

 

2010-07-11 02:39:09     Re: Kernel compile error (flat vs. elf)

Mike Frysinger (UNITED STATES)

Message: 91132   

 

you didnt install the package that includes bfin-elf.  please review the documentation:

https://docs.blackfin.uclinux.org/doku.php?id=toolchain:installing

QuoteReplyEditDelete

 

 

2010-07-11 10:50:55     Re: Kernel compile error (flat vs. elf)

Wojtek Skulski (UNITED STATES)

Message: 91143   

 

Mike:

 

"you didnt install the package that includes bfin-elf". Sure I did not, and deliberately so. I followed the advice from the following page:   docs.blackfin.uclinux.org/doku.php?id=toolchain:targets

 

When describing the bfin-elf, the page says "bare metal", and also "Since most people will be working with Linux, there is no need for them to even install the bfin-elf toolchain."

 

The same page says: "The bfin-uclinux toolchain is the default one used in the uClinux distribution."

 

So now you got me thorougly confused. So which toolchain is meant for doing what? Which toolchain should I install, bfin-uclinux, bfin-elf, or both?

QuoteReplyEditDelete

 

 

2010-07-11 14:08:57     Re: Kernel compile error (flat vs. elf)

Mike Frysinger (UNITED STATES)

Message: 91145   

 

you attempted to build a bare metal application (coreb example).  if you dont want to do that, then disable it in your configuration.

QuoteReplyEditDelete

 

 

2010-07-11 15:22:29     Re: Kernel compile error (flat vs. elf)

Robin Getz (UNITED STATES)

Message: 91146   

 

Wojtek:

 

The example /home/uclinux/uClinux-dist/user/blkfin-apps/corebld/example is a bare metal example for core B. Building bare metal examples require the bfin-elf toolchain. If - as Mike suggested - you don't want that - don't select the example.

 

-Robin

QuoteReplyEditDelete

 

 

2010-07-11 21:23:38     Re: Kernel compile error (flat vs. elf)

Wojtek Skulski (UNITED STATES)

Message: 91152   

 

Mike and Robin:

 

thank you for the explanation. I am not sure at which point I selected that example. Surely it was not intentional. I removed it from the makefile by hand and the kernel compiled successfully. So my board is now one step closer to detecting those extraterrestial particles ;-)

 

Thank you -

Outcomes