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.

SK-AM64B: Cross-compile Debian Linux Kernel - linux-libc-dev headers not pulling correct architecture

Part Number: SK-AM64B

Tool/software:

I am trying to create a Debian (Bookworm) Linux kernel for the AM64B system using an amd64 build machine.  I am using "github.com/.../master" as a guide on how to build the kernel, using only the "ti-linux-kernel-rt" package.  I have setup the system for cross-compilation and have used this system to cross compile to create an arm64 image in another repository.  I can see the build using the correct cross compiler for the kernel modules.  But I am seeing that the folder for the 'linux-libc-dev' package ('build/bookworm/ti-linux-kernel-rt/ti-linux-kernel-rt_09.02.00.010-rt-1/debian/linux-libc-dev/usr/include/') has a folder call 'x86_64-linux-gnu/asm' which is the build machine's architecture.  I am expecting it to pull the "aarch64-linux-gnu/asm" like I see in the kernel build I did on the AM64x system.

I modified the 'run.sh' as shown:

(cd "${builddir}/${package_name}_${deb_version}" && DEB_HOST_ARCH=arm64 DEB_BUILD_OPTIONS=verbose debuild --no-lintian --no-sign -b || true)
Here is my 'rules' file:
```
#!/usr/bin/make -f

export CROSS_COMPILE="$(CURDIR)/../../../../tools/arm-gnu-toolchain-13.2.Rel1-x86_64-aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-"
export DEB_HOST_ARCH=arm64

srctree ?= .

build-indep:
build-arch:
$(MAKE) ARCH=arm64 CROSS_COMPILE=$(CROSS_COMPILE) -j2 V=1 KERNELRELEASE=6.1.83-k3-rt KBUILD_BUILD_VERSION=1 -f $(srctree)/Makefile defconfig ti_arm64_prune.config ti_rt.config riaps.config
$(MAKE) ARCH=arm64 CROSS_COMPILE=$(CROSS_COMPILE) -j2 V=1 KERNELRELEASE=6.1.83-k3-rt KBUILD_BUILD_VERSION=1 -f $(srctree)/Makefile


build: build-arch

binary-indep:
binary-arch: build-arch
$(MAKE) DEB_HOST_ARCH=arm64 ARCH=arm64 CROSS_COMPILE=$(CROSS_COMPILE) -j2 V=1 KERNELRELEASE=6.1.83-k3-rt KBUILD_BUILD_VERSION=1 -f $(srctree)/Makefile intdeb-pkg


clean:
rm -rf debian/files debian/linux-*
$(MAKE) clean

binary: binary-arch
```
 
What am I missing here?  Is there another compile flag that I should indicate in either the "debuild" command or in the "rules" file?