From 909bf2dbb40b015e56eeeaf70552a181a42329a4 Mon Sep 17 00:00:00 2001 From: wangmingrong1 Date: Thu, 5 Dec 2024 12:01:01 +0800 Subject: [PATCH] kasan/globals: fix compile error ../../../mm/kasan/global.c:58:44: error: type of 'g_global_region' does not match original declaration [-Werror=lto-type-mismatch] 58 | extern const struct kasan_global_region_s *g_global_region[]; | ^ kasan_globals.tmp:3:21: note: 'g_global_region' was previously declared here 3 | const unsigned long g_global_region[] = { | ^ lto1: all warnings being treated as errors Signed-off-by: wangmingrong1 --- tools/kasan_global.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/kasan_global.py b/tools/kasan_global.py index 6760a98306..4ef746fb3d 100755 --- a/tools/kasan_global.py +++ b/tools/kasan_global.py @@ -266,9 +266,12 @@ def create_kasan_file(config: Config, region_list=[]): file.write("\n};") # Record kasan region pointer location - file.write("\nconst unsigned long g_global_region[] = {\n") + file.write("struct kasan_global_region_s;\n") + file.write("const struct kasan_global_region_s *g_global_region[] = {\n") for i in range(len(region_list)): - file.write("\n(const unsigned long)&globals_region%d," % (i)) + file.write( + "\n(const struct kasan_global_region_s *)&globals_region%d," % (i) + ) file.write("0x00\n};")