Task #8 - Build kernel manually using created toolchain

Showing results for 
Search instead for 
Did you mean: 

Task #8 - Build kernel manually using created toolchain

Task #8 - Build kernel manually using created toolchain

After bitbake meta-toolchain the script to install the toolchain package is located under

$ ls tmp/deploy/sdk/poky-eglibc-x86_64-arm-toolchain-1.4.1.sh


In order to install it:

$ source poky-eglibc-x86_64-arm-toolchain-1.4.1.sh

    [sudo] password for daiane:

    Enter target directory for SDK (default: /opt/poky/1.4.1):

    You are about to install the SDK to "/opt/poky/1.4.1". Proceed[Y/n]?y

    Extracting SDK...done

    Setting it up...done

    SDK has been successfully set up and is ready to be used.

Hello World

$ source /opt/poky/1.4.1/environment-setup-armv7a-vfp-neon-poky-linux-gnueabi

$ cd ~/test/

$ arm-poky-linux-gnueabi-gcc helloworld.c

$ ls

a.out                                                 helloworld.c                          

$ ./a.out

-bash: ./a.out: cannot execute binary file

$ file a.out

a.out: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.16, not stripped


$ source /opt/poky/1.4.1/environment-setup-armv7a-vfp-neon-poky-linux-gnueabi

$ cd linux-2.6-imx

$ git checkout remotes/origin/imx_3.0.35

$ export ARCH=arm


$ unset LDFLAGS

$ make imx6_defconfig

$ make uImage

Make sure to have mkimage available on bin patch (if using mkimage from u-boot export its patch)

Or, download the ubuntu pachage:

sudo apt-get install uboot-mkimage


You may find the following error:

  OBJCOPY arch/arm/boot/zImage

  Kernel: arch/arm/boot/zImage is ready

multiple (or no) load addresses:

This is incompatible with uImages

Specify LOADADDR on the commandline to build an uImage

make[1]: *** [arch/arm/boot/uImage] Error 1

make: *** [uImage] Error 2

This is regarding a missing LOADADDR for mkimage to use to generate uImage with the right offset to be placed in the right LOADADDR.

The address value is dependent on your hardware! And it is different depending on imx6 variations. So please be aware regarding what is your right value.

If the machine you are using is supported in yocto project/meta-fsl-arm, for example, you can find the value related with your board in the file conf/machine/include/imx-base.inc or online here meta-fsl-arm - Layer containing Freescale ARM hardware support metadata

It is the same value used in variable UBOOT_ENTRYPOINT.

For example as of this writing for the Freescale SABRE-SD board looking in conf/machine/include/imx-base.inc

UBOOT_ENTRYPOINT_mx6  = "0x10008000"

Thus the build command would be:

$ make uImage LOADADDR=0x10008000

So, as a quick reference table, I point here the 3 most wanted make command lines:


$ make LOADADDR=0x40008000


$ make LOADADDR=0x70008000


$ make LOADADDR=0x10008000

Update 2

Suggested by cmcqueen1975

Building an autotools-based package. E.g.

$ source /opt/poky/1.4.1/environment-setup-armv7a-vfp-neon-poky-linux-gnueabi

$ ./configure ${CONFIGURE_FLAGS}

$ make

$ make install

the CONFIGURE_FLAGS is the variable depending on your very-own project.

Go to Yocto Training - HOME

Go to Task #7 - Create the toolchain

Labels (1)


Your Hello World output above above shows an error?

"-bash: ./a.out: cannot execute binary file"

Is it a typo or intentional?


it's intentional. You cannot run a ARM file on your i686 host machine :smileywink:

On Fedora 17 x86_64, sourcing poky-eglibc-x86_64-arm-toolchain-1.4.1.sh doesn't work.  The script has to be executed directly.  I learned that the hard way.

Did you find the reason? sh version?


No clue Leo. 

Dear DaianeAngolini DaianeAngolini

     This task teach me how to build something by using created toolchain.

     may I ask you some question something about hardFP.

     1, Can i consider this toolchain is based on hard float-point ?

          the app "helloworld.c" and kernel builded is based on hardFP?

     2, I have finished the topic "How to Test Yocto for i.MX6" written by you.

          could I consider that all of the "rootfs,kernel u-boot" compiled in the yocto project is based on hardFP?

     am i right? correct me ?

what i exactly need is that I need my IMX6 BSP support hardFP.

as I know, LTIB just supports softFP toolchain.

would you pls give some advices how can I make my IMX6 bsp to support hardFP and keep hardFP enable?

thank you kindly.


meta-fsl-arm, *today* is SFP for all boards, imx5, imx28, imx6. We don't have *today* support for hard fp.

But, if you take a look on meta-fsl-arm, branch master-next, you see this commit meta-fsl-arm - Layer containing Freescale ARM hardware support metadata

This is the commit that includes hfp support for imx6 only. It's on master-next because it's under test. As soon as it was tested, it will be merged on master.

The sfp/hfp is not a matter of what yocto can do or not. meta-fsl-arm uses all packages from Freescale, and some packages are only provided as binaries. And only on latest imx6 those packages was released both as hfp and sfp.

If you want to help on testing (it would be great) I can help you on your setup environment.

Dear DaianeAngolini

     Thanks for your reply. you are always so nice to ask all the questions. and you have the "plan" for the schedule.

     OK, my project is about making JAVA SE to run on our imx6 Linux platform. (and we cooperate with Oracle.Oracle own the porting responsibilities of "JAVA SE".)

     but we need support hardFP and keep the hardFP enable in our IMX6 bsp. (and openGL ES & framebuffer should be enable, X11 should be removed!)

     So, of course no doubt. it will be great and my pleasure  that you can help me set up environment, and test the hardFP.

     And next followed, what shall I do?  do I need create another thread for this topic?

