From 891423134031fdc611b6cad5819427a8ef97bbae Mon Sep 17 00:00:00 2001 From: Miguel Ojeda Date: Mon, 26 Sep 2022 19:19:29 +0200 Subject: [PATCH 1/2] Makefile: add comment to explain `RUSTC_BOOTSTRAP` Link: https://lore.kernel.org/lkml/CAK7LNASzund0a=t6gz3Mfex3j6jMfjYW--nqv9x_wY=RzSR-=g@mail.gmail.com/ Signed-off-by: Miguel Ojeda --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index a105cb893b4ca0..32dce415d703d1 100644 --- a/Makefile +++ b/Makefile @@ -593,6 +593,7 @@ ifdef RUST_LIB_SRC export RUST_LIB_SRC endif +# Allows the usage of unstable features in stable compilers. export RUSTC_BOOTSTRAP := 1 export ARCH SRCARCH CONFIG_SHELL BASH HOSTCC KBUILD_HOSTCFLAGS CROSS_COMPILE LD CC HOSTPKG_CONFIG From 152d8e87560f0eab123b1c30c584f10f7b880830 Mon Sep 17 00:00:00 2001 From: Miguel Ojeda Date: Tue, 27 Sep 2022 09:10:39 +0200 Subject: [PATCH 2/2] kallsyms: explain why the `_Static_assert` is needed Suggested-by: Boqun Feng Suggested-by: Kees Cook Link: https://lore.kernel.org/lkml/202208171330.BB5B081D1@keescook/ Signed-off-by: Miguel Ojeda --- scripts/kallsyms.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c index 3b64dda7e4ccef..41013d9a18acba 100644 --- a/scripts/kallsyms.c +++ b/scripts/kallsyms.c @@ -32,7 +32,13 @@ #define KSYM_NAME_LEN 512 -/* A substantially bigger size than the current maximum. */ +/* + * A substantially bigger size than the current maximum. + * + * It cannot be defined as an expression because it gets stringified + * for the fscanf() format string. Therefore, a _Static_assert() is + * used instead to maintain the relationship with KSYM_NAME_LEN. + */ #define KSYM_NAME_LEN_BUFFER 2048 _Static_assert( KSYM_NAME_LEN_BUFFER == KSYM_NAME_LEN * 4,