cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Explorer
Explorer
10,934 Views
Registered: ‎03-26-2010

Petalinux 2016.4 u-boot doesn't compile

Jump to solution

Hi all,

 

I'm using Petalinux 2016.4/Vivado 2016.4 on Ubuntu 16.04, having problems compiling u-boot. I run these commands in this order:

petalinux-build -c u-boot -x clean
petalinux-build -x clean
petalinux-build -c u-boot

Get this error when building package u-boot-xlnx_2016.07.bb, file path given in my Petalinux-2016.4/build/build/log file, pointing to Petalinux-2016.4/build/tmp/work/plnx_arm-xilinx-linux-gnueabi/u-boot-xlnx/v2016.07-xilinx+gitAUTOINC+0b94ce5ed4-r0/temp/log.do_compile.23690:

 

...

NOTE: recipe device-tree-generation-xilinx+gitAUTOINC+11f81055d1-r0: task do_package_write_rpm_setscene: Succeeded
NOTE: Executing RunQueue Tasks
NOTE: Running task 952 of 965 (ID: 6, /opt/Xilinx/petalinux-v2016.4-final/components/yocto/source/arm/layers/meta-xilinx/recipes-bsp/u-boot/u-boot-xlnx_2016.07.bb, do_compile)
NOTE: recipe u-boot-xlnx-v2016.07-xilinx+gitAUTOINC+0b94ce5ed4-r0: task do_compile: Started
ERROR: u-boot-xlnx-v2016.07-xilinx+gitAUTOINC+0b94ce5ed4-r0 do_compile: oe_runmake failed
ERROR: u-boot-xlnx-v2016.07-xilinx+gitAUTOINC+0b94ce5ed4-r0 do_compile: Function failed: do_compile (log file is located at /home/vadim/Work/Aldec_TySOM_Repo/Petalinux-2016.4/build/tmp/work/plnx_arm-xilinx-linux-gnueabi/u-boot-xlnx/v2016.07-xilinx+gitAUTOINC+0b94ce5ed4-r0/temp/log.do_compile.23690)
ERROR: Logfile of failure stored in: /home/vadim/Work/Aldec_TySOM_Repo/Petalinux-2016.4/build/tmp/work/plnx_arm-xilinx-linux-gnueabi/u-boot-xlnx/v2016.07-xilinx+gitAUTOINC+0b94ce5ed4-r0/temp/log.do_compile.23690
NOTE: recipe u-boot-xlnx-v2016.07-xilinx+gitAUTOINC+0b94ce5ed4-r0: task do_compile: Failed
ERROR: Task 6 (/opt/Xilinx/petalinux-v2016.4-final/components/yocto/source/arm/layers/meta-xilinx/recipes-bsp/u-boot/u-boot-xlnx_2016.07.bb, do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 955 tasks of which 17 didn't need to be rerun and 1 failed.
ERROR: Failed to build u-boot

How should this be fixed?

0 Kudos
Reply
1 Solution

Accepted Solutions
Explorer
Explorer
14,384 Views
Registered: ‎03-26-2010

@shabbirk:

 

Did some more testing.

 

With CROSS_COMPILE set to aarch64-linux-gnu- or aarch64-none-elf- I had all of Petalinux 2016.4 build fine for Zynq-7000, the ZC706_config target being used for u-boot. With the Linaro or CodeSourcery values of arm-xilinx-linux-gnueabi- or arm-linux-gnueabihf- u-boot does not build.

 

Also, in Petalinux 2016.4, for some reason I can't do a petalinux-build -c u-boot if petalinux-build hasn't been called successfully by itself first. This is a departure from how Petalinux 2016.2 and older worked.

 

Shabbir, thanks for sticking with this!

View solution in original post

0 Kudos
Reply
12 Replies
Explorer
Explorer
10,885 Views
Registered: ‎03-26-2010

No one had any problems with Petalinux u-boot for 2016.4?

0 Kudos
Reply
Moderator
Moderator
10,852 Views
Registered: ‎12-04-2016

Hi

 

Could you please share this log file:

home/vadim/Work/Aldec_TySOM_Repo/Petalinux-2016.4/build/tmp/work/plnx_arm-xilinx-linux-gnueabi/u-boot-xlnx/v2016.07-xilinx+gitAUTOINC+0b94ce5ed4-r0/temp/log.do_compile.23690

 

 

 

0 Kudos
Reply
Explorer
Explorer
10,849 Views
Registered: ‎03-26-2010

Sure - the log file name changed in a new compile, but the error is the same. I attached it, but here are the last few lines before error:

/home/Bob/Work/Alice_HW_Repo/Petalinux-2016.4/build/tmp/work/plnx_arm-xilinx-linux-gnueabi/u-boot-xlnx/v2016.07-xilinx+gitAUTOINC+0b94ce5ed4-r0/git/include/configs/platform-auto.h:196:61: warning: backslash and newline separated by space
  "default_bootcmd=run cp_kernel2ram && bootm ${netstart}\0" \ 
                                                             ^
  arm-linux-gnueabihf-ld.bfd     -r -o examples/standalone/libstubs.o examples/standalone/stubs.o
  arm-linux-gnueabihf-ld.bfd   -g -Ttext 0xc100000 -o examples/standalone/hello_world -e hello_world examples/standalone/hello_world.o examples/standalone/libstubs.o arch/arm/lib/lib.a
  arm-linux-gnueabihf-objcopy -O srec  examples/standalone/hello_world examples/standalone/hello_world.srec
  arm-linux-gnueabihf-objcopy -O binary  examples/standalone/hello_world examples/standalone/hello_world.bin
  arm-linux-gnueabihf-ld.bfd   -pie  --gc-sections -Bstatic -Ttext 0x00400000 -o u-boot -T u-boot.lds arch/arm/cpu/armv7/start.o --start-group  arch/arm/cpu/built-in.o  arch/arm/cpu/armv7/built-in.o  arch/arm/lib/built-in.o  arch/arm/mach-zynq/built-in.o  board/xilinx/zynq/built-in.o  cmd/built-in.o  common/built-in.o  disk/built-in.o  drivers/built-in.o  drivers/dma/built-in.o  drivers/gpio/built-in.o  drivers/i2c/built-in.o  drivers/mmc/built-in.o  drivers/mtd/built-in.o  drivers/mtd/onenand/built-in.o  drivers/mtd/spi/built-in.o  drivers/net/built-in.o  drivers/net/phy/built-in.o  drivers/pci/built-in.o  drivers/power/built-in.o  drivers/power/battery/built-in.o  drivers/power/fuel_gauge/built-in.o  drivers/power/mfd/built-in.o  drivers/power/pmic/built-in.o  drivers/power/regulator/built-in.o  drivers/serial/built-in.o  drivers/spi/built-in.o  drivers/usb/common/built-in.o  drivers/usb/dwc3/built-in.o  drivers/usb/emul/built-in.o  drivers/usb/eth/built-in.o  drivers/usb/gadget/built-in.o  drivers/usb/gadget/udc/built-in.o  drivers/usb/host/built-in.o  drivers/usb/musb-new/built-in.o  drivers/usb/musb/built-in.o  drivers/usb/phy/built-in.o  drivers/usb/ulpi/built-in.o  dts/built-in.o  fs/built-in.o  lib/built-in.o  net/built-in.o  test/built-in.o  test/dm/built-in.o --end-group arch/arm/lib/eabi_compat.o  arch/arm/lib/lib.a -Map u-boot.map
cmd/built-in.o: In function `print_cpu_list':
/home/Bob/Work/Alice_HW_Repo/Petalinux-2016.4/build/tmp/work/plnx_arm-xilinx-linux-gnueabi/u-boot-xlnx/v2016.07-xilinx+gitAUTOINC+0b94ce5ed4-r0/git/cmd/cpu.c:38: undefined reference to `cpu_get_desc'
/home/Bob/Work/Alice_HW_Repo/Petalinux-2016.4/build/tmp/work/plnx_arm-xilinx-linux-gnueabi/u-boot-xlnx/v2016.07-xilinx+gitAUTOINC+0b94ce5ed4-r0/git/cmd/cpu.c:43: undefined reference to `cpu_get_info'
arm-linux-gnueabihf-ld.bfd: error: required section '.rel.plt' not found in the linker script
arm-linux-gnueabihf-ld.bfd: final link failed: Invalid operation
/home/Bob/Work/Alice_HW_Repo/Petalinux-2016.4/build/tmp/work/plnx_arm-xilinx-linux-gnueabi/u-boot-xlnx/v2016.07-xilinx+gitAUTOINC+0b94ce5ed4-r0/git/Makefile:1187: recipe for target 'u-boot' failed
make[1]: *** [u-boot] Error 1
make[1]: Leaving directory '/home/Bob/Work/Alice_HW_Repo/Petalinux-2016.4/build/tmp/work/plnx_arm-xilinx-linux-gnueabi/u-boot-xlnx/v2016.07-xilinx+gitAUTOINC+0b94ce5ed4-r0/build'
Makefile:150: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2
make: Leaving directory '/home/Bob/Work/Alice_HW_Repo/Petalinux-2016.4/build/tmp/work/plnx_arm-xilinx-linux-gnueabi/u-boot-xlnx/v2016.07-xilinx+gitAUTOINC+0b94ce5ed4-r0/git'
ERROR: oe_runmake failed
ERROR: Function failed: do_compile (log file is located at /home/Bob/Work/Alice_HW_Repo/Petalinux-2016.4/build/tmp/work/plnx_arm-xilinx-linux-gnueabi/u-boot-xlnx/v2016.07-xilinx+gitAUTOINC+0b94ce5ed4-r0/temp/log.do_compile.1908)
0 Kudos
Reply
Moderator
Moderator
10,844 Views
Registered: ‎12-04-2016

Hi

 

Are you seeing this error, much related to toolchain:

arm-linux-gnueabihf-ld.bfd: error: required section '.rel.plt' not found in the linker script

Might need to clean and rebuild again.

 

Use these commands:

petalinux-build -c clean

petalinux-build -x mrproper

 

 

Best Regards

Shabbir 

0 Kudos
Reply
Explorer
Explorer
10,841 Views
Registered: ‎03-26-2010

Thanks for taking a look.

 

Yup, ran that - saw something similar in a much older forum post here: https://forums.xilinx.com/t5/Embedded-Linux/Error-building-u-boot/td-p/365783

 

Didn't help unfortunately...

0 Kudos
Reply
Moderator
Moderator
10,837 Views
Registered: ‎12-04-2016

Ok then try exporting other tool chain, something like this:

export CROSS_COMPILE=aarch64-none-elf-

 

And then build

0 Kudos
Reply
Explorer
Explorer
10,625 Views
Registered: ‎03-26-2010

This is for Zynq-7000, should I do this instead?

export CROSS_COMPILE=arm-none-linux-gnueabi-

 

0 Kudos
Reply
Explorer
Explorer
10,828 Views
Registered: ‎03-26-2010

I am using Zynq-7000, should I do this instead?

export CROSS_COMPILE=arm-none-linux-gnueabi-
0 Kudos
Reply
Moderator
Moderator
10,804 Views
Registered: ‎12-04-2016

Hi

 

You can use aarch64 toolchain for zynq also. FYI, petalinux -2016.4 has this toolchain. Atleast I used to build with this toolchain for zynq7000

 

 

Best Regards

Shabbir

0 Kudos
Reply
Explorer
Explorer
7,350 Views
Registered: ‎03-26-2010

I changed the environment to the aarch64 toolchain as you suggested, then did:

petalinux-build -c u-boot -x cleanall

petalinux-build -x mrproper

petalinux-build -c u-boot

 

However, my error message still has the old cross compiler for Linaro: arm-linux-gnueabihf- in it. Is there something else to do to clean that up?

0 Kudos
Reply
Moderator
Moderator
7,267 Views
Registered: ‎12-04-2016

Hi 

 

I would suggest after export toolchain, do petalinux-build -c clean & petalinux-build -x mrproper.

 

Dont give petalinux-build -c u-boot, instead, just give petalinux-build

 

 

BR
Shabbir

0 Kudos
Reply
Explorer
Explorer
14,385 Views
Registered: ‎03-26-2010

@shabbirk:

 

Did some more testing.

 

With CROSS_COMPILE set to aarch64-linux-gnu- or aarch64-none-elf- I had all of Petalinux 2016.4 build fine for Zynq-7000, the ZC706_config target being used for u-boot. With the Linaro or CodeSourcery values of arm-xilinx-linux-gnueabi- or arm-linux-gnueabihf- u-boot does not build.

 

Also, in Petalinux 2016.4, for some reason I can't do a petalinux-build -c u-boot if petalinux-build hasn't been called successfully by itself first. This is a departure from how Petalinux 2016.2 and older worked.

 

Shabbir, thanks for sticking with this!

View solution in original post

0 Kudos
Reply