Compiling Android uboot (VIM3)

Hi,
I’m trying to compile uboot for VIM3 (on Ubuntu 16.04). I’ve followed the prep steps by installing the toolchains into /opt/toolchains …

$ wget https://releases.linaro.org/archive/13.11/components/toolchain/binaries/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.bz2
$ wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/6-2017q2/gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2
$ sudo mkdir /opt/toolchains
$ sudo tar -xjf gcc-linaro-aarch64-none-elf-4.8-2013.11_linux.tar.bz2 -C /opt/toolchains
$ sudo tar -xjf gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2 -C /opt/toolchains

But when I run ./mk kvim3
I get the following error -

Clean up
Compile config: kvim3
HOSTCC scripts/basic/fixdep
/bin/sh: 1: cc: not found
scripts/Makefile.host:91: recipe for target ‘scripts/basic/fixdep’ failed
make[2]: *** [scripts/basic/fixdep] Error 127
/home/xx/WORKING_DIRECTORY/bootloader/uboot/Makefile:400: recipe for target ‘scripts_basic’ failed
make[1]: *** [scripts_basic] Error 2
Makefile:147: recipe for target ‘sub-make’ failed
make: *** [sub-make] Error 2
Pre-build failed! exit!

What additional steps, environment variables should be performed to compile uboot?

(I’ve tried creating a symlink cc -> /opt/toolchains/gcc-arm-none-eabi-6-2017-q2-update/bin/arm-none-eabi-gcc – but then I get an Include error on sys/mman.h - so I think there might be multiple steps).

Thanks for any assistance.

@Waylon Please help to resolve this issue, thanks.

compilers seem to not be properly installed. maybe some other step missing after tar x …

Thank you for the steps to get the toolchains installed.

It looks like the makefile expects the toolchains to be in a specific location:

CROSS_COMPILE ?= /opt/toolchains/gcc-linaro-aarch64-none-elf-4.8-2013.11_linux/bin/aarch64-none-elf-
CROSS_COMPILE_T32 ?= /opt/toolchains/gcc-arm-none-eabi-6-2017-q2-update/bin/arm-none-eabi-

It looks like cc needs to be in your path somewhere? If you do which cc, do you get a response?

I will try to get this setup tonight/tomorrow and follow up.

Check to see if your system has cc commands:

$which cc
/usr/bin/cc

If not, you try to install the build environment:

sudo apt-get install gcc

I got uboot to compile successfully, but am now stuck on the ROM itself.

Can you provide the error message?

I did here: Android 9 Source Codes for VIM3

Thank you - this was enough to get me fully working. uboot and Android not built successfully.

I built/borrowed a docker image for building for the Edge.

I think it should be similar for the VIM3. You need to start the docker container from the directory that has your android source.

docker run --rm --privileged -v "$(pwd)":/srv/src -e GIT_USER_NAME=jfloff -e GIT_USER_EMAIL=jfloff@inesc-id.pt -ti darrank/docker-rockpro64-cicd

Source code for container is here: https://github.com/dazza5000/docker-rockpro64-cicd

Command sequence to build for EDGE:

root@f192effcbaf0:/srv/src# history  
    1  ls
    2  cd u-boot/
    3  ls
    4  make kedge_defconfig
    5  make ARCHV=aarch64
    6  cd ../kernel/
    7  make ARCH=arm64 kedge_defconfig -j3
    8  make ARCH=arm64 rk3399-khadas-edge-android.img -j4
    9  cd ..
   10  source build/envsetup.sh 
   11  lunch rk3399_all-userdebug
   12  make installclean
   13  make -j4
   14  history

Yay Success!

[100% 50702/50702] host Executable: primitives_tests_32 (out/host/...j32/EXECUTABLES/primitives_tests_intermediates/primitives_tests32)

#### make completed successfully (03:16:26 (hh:mm:ss)) ####