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
cc1: error: ‘-fsanitize=kernel-address’ with stack protection is not supported without ‘-fasan-shadow-offset=’ for this target [-Werror]
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.
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.