look forward your reply.

tkank you kindly.


Thanks :smileygrin:

1) in order to *remove* X11 you must know that the default for poky.conf distro is that it enable wayland AND x11. So you need to use another DISTRO_FEATURE. At the end, you will create *your* distro to make your project, but so far, only for testing, you can set DISTRO_FEATURE on your local.conf.

find what's the current DISTRO_FEATURE:

$ bitbake -e | grep ^DISTRO_FEATURE

copy that ugly string and *remove* what you don't want (wayland, and x11)

place your new string on your local.conf.

2) in order to download master-next, start downloading master (repo init -u <URL> -b master

then go to source/meta-fsl-arm and:

$ git branch -a (look for master-next branch)

$ git checkout -b freescale/master-next -b master-next

then you can source setup-lalalalalal build and your bitbake comamand.

Dear Daiane ,

Thanks for your reply.

i will test it right now by following your guild.

BTW, it seems it is not easy for me to customize rootfs using yocto project.

YP have its rules and detail. And compare to YP, LTIB is a easy tools (maybe I have been familiar with it)

one more questions, may I ask when FSL release the branch which supports hardFP?

thank you kindly


Dear Daiane,


today I follow your guild to test the next branch.

here is my step:

$ ./repo init -u https://github.com/Freescale/fsl-community-bsp-platform -b master   (before i use "-b dylan")

$ ./repo sync

cd into source/meta-fsl-arm :

$ git branch

$ git checkout -b freescale/master-next -b master-next

(right? why there are two "-b"?)

and then,setup the env and bitbake fsl-image-test. it take me several hours for building and installing.

everything goes well except "apt-get install python in my 64bit-Ubuntu PC for finishing compilation".

As I say, what I want is imx6-linux-BSP which support hardFP.

When i donwload the master, I check the file "imx-base.inc", i did not see any featrue about "Float-Point setting" which I can find it in the master-next.

+# Float-Point setting

+DEFAULTTUNE_mx6 ?= "cortexa9hf-neon"


Is it because what you had commented:"master-next still under test, Did not be merged on master"???

would you tell when to finish the testing of the master-next containing hardFP option??

and when to release the branch of supporting hardFP.


thank you for teaching me how to remove PKG away from image.

i still study, understand and need more testing for the  "DISTRO_FEATURES".

IT is importance for me to customize the rootfs. It is easy for me by using the LTIB tool.

but by using YP, it is not easy to customize rootfs, for example, I need add the gst-bad plugins into my image.

i found i have to list many string into local.conf file.  Or using the GUI hob to select something refered to gst-plugins-bad,

rebuild the image, the hob GUI show some error MSG and fail to rebuild image.

Maybe , I need more testing and trying, and would you share more suggestions for customizing rootfs ???

thank you kindly


what do you mean by "FSL release the branch which supports hardFP"?

The plan is that meta-fsl-arm release it *before* the code freeze for next stable release, the plan is 6th September for code freeze and some time on October for next stable release.

FSL had released an alpha release for imx6 only that supports only HFP. And I don´t know the other official dates for next releases coming from Freescale.

I would like you to understand that meta-fsl-arm is from community, not from Freescale. The work Freescale has being doing on meta-fsl-arm is to support the community and contribute to the project.

"FSL had released an alpha release for imx6 only that supports only HFP" !!!!   it will be OK. based on this alpha release,we could do more porting .

would you pls help to tell where I can get this alpha release??

thank you so much

You need to talk to your local FSL representative. Only he can start the process to give you access to alpha release.



Please, talk to your local FSL representative. :smileywink:

Hi Francesco,

I am not sure about the error you have when sourcing. 'memtool' is already installed (in case you have baked any fsl-* image) on /unit_tests. Be careful with that tool, you can R/W anywhere :smileyhappy:


I solved my issue installing the toolchain without the command source, simply executing the script with:

$ ./poky-eglibc-i686-arm-toolchain-1.4.2.sh

For memtool issue I've not baked an fsl-*image but only the core_image_base.

I'll try to bake fsl-image-test , is it correct to have the memtool already installed?

I've another question: I need to modify some pin/pad assignement, I found the macros in file:


and in file:


What is the correct header to modify?


fsl-image-test should contain that tool. To do any code changes, you must create a patch, either with git or quilt. Once you have it, you have to copy it to your path where imx-test recipe resides and modify the recipe to include it. There are several documents explain this steps. If you will do several patches, the best way to proceed is either creating a new layer (new folder on sources) OR having your own git repo forked from teh original one and create any commits you want. Too much info I think, so first try the first suggestion.


Hi francpalm, please, consider the reply from LeonardoSandovalGonzalez.

If you still has questions, please, create a new thread on imx-community and share any log message you have.

Comments on Docs must be approaved (every single comment), so it´s quicker and easier to us follow a thread instead of reply to Doc´s comments.

If you wish you can mention me on your new thread

well maybe it is a simple question but how can I sincronise the git clone of the kernel?

git pull [something?]



Just 'git pull'. In case you got some commits done locally, this command will actually create a 'merge commit'.

(from here: No Access)

To complete the operation of compiling the kernel you nedd also to:

(compile modules)

make modules LOADADDR=0x10008000


make modules_install INSTALL_MOD_PATH=$TARGETDIR

for the 3.10.17 you need also:

make ARCH=arm imx6q-sabresd.dtb

then you need to deploy in on the SD:

in the boot partition copy the uImage and the .dtb

in the FS you need to copy the modules lib directory the system.map and the Uimage....

Please correct me if i made something wrong, or if I forgot something.


Version history
Revision #:
1 of 1
Last update:
‎07-24-2013 11:10 AM
Updated by: