someone suggested me this would be the right place for asking this question and it seems so from other questions. I hope to get an answer here.
(by the way, the reason I'm trying to build ubuntu is to add some debug info in the ubuntu kernel to debug an ubuntu install failure on a virtual machine using qemu. The virtual machine is based on qemu's arm64 'virt' machine but has different address map and it has a simple peripheral device model that loads and uses a complex .so file based on multi2sim.)
I downloaded ubuntu source by git clone git://kernel.ubuntu.com/ubuntu/ubuntu-focal.git
.
and according to https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel
and the included build process for arm, I did this:
LANG=C fakeroot debian/rules clean
LANG=C fakeroot debian/rules binary-headers binary-generic binary-perarch
I had exported ARCH=arm64 CROSS_COMPILE=aarch64-none-elf
or
ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu-
before the commands, or with the command but it ended with errors at the end. One of the error message was You are building kernel with non-retpoline compiler, please update your compiler
and I saw I can fix it by changing configuration(https://askubuntu.com/questions/1145943/building-kernel-with-non-retpoline-compiler). So I tried
LANG=C fakeroot debian/rules editconfigs
But it asks me Do you want to edit config: amd64/config.flavour.generic?
when I'm doing it for arm64 architecture. I tried giving ARCH and CROSS_COMPILE option but it always asks me if I want to change amd64 configuration. How can I give it the ARCH and CROSS_COMPILE option for this fakeroot debian/rules
build method?
p.s. my toolchain info.
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.
or
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.