Build error - arm-poky-linux-gnueabi-ld.bfd: cannot find -lgcc

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Build error - arm-poky-linux-gnueabi-ld.bfd: cannot find -lgcc

Jump to solution
7,842 Views
maheshkumarkoda
Contributor III

Hi Community,

I am trying to build U-boot from local folder using the following commands:

export ARCH=arm

export CROSS_COMPILE=/home/fsl-community-bsp/build/tmp/sysroots/x86_64-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-

make mx6qsabreauto_defconfig

make

And I am getting following error:

/fsl-community-bsp/build/tmp/sysroots/x86_64-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-ld.bfd: cannot find -lgcc

make[2]: *** [examples/standalone/hello_world] Fehler 1

make[1]: *** [examples/standalone] Fehler 2

make: *** [examples] Fehler 2

I am using Cross compiler from x86_64-linux as mentioned above, it is supposed to build image for i.mx devices, isn't it?

NOTE:

i got BSP from:

Labels (2)
1 Solution
4,347 Views
gusarambula
NXP TechSupport
NXP TechSupport

Hello Mahesh K K,

You would need to extract the toolchain using the following command:

$ bitbake meta-toolchain

After extracting it run the installer script and initialize it you should be able to compile with it in order to run on the i.MX6. The toolchain you need is for the CortexA9.

There is a very good training on the link below where it is shown how to compile the kernel using the extracted toolchain.

Yocto Training - HOME

I hope this information helps!

View solution in original post

0 Kudos
2 Replies
4,347 Views
danwei_luo
NXP Employee
NXP Employee

Hi Mahesh,

Actually it's not necessary to bitbake the toolchain to build the U-boot. But you need to export one more variable. Here is the command you can refer to:

export ARCH=arm

export CROSS_COMPILE=/home/fsl-community-bsp/build/tmp/sysroots/x86_64-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-

export CC="/home/fsl-community-bsp/build/tmp/sysroots/x86_64-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-gcc --sysroot=/home/fsl-community-bsp/build/tmp/sysroots/imx6qsabreauto"

make mx6qsabreauto_defconfig

make CC="$CC"

I have the same problem with you before, and this setting solved my problem.

Hope it will be helpful to you too!

Best regards,

Danwei Luo

---------------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

---------------------------------------------------------------------------------------------------------------------------

4,348 Views
gusarambula
NXP TechSupport
NXP TechSupport

Hello Mahesh K K,

You would need to extract the toolchain using the following command:

$ bitbake meta-toolchain

After extracting it run the installer script and initialize it you should be able to compile with it in order to run on the i.MX6. The toolchain you need is for the CortexA9.

There is a very good training on the link below where it is shown how to compile the kernel using the extracted toolchain.

Yocto Training - HOME

I hope this information helps!

0 Kudos