如何为 arm64 构建 ubuntu?(如何将 ARCH 和 CROSS_COMPILE 变量提供给 `debian/rules` 命令)

如何为 arm64 构建 ubuntu?(如何将 ARCH 和 CROSS_COMPILE 变量提供给 `debian/rules` 命令)

我通过 下载了 ubuntu 源代码git clone git://kernel.ubuntu.com/ubuntu/ubuntu-focal.git
并根据https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel其中包含的 arm 构建过程,我执行以下操作:

LANG=C fakeroot debian/rules clean  
LANG=C fakeroot debian/rules binary-headers binary-generic binary-perarch  

我在命令之前或命令之后导出了ARCH=arm64 CROSS_COMPILE=aarch64-none-elf
ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-,但最后却出现了错误。其中一条错误消息是You are building kernel with non-retpoline compiler, please update your compiler,我发现我可以通过更改配置来修复它(使用非 retpoline 编译器构建内核)所以我尝试了

LANG=C fakeroot debian/rules editconfigs

但是当我针对 arm64 架构执行此操作时,它会询问我。我尝试提供 ARCH 和 CROSS_COMPILE 选项,但它总是询问我是否要更改 amd64 配置。我该如何为这种构建方法Do you want to edit config: amd64/config.flavour.generic?提供 ARCH 和 CROSS_COMPILE 选项?fakeroot debian/rules

附言:我的工具链信息。

aarch64-linux-gnu-gcc (Linaro GCC 7.5-2019.12) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 

或者

aarch64-none-elf-gcc (GNU Toolchain for the A-profile Architecture 9.2-2019.12 (arm-9.10)) 9.2.1 20191025
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

相关内容