-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Hey folks,
I was bumping into issues compiling the kernel on x86-64, using the Dev Container plugin in VSCode as specified in your docs:
make -C "src" -j16 ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- HOSTCC=aarch64-linux-gnu-gcc KDEB_COMPRESS="xz" KDEB_CHANGELOG_DIST="unstable" DPKG_FLAGS=-d LOCALVERSION=-3-qcom KERNELRELEASE=6.17.1-3-qcom KDEB_PKGVERSION=6.17.1-3 defconfig qcom_module_defconfig radxa.config radxa_custom.config
make[2]: Entering directory '/workspaces/linux-qcom/src'
HOSTCC scripts/basic/fixdep
/bin/sh: 1: ./scripts/basic/fixdep: Exec format error
make[5]: *** [scripts/Makefile.host:114: scripts/basic/fixdep] Error 126
make[5]: *** Deleting file 'scripts/basic/fixdep'
make[4]: *** [Makefile:655: scripts_basic] Error 2
make[3]: *** [/workspaces/linux-qcom/src/Makefile:369: __build_one_by_one] Error 2
make[2]: *** [Makefile:248: __sub-make] Error 2
make[2]: Leaving directory '/workspaces/linux-qcom/src'
make[1]: *** [Makefile.extra:32: build-defconfig] Error 2
make[1]: Leaving directory '/workspaces/linux-qcom'
dh_auto_build: error: make -j1 "INSTALL=install --strip-program=true" returned exit code 2
make: *** [debian/rules:12: build] Error 25
dpkg-buildpackage: error: debian/rules build subprocess returned exit status 2
debuild: fatal error at line 1182:
dpkg-buildpackage -us -uc -ui -b failed
make: *** [Makefile:103: debuild] Error 29
The problem seems to be HOSTCC=aarch64-linux-gnu-gcc:
Line 16 in 1409513
| ARCH=$(ARCH) CROSS_COMPILE=$(CROSS_COMPILE) HOSTCC=$(CROSS_COMPILE)gcc \ |
I believe we're telling the build system to compile host tools (like fixdep) with the ARM64 cross-compiler. I was under the impression that host tools need to run on the build machine (which for me is x86_64) and not the target. Patching HOSTCC to just "gcc" seems to have resolved things. Perhaps this wasn't hit as you compile from an Arm64 host directly? Equally likely I'm just doing something wrong.