beagleboard / meta-beagleboard

Support for beagleboard.org devices
MIT License
71 stars 63 forks source link

fix u-boot compilation #20

Closed casantos closed 7 years ago

casantos commented 9 years ago

I'm trying to build an image for the beagleboard black using the following steps:

$ mkdir  /workspace/OpenEmbedded
$ cd  /workspace/OpenEmbedded
$ git clone git://git.openembedded.org/openembedded-core
$ git clone git://git.openembedded.org/bitbake
$ git clone git://git.openembedded.org/meta-openembedded
$ git clone git://github.com/beagleboard/meta-beagleboard
$ export BITBAKEDIR=$PWD/bitbake
$ . openembedded-core/oe-init-build-env build-beagleboard

Edit conf/local.confand set:

MACHINE ??= "beaglebone"

Edit conf/bblayers.conf and set:

BBLAYERS ?= " \
  /workspace/OpenEmbedded/openembedded-core/meta \
  /workspace/OpenEmbedded/meta-openembedded/meta-oe \
  /workspace/OpenEmbedded/meta-beagleboard/common-bsp \
  "

Then build:

$ bitbake core-image-minimal

It fails in the compilation of u-boot:

| arm-oe-linux-gnueabi-ld.bfd: cannot find -lgcc
| make: *** [u-boot] Error 1
| ERROR: oe_runmake failed

The following patch fixes the problem:

diff --git a/common-bsp/recipes-bsp/u-boot/u-boot.inc b/common-bsp/recipes-bsp/u-boot/u-boot.inc
index 720f995..66f7430 100644
--- a/common-bsp/recipes-bsp/u-boot/u-boot.inc
+++ b/common-bsp/recipes-bsp/u-boot/u-boot.inc
@@ -11,7 +11,7 @@ DEPENDS = "mtd-utils"
 PACKAGE_ARCH = "${MACHINE_ARCH}"
 PARALLEL_MAKE=""

-EXTRA_OEMAKE = "CROSS_COMPILE=${TARGET_PREFIX}"
+EXTRA_OEMAKE = "CROSS_COMPILE=${TARGET_PREFIX} CC=${TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS}"

 UBOOT_MACHINE ?= "${MACHINE}_config"
 UBOOT_BINARY ?= "u-boot.bin"
casantos commented 9 years ago

Sorry, I posted an outdated version of the patch. It should contain

+EXTRA_OEMAKE = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS}"'
gipi commented 9 years ago

+1