U-boot cannot compile successfully

I am in accordance with the tutorial in the [https://wiki.radxa.com/RockpiS/dev/Debian].When I run ‘build/mk-uboot.sh rockpis’, the following error occurs:

start=$(aarch64-linux-gnu-nm u-boot | grep __rel_dyn_start | cut -f 1 -d ’ '); end=$(aarch64-linux-gnu-nm u-boot | grep __rel_dyn_end | cut -f 1 -d ’ '); tools/relocate-rela u-boot-nodtb.bin 0x00600000 $start $end
DTC arch/arm/dts/rk3036-sdk.dtb
Error: arch/arm/dts/.rk3036-sdk.dtb.pre.tmp:77.1-10 syntax error
FATAL ERROR: Unable to parse input tree
make[3]: *** [scripts/Makefile.lib:319:arch/arm/dts/rk3036-sdk.dtb] error 1
make[2]: *** [dts/Makefile:62:arch-dtbs] error 2
make[1]: *** [Makefile:877:dts/dt.dtb] error 2
make: *** [Makefile:461:__build_one_by_one] error 2
MAKE UBOOT IMAGE FAILED.
This error occurs even when I compile with the redownloaded source code, but it used to compile normally. I don’t know if it has anything to do with the system setup?
The system is Gentoo Linux.

The result of the env command is as follows:
SHELL=/bin/bash
WINDOWID=39845894
COLORTERM=rxvt
LESS=-R -M --shift 5
GTK_IM_MODULE=fcitx
CONFIG_PROTECT_MASK=/etc/sandbox.d /etc/fonts/fonts.conf /etc/gentoo-release /etc/terminfo /etc/ca-certificates.conf
I3SOCK=/tmp/i3-root.2ArMzk/ipc-socket.2620
XMODIFIERS=@im=fcitx
EDITOR=/usr/bin/vi
PWD=/home/arm/rockchip-bsp
CONFIG_PROTECT=/usr/share/gnupg/qualified.txt
LOGNAME=root
MANPATH=/usr/share/gcc-data/x86_64-pc-linux-gnu/9.3.0/man:/usr/share/binutils-data/x86_64-pc-linux-gnu/2.34/man:/usr/local/share/man:/usr/share/man:/usr/lib/rust/man:/usr/lib/llvm/11/share/man
XAUTHORITY=/root/.Xauthority
DESKTOP_STARTUP_ID=i3/i3-sensible-terminal/2620-3-IMI_TIME41270
WINDOWPATH=7
MOTD_SHOWN=pam
HOME=/root
LANG=zh_CN.UTF-8
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=33:so=01;35:do=01;35:bd=33;01:cd=33;01:or=01;33;41:mi=01;33;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=44;01;33:.tar=01;31:.tgz=01;31:.arc=01;31:.arj=01;31:.taz=01;31:.lha=01;31:.lz4=01;31:.lzh=01;31:.lzma=01;31:.tlz=01;31:.txz=01;31:.tzo=01;31:.t7z=01;31:.zip=01;31:.z=01;31:.dz=01;31:.gz=01;31:.lrz=01;31:.lz=01;31:.lzo=01;31:.xz=01;31:.zst=01;31:.tzst=01;31:.bz2=01;31:.bz=01;31:.tbz=01;31:.tbz2=01;31:.tz=01;31:.deb=01;31:.rpm=01;31:.jar=01;31:.war=01;31:.ear=01;31:.sar=01;31:.rar=01;31:.alz=01;31:.ace=01;31:.zoo=01;31:.cpio=01;31:.7z=01;31:.rz=01;31:.cab=01;31:.wim=01;31:.swm=01;31:.dwm=01;31:.esd=01;31:.jpg=01;35:.jpeg=01;35:.mjpg=01;35:.mjpeg=01;35:.gif=01;35:.bmp=01;35:.pbm=01;35:.pgm=01;35:.ppm=01;35:.tga=01;35:.xbm=01;35:.xpm=01;35:.tif=01;35:.tiff=01;35:.png=01;35:.svg=01;35:.svgz=01;35:.mng=01;35:.pcx=01;35:.mov=01;35:.mpg=01;35:.mpeg=01;35:.m2v=01;35:.mkv=01;35:.webm=01;35:.ogm=01;35:.mp4=01;35:.m4v=01;35:.mp4v=01;35:.vob=01;35:.qt=01;35:.nuv=01;35:.wmv=01;35:.asf=01;35:.rm=01;35:.rmvb=01;35:.flc=01;35:.avi=01;35:.fli=01;35:.flv=01;35:.gl=01;35:.dl=01;35:.xcf=01;35:.xwd=01;35:.yuv=01;35:.cgm=01;35:.emf=01;35:.ogv=01;35:.ogx=01;35:.cfg=00;32:.conf=00;32:.diff=00;32:.doc=00;32:.ini=00;32:.log=00;32:.patch=00;32:.pdf=01;35:.ps=00;32:.tex=00;32:.txt=00;32:.aac=00;36:.au=00;36:.flac=00;36:.m4a=00;36:.mid=00;36:.midi=00;36:.mka=00;36:.mp3=00;36:.mpc=00;36:.ogg=00;36:.ra=00;36:.wav=00;36:.oga=00;36:.opus=00;36:.spx=00;36:.xspf=00;36:
OPENGL_PROFILE=xorg-x11
INFOPATH=/usr/share/gcc-data/x86_64-pc-linux-gnu/9.3.0/info:/usr/share/binutils-data/x86_64-pc-linux-gnu/2.34/info:/usr/share/info
MOZ_GMP_PATH=/usr/lib64/nsbrowser/plugins/gmp-gmpopenh264/system-installed
TERM=rxvt-unicode
LESSOPEN=|lesspipe %s
USER=root
COLORFGBG=15;0
ARCH=arm64
MANPAGER=manpager
DISPLAY=:0
SHLVL=3
PAGER=/usr/bin/less
QT_IM_MODULE=fcitx
GCC_SPECS=
HUSHLOGIN=FALSE
PATH=/home/arm/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib/llvm/11/bin
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-3xVCnjpBNs,guid=a21d50ccd13d976e5d7ca6055ff041a5
CROSS_COMPILE=aarch64-linux-gnu-
MAIL=/var/mail/root
OLDPWD=/home/arm/rockchip-bsp/u-boot
_=/usr/bin/env

I tried to modify u-boot/arch/arm/dts/Makefile and swap the positions of rk3308-rock-pi-s.dtb and rk3036-sdk.dtb in dtb-$(CONFIG_ARCH_ROCKCHIP). The compilation result became the following:

start=$(aarch64-linux-gnu-nm u-boot | grep __rel_dyn_start | cut -f 1 -d ’ '); end=$(aarch64-linux-gnu-nm u-boot | grep __rel_dyn_end | cut -f 1 -d ’ '); tools/relocate-rela u-boot-nodtb.bin 0x00600000 $start $end
DTC arch/arm/dts/rk3308-rock-pi-s.dtb
DTC arch/arm/dts/rk3066a-mk808.dtb
DTC arch/arm/dts/rk3126-evb.dtb
DTC arch/arm/dts/rk3128-evb.dtb
DTC arch/arm/dts/rk3188-radxarock.dtb
Error: arch/arm/dts/.rk3188-radxarock.dtb.pre.tmp:383.1-10 syntax error
FATAL ERROR: Unable to parse input tree
make[3]: *** [scripts/Makefile.lib:319:arch/arm/dts/rk3188-radxarock.dtb] error 1
make[2]: *** [dts/Makefile:62:arch-dtbs] error 2
make[1]: *** [Makefile:877:dts/dt.dtb] error 2
make: *** [Makefile:461:__build_one_by_one] error 2
MAKE UBOOT IMAGE FAILED.
Do I need to delete the item that caused the error?

Try getting the complete Debian SDK repository and checkout stable-4.4-rockpis branch.

$ cd ~/src
$ git clone --recursive https://github.com/radxa/rockchip-bsp.git
$ cd rockchip-bsp
$ git checkout stable-4.4-rockpis
$ ./build/mk-uboot.sh rockpis

See readme in the repository for required packages.

Builds smoothly for me

You can try my patch here :

It removes all troublesome dts files from the build process, it also fixes dtc lexer build issues.

It is part of the buildroot.rk3308 external tree. Which is another option for building the entire operating system, including uboot, kernel and the rootfs. It will produce an SDcard image for you.

1 Like