gcc version used for kernel configs doesn't match the one used for builds
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
linux-riscv-5.8 (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
Focal |
Fix Committed
|
Medium
|
Kleber Sacilotto de Souza |
Bug Description
[Impact]
linux-riscv-5.8 needs to be built with gcc-10 in Focal otherwise it won't boot. This was fixed by commit "UBUNTU: [Packaging] Use gcc-10 for riscv 5.8 kernel build", which adds gcc-10 as "Build-
The other gcc version dependency is when we generate locally the kernel configs by running 'make syncconfig', which is called by 'debian/
[Fix]
The proposed fix is to use the same variable defined for the build, passing it down to 'debian/
[Where problems could occur]
If the environment variables are not set correctly the build can break in some environment which was not tested.
Changed in linux-riscv-5.8 (Ubuntu Focal): | |
assignee: | nobody → Kleber Sacilotto de Souza (kleber-souza) |
status: | New → Confirmed |
status: | Confirmed → In Progress |
Changed in linux-riscv-5.8 (Ubuntu): | |
status: | New → Invalid |
Changed in linux-riscv-5.8 (Ubuntu Focal): | |
importance: | Undecided → Medium |
Changed in linux-riscv-5.8 (Ubuntu Focal): | |
status: | In Progress → Fix Committed |
For the record, this is what's causing the config differences between the gcc versions:
With gcc 10.3.0, CC_HAS_ KASAN_GENERIC is not available as it depends on the following compiler flag:
config CC_HAS_ KASAN_GENERIC kernel- address)
def_bool $(cc-option, -fsanitize=
'cc-option' will do something similar to the following, which with gcc 10.2.0 riscv64 cross compiler would return success:
$ /usr/bin/ riscv64- linux-gnu- gcc-10 -Werror -fsanitize= kernel- address -c -x c /dev/null
$ echo $?
0
But with 10.3.0 this doesn't seem to be supported anymore as a standalone flag, depending now on '-fasan- shadow- offset= ':
$ /usr/bin/ riscv64- linux-gnu- gcc-10 -Werror -fsanitize= kernel- address -c -x c /dev/null kernel- address’ with stack protection is not supported without ‘-fasan- shadow- offset= ’ for this target [-Werror]
cc1: error: ‘-fsanitize=
And all KASAN options get removed altogether.
This doesn't cause any real config change, as we disable CONFIG_KASAN anyway. But for our annotations '-' != 'n', failing the config checks.