This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMDS64EVM: Cross-compilation for ARM64 on Ubuntu

Part Number: TMDS64EVM

Tool/software:

I'm trying to build the external kernel module via cross-compilation for ARM64 on Ubuntu 22.04 and I'm getting following output error:

rm -rf *.o *~ core .depend .*.cmd *.ko *.mod.c .tmp_versions
make -C /home/atcom/ti-processor-sdk-linux-rt-am64xx-evm-10.00.07.04/board-support/ti-linux-kernel-6.6.32+git-ti-rt M=/home/atcom/Desktop/at_spi_pps modules
make[1]: Entering directory '/home/atcom/ti-processor-sdk-linux-rt-am64xx-evm-10.00.07.04/board-support/ti-linux-kernel-6.6.32+git-ti-rt'
warning: the compiler differs from the one used to build the kernel
The kernel was built by: gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
You are using: aarch64-oe-linux-gcc (GCC) 13.3.0
CC [M] /home/atcom/Desktop/at_spi_pps/at_spi_pps.o
aarch64-oe-linux-gcc: error: unrecognized command-line option ‘-mrecord-mcount’
make[3]: *** [scripts/Makefile.build:243: /home/atcom/Desktop/at_spi_pps/at_spi_pps.o] Error 1
make[2]: *** [/home/atcom/ti-processor-sdk-linux-rt-am64xx-evm-10.00.07.04/board-support/ti-linux-kernel-6.6.32+git-ti-rt/Makefile:1913: /home/atcom/Desktop/at_spi_pps] Error 2
make[1]: *** [Makefile:234: __sub-make] Error 2
make[1]: Leaving directory '/home/atcom/ti-processor-sdk-linux-rt-am64xx-evm-10.00.07.04/board-support/ti-linux-kernel-6.6.32+git-ti-rt'
make: *** [Makefile:17: modules] Error 2

I am launching the build process from a .sh file:

SDK_INSTALL_DIR="/home/atcom/ti-processor-sdk-linux-rt-am64xx-evm-10.00.07.04"

export CROSS_COMPILE_64="${SDK_INSTALL_DIR}/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/aarch64-oe-linux/aarch64-oe-linux-"
export SYSROOT_64="${SDK_INSTALL_DIR}/linux-devkit/sysroots/aarch64-oe-linux"
export CC_64="${CROSS_COMPILE_64}gcc --sysroot=${SYSROOT_64}"
export CROSS_COMPILE_32="${SDK_INSTALL_DIR}/k3r5-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-oe-eabi/arm-oe-eabi-"

make ARCH=arm64 CROSS_COMPILE=${CROSS_COMPILE_64} clean
make ARCH=arm64 CROSS_COMPILE=${CROSS_COMPILE_64}

  • Hello,

    I installed the libraries for linux driver comilation and dtb file - AM642x

    sudo apt install git xz-utils build-essential flex bison bc libssl-dev libncurses-dev

    sudo apt install libelf-dev

    Before generating dtb files and/or compiling linux drivers I generated the kernel config:

    make oldconfig && make prepare

    Then i recompile the core and it seems to have solved the problem.

    .sh script:

    SDK_INSTALL_DIR="/home/ti-processor-sdk-linux-rt-am64xx-evm-10.00.07.04"

    export CROSS_COMPILE_64="${SDK_INSTALL_DIR}/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/aarch64-oe-linux/aarch64-oe-linux-"
    export SYSROOT_64="${SDK_INSTALL_DIR}/linux-devkit/sysroots/aarch64-oe-linux"
    export CC_64="${CROSS_COMPILE_64}gcc --sysroot=${SYSROOT_64}"
    export CROSS_COMPILE_32="${SDK_INSTALL_DIR}/k3r5-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-oe-eabi/arm-oe-eabi-"

    cd /home/ti-processor-sdk-linux-rt-am64xx-evm-10.00.07.04/board-support/ti-linux-kernel-6.6.32+git-ti-rt
    export PATH=/home/atcom/ti-processor-sdk-linux-rt-am64xx-evm-10.00.07.04/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/aarch64-oe-linux:$PATH
    make ARCH=arm64 CROSS_COMPILE=aarch64-oe-linux- distclean
    make ARCH=arm64 CROSS_COMPILE=aarch64-oe-linux- defconfig ti_arm64_prune.config ti_rt.config
    make ARCH=arm64 CROSS_COMPILE=aarch64-oe-linux- menuconfig
    make ARCH=arm64 CROSS_COMPILE=aarch64-oe-linux- Image

    make ARCH=arm64 CROSS_COMPILE=aarch64-oe-linux- modules

    Recompiling the core seems to have solved the problem.