Can not build Android 12 for rock5b

I am trying to follow https://wiki.radxa.com/Rock5/guide/android12
Build machine is Ubuntu20 x64 VM

Single script option failed
Now I am trying step by step

I get error when running make $ADDON_ARGS ARCH=arm64 ${PRODUCT_KERNEL_DTS}.img -j$(nproc)

output:
make $ADDON_ARGS ARCH=arm64 ${PRODUCT_KERNEL_DTS}.img -j$(nproc)
arch/arm64/Makefile:25: ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum
arch/arm64/Makefile:33: LSE atomics not supported by binutils
arch/arm64/Makefile:44: Detected assembler with broken .inst; disassembly will be unreliable
arch/arm64/Makefile:25: ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum
arch/arm64/Makefile:33: LSE atomics not supported by binutils
arch/arm64/Makefile:44: Detected assembler with broken .inst; disassembly will be unreliable
CC scripts/mod/empty.o
CC scripts/mod/devicetable-offsets.s
gcc: error: unrecognized command line option ‘-mlittle-endian’
gcc: error: unrecognized command line option ‘-mlittle-endian’
make[2]: *** [scripts/Makefile.build:117: scripts/mod/devicetable-offsets.s] Error 1
make[2]: *** Waiting for unfinished jobs…
make[2]: *** [scripts/Makefile.build:273: scripts/mod/empty.o] Error 1
make[1]: *** [Makefile:1321: prepare0] Error 2
make: *** [arch/arm64/Makefile:214: rk3588-rock-5b.img] Error 2

Are you trying to build arm64 on x86-64?

Sure it is build arm64 on a pc :wink:

@ tsadigov

$ mkdir rock-android12
$ cd rock-android12
radxa:rock-android12 $ repo init -u https://github.com/radxa/manifests.git -b Android12_RK3588_Radxa_rk8 -m rockchip-s-release.xml
radxa:rock-android12 $ repo sync -d --no-tags -j4
radxa:rock-android12 $ source build/envsetup.sh
radxa:rock-android12 $ lunch RadxaRock5B-userdebug
radxa:rock-android12 $ ./build.sh -UACKup and put a J(nr cpu) after the p if you want

it is nothing more or less and sure 100% tested :wink:

ow and dont forget to install the needed packages first

apt-get update -y && apt-get install -y openjdk-8-jdk python git-core gnupg flex bison gperf build-essential
zip curl liblz4-tool zlib1g-dev gcc-multilib g+±multilib libc6-dev-i386
lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache
libgl1-mesa-dev libxml2-utils xsltproc unzip mtools u-boot-tools
htop iotop sysstat iftop pigz bc device-tree-compiler lunzip
dosfstools vim-common parted udev libssl-dev python3 python-pip lzop swig`

@incognito What I am doing is using an Ubuntu 20 x64 guest to build for arm64
I didnt try doing it on rock5b itself , I read building Android requires 300gb of storage.

@thc013 thanks for response, will try those on a fresh build machine. But looking at it I see this is the single script option from the documentation. Initially it failed for me. Probably I missed some setting or installation. Will try again by copy/pasting from the command you provided to avoid typos.

What I did to understand I tried using the options directly on gcc with a helloworld.c and it gives the error, gcc does not have those options.

I think arm-linux-gnueabi-gcc should be installed and used instead of gcc, because arm-linux-gnueabi-gcc did not complain about those options (-mlittle-endian).

I don’t remember the Radxa guide mentioning this, the same happens with the docker container provided in the Radxa guide.

the needed packages could be that they changed name so search for those package you miss with the apt

and i proberley missed a few but if you did get the right packages with apt it just builds

sudo apt install openssh-server screen python git openjdk-8-jdk android-tools-adb bc bison \
build-essential curl flex g++-multilib gcc-multilib gnupg gperf imagemagick lib32ncurses-dev \
lib32readline-dev lib32z1-dev  liblz4-tool libncurses5-dev libsdl1.2-dev libssl-dev \
libxml2 libxml2-utils lzop pngcrush rsync schedtool squashfs-tools xsltproc yasm zip zlib1g-dev \
libtinfo5 libncurses5

Thanks @thc013 It actually did build. There was 1 package missing in the list, I cant remember which one. Now I need to find out the instructions for writing resuls to emmc/sdcard.

Built Android, How do I flash - ROCK 5 Series - Radxa Forum