Hi Nick, I love your patch! Yet something to improve: [auto build test ERROR on 4de593fb965fc2bd11a0b767e0c65ff43540a6e4] url: https://github.com/0day-ci/linux/commits/Nick-Desaulniers/kallsyms-strip-LTO-suffixes-from-static-functions/20211002-035956 base: 4de593fb965fc2bd11a0b767e0c65ff43540a6e4 config: i386-randconfig-m021-20211002 (attached as .config) compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 reproduce (this is a W=1 build): # https://github.com/0day-ci/linux/commit/b73f738c48b304c633f9ff079fd8de572ffc6eb0 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Nick-Desaulniers/kallsyms-strip-LTO-suffixes-from-static-functions/20211002-035956 git checkout b73f738c48b304c633f9ff079fd8de572ffc6eb0 # save the attached .config to linux build tree mkdir build_dir make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All errors (new ones prefixed by >>): kernel/kallsyms.c: In function 'cleanup_symbol_name': >> kernel/kallsyms.c:190:6: error: '__clang_major__' undeclared (first use in this function) 190 | __clang_major__ >= 13) | ^~~~~~~~~~~~~~~ kernel/kallsyms.c:190:6: note: each undeclared identifier is reported only once for each function it appears in kernel/kallsyms.c: At top level: kernel/kallsyms.c:585:12: warning: no previous prototype for 'arch_get_kallsym' [-Wmissing-prototypes] 585 | int __weak arch_get_kallsym(unsigned int symnum, unsigned long *value, | ^~~~~~~~~~~~~~~~ vim +/__clang_major__ +190 kernel/kallsyms.c 166 167 static bool cleanup_symbol_name(char *s) 168 { 169 char *res; 170 171 if (!IS_ENABLED(CONFIG_LTO_CLANG)) 172 return false; 173 174 /* 175 * LLVM appends various suffixes for local functions and variables that must 176 * be promoted to global scope as part of LTO. This can break hooking of 177 * static functions with kprobes. '.' is not a valid character in an 178 * identifier in C. Suffixes observed: 179 * - foo.llvm.[0-9a-f]+ 180 * - foo.[0-9a-f]+ 181 * - foo.[0-9a-f]+.cfi_jt 182 */ 183 res = strchr(s, '.'); 184 if (res) { 185 *res = '\0'; 186 return true; 187 } 188 189 if (!IS_ENABLED(CONFIG_CFI_CLANG) || !IS_ENABLED(CONFIG_LTO_CLANG_THIN) || > 190 __clang_major__ >= 13) 191 return false; 192 193 /* 194 * Prior to LLVM 13, the following suffixes were observed when thinLTO 195 * and CFI are both enabled: 196 * - foo$[0-9]+ 197 */ 198 res = strrchr(s, '$'); 199 if (res) { 200 *res = '\0'; 201 return true; 202 } 203 204 return false; 205 } 206 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org