include/linux/compiler_types.h:82:5: sparse: sparse: undefined preprocessor identifier 'CONFIG_FUNCTION_ALIGNMENT'

From: kernel test robot
Date: Mon Jun 26 2023 - 03:51:57 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: e660abd551f1172e428b4e4003de887176a8a1fd
commit: c27cd083cfb9d392f304657ed00fcde1136704e7 Compiler attributes: GCC cold function alignment workarounds
date: 5 months ago
config: um-randconfig-s053-20230621 (https://download.01.org/0day-ci/archive/20230622/202306220043.IHVrU1h8-lkp@xxxxxxxxx/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230622/202306220043.IHVrU1h8-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <yujie.liu@xxxxxxxxx>
| Closes: https://lore.kernel.org/r/202306220043.IHVrU1h8-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
arch/um/kernel/config.c: note: in included file (through include/linux/compiler_types.h, arch/um/include/shared/init.h):
include/linux/compiler_attributes.h:55:9: sparse: sparse: preprocessor token __always_inline redefined
arch/um/kernel/config.c: note: in included file (through /usr/include/features.h, /usr/include/sys/types.h, arch/um/include/shared/user.h, builtin):
/usr/include/sys/cdefs.h:424:10: sparse: this was the original definition
arch/um/kernel/config.c: note: in included file (through arch/um/include/shared/init.h):
>> include/linux/compiler_types.h:82:5: sparse: sparse: undefined preprocessor identifier 'CONFIG_FUNCTION_ALIGNMENT'
--
arch/um/drivers/fd.c: note: in included file (through include/linux/compiler_types.h, arch/um/include/shared/init.h, arch/um/drivers/chan_user.h):
include/linux/compiler_attributes.h:55:9: sparse: sparse: preprocessor token __always_inline redefined
arch/um/drivers/fd.c: note: in included file (through /usr/include/features.h, /usr/include/sys/types.h, arch/um/include/shared/user.h, builtin):
/usr/include/sys/cdefs.h:424:10: sparse: this was the original definition
arch/um/drivers/fd.c: note: in included file (through arch/um/include/shared/init.h, arch/um/drivers/chan_user.h):
>> include/linux/compiler_types.h:82:5: sparse: sparse: undefined preprocessor identifier 'CONFIG_FUNCTION_ALIGNMENT'
--
arch/um/drivers/chan_user.c: note: in included file (through include/linux/compiler_types.h, arch/um/include/shared/init.h, arch/um/drivers/chan_user.h):
include/linux/compiler_attributes.h:55:9: sparse: sparse: preprocessor token __always_inline redefined
arch/um/drivers/chan_user.c: note: in included file (through /usr/include/features.h, /usr/include/sys/types.h, arch/um/include/shared/user.h, builtin):
/usr/include/sys/cdefs.h:424:10: sparse: this was the original definition
arch/um/drivers/chan_user.c: note: in included file (through arch/um/include/shared/init.h, arch/um/drivers/chan_user.h):
>> include/linux/compiler_types.h:82:5: sparse: sparse: undefined preprocessor identifier 'CONFIG_FUNCTION_ALIGNMENT'
--
arch/um/drivers/port_user.c: note: in included file (through include/linux/compiler_types.h, arch/um/include/shared/init.h, arch/um/drivers/chan_user.h):
include/linux/compiler_attributes.h:55:9: sparse: sparse: preprocessor token __always_inline redefined
arch/um/drivers/port_user.c: note: in included file (through /usr/include/features.h, /usr/include/sys/types.h, arch/um/include/shared/user.h, builtin):
/usr/include/sys/cdefs.h:424:10: sparse: this was the original definition
arch/um/drivers/port_user.c: note: in included file (through arch/um/include/shared/init.h, arch/um/drivers/chan_user.h):
>> include/linux/compiler_types.h:82:5: sparse: sparse: undefined preprocessor identifier 'CONFIG_FUNCTION_ALIGNMENT'
arch/um/drivers/port_user.c:179:32: sparse: sparse: Using plain integer as NULL pointer
--
arch/um/os-Linux/main.c: note: in included file (through include/linux/compiler_types.h, arch/um/include/shared/init.h):
include/linux/compiler_attributes.h:55:9: sparse: sparse: preprocessor token __always_inline redefined
arch/um/os-Linux/main.c: note: in included file (through /usr/include/features.h, /usr/include/sys/types.h, arch/um/include/shared/user.h, builtin):
/usr/include/sys/cdefs.h:424:10: sparse: this was the original definition
arch/um/os-Linux/main.c: note: in included file (through arch/um/include/shared/init.h):
>> include/linux/compiler_types.h:82:5: sparse: sparse: undefined preprocessor identifier 'CONFIG_FUNCTION_ALIGNMENT'
arch/um/os-Linux/main.c:187:6: sparse: sparse: symbol '__wrap_malloc' was not declared. Should it be static?
arch/um/os-Linux/main.c:208:6: sparse: sparse: symbol '__wrap_calloc' was not declared. Should it be static?
arch/um/os-Linux/main.c:222:6: sparse: sparse: symbol '__wrap_free' was not declared. Should it be static?
--
arch/um/os-Linux/mem.c: note: in included file (through include/linux/compiler_types.h, arch/um/include/shared/init.h):
include/linux/compiler_attributes.h:55:9: sparse: sparse: preprocessor token __always_inline redefined
arch/um/os-Linux/mem.c: note: in included file (through /usr/include/features.h, /usr/include/sys/types.h, arch/um/include/shared/user.h, builtin):
/usr/include/sys/cdefs.h:424:10: sparse: this was the original definition
arch/um/os-Linux/mem.c: note: in included file (through arch/um/include/shared/init.h):
>> include/linux/compiler_types.h:82:5: sparse: sparse: undefined preprocessor identifier 'CONFIG_FUNCTION_ALIGNMENT'
--
arch/um/os-Linux/process.c: note: in included file (through include/linux/compiler_types.h, arch/um/include/shared/init.h):
include/linux/compiler_attributes.h:55:9: sparse: sparse: preprocessor token __always_inline redefined
arch/um/os-Linux/process.c: note: in included file (through /usr/include/features.h, /usr/include/sys/types.h, arch/um/include/shared/user.h, builtin):
/usr/include/sys/cdefs.h:424:10: sparse: this was the original definition
arch/um/os-Linux/process.c: note: in included file (through arch/um/include/shared/init.h):
>> include/linux/compiler_types.h:82:5: sparse: sparse: undefined preprocessor identifier 'CONFIG_FUNCTION_ALIGNMENT'
--
arch/um/os-Linux/sigio.c: note: in included file (through include/linux/compiler_types.h, arch/um/include/shared/init.h):
include/linux/compiler_attributes.h:55:9: sparse: sparse: preprocessor token __always_inline redefined
arch/um/os-Linux/sigio.c: note: in included file (through /usr/include/features.h, /usr/include/sys/types.h, arch/um/include/shared/user.h, builtin):
/usr/include/sys/cdefs.h:424:10: sparse: this was the original definition
arch/um/os-Linux/sigio.c: note: in included file (through arch/um/include/shared/init.h):
>> include/linux/compiler_types.h:82:5: sparse: sparse: undefined preprocessor identifier 'CONFIG_FUNCTION_ALIGNMENT'
--
arch/um/os-Linux/start_up.c: note: in included file (through include/linux/compiler_types.h, arch/um/include/shared/init.h):
include/linux/compiler_attributes.h:55:9: sparse: sparse: preprocessor token __always_inline redefined
arch/um/os-Linux/start_up.c: note: in included file (through /usr/include/features.h, /usr/include/sys/types.h, arch/um/include/shared/user.h, builtin):
/usr/include/sys/cdefs.h:424:10: sparse: this was the original definition
arch/um/os-Linux/start_up.c: note: in included file (through arch/um/include/shared/init.h):
>> include/linux/compiler_types.h:82:5: sparse: sparse: undefined preprocessor identifier 'CONFIG_FUNCTION_ALIGNMENT'
--
arch/um/os-Linux/umid.c: note: in included file (through include/linux/compiler_types.h, arch/um/include/shared/init.h):
include/linux/compiler_attributes.h:55:9: sparse: sparse: preprocessor token __always_inline redefined
arch/um/os-Linux/umid.c: note: in included file (through /usr/include/features.h, /usr/include/sys/types.h, arch/um/include/shared/user.h, builtin):
/usr/include/sys/cdefs.h:424:10: sparse: this was the original definition
arch/um/os-Linux/umid.c: note: in included file (through arch/um/include/shared/init.h):
>> include/linux/compiler_types.h:82:5: sparse: sparse: undefined preprocessor identifier 'CONFIG_FUNCTION_ALIGNMENT'
--
arch/um/os-Linux/util.c: note: in included file (through include/linux/compiler_types.h, arch/um/include/shared/init.h):
include/linux/compiler_attributes.h:55:9: sparse: sparse: preprocessor token __always_inline redefined
arch/um/os-Linux/util.c: note: in included file (through /usr/include/features.h, /usr/include/sys/types.h, arch/um/include/shared/user.h, builtin):
/usr/include/sys/cdefs.h:424:10: sparse: this was the original definition
arch/um/os-Linux/util.c: note: in included file (through arch/um/include/shared/init.h):
>> include/linux/compiler_types.h:82:5: sparse: sparse: undefined preprocessor identifier 'CONFIG_FUNCTION_ALIGNMENT'
arch/um/os-Linux/util.c:93:48: sparse: sparse: Using plain integer as NULL pointer
--
arch/um/os-Linux/skas/mem.c: note: in included file (through include/linux/compiler_types.h, arch/um/include/shared/init.h):
include/linux/compiler_attributes.h:55:9: sparse: sparse: preprocessor token __always_inline redefined
arch/um/os-Linux/skas/mem.c: note: in included file (through /usr/include/features.h, /usr/include/sys/types.h, arch/um/include/shared/user.h, builtin):
/usr/include/sys/cdefs.h:424:10: sparse: this was the original definition
arch/um/os-Linux/skas/mem.c: note: in included file (through arch/um/include/shared/init.h):
>> include/linux/compiler_types.h:82:5: sparse: sparse: undefined preprocessor identifier 'CONFIG_FUNCTION_ALIGNMENT'
--
arch/um/os-Linux/skas/process.c: note: in included file (through include/linux/compiler_types.h, arch/um/include/shared/init.h):
include/linux/compiler_attributes.h:55:9: sparse: sparse: preprocessor token __always_inline redefined
arch/um/os-Linux/skas/process.c: note: in included file (through /usr/include/features.h, /usr/include/sys/types.h, arch/um/include/shared/user.h, builtin):
/usr/include/sys/cdefs.h:424:10: sparse: this was the original definition
arch/um/os-Linux/skas/process.c: note: in included file (through arch/um/include/shared/init.h):
>> include/linux/compiler_types.h:82:5: sparse: sparse: undefined preprocessor identifier 'CONFIG_FUNCTION_ALIGNMENT'
arch/um/os-Linux/skas/process.c:300:5: sparse: sparse: symbol 'kill_userspace_mm' was not declared. Should it be static?

vim +/CONFIG_FUNCTION_ALIGNMENT +82 include/linux/compiler_types.h

a3f8a30f3f0079 Miguel Ojeda 2018-08-30 81
c27cd083cfb9d3 Mark Rutland 2023-01-23 @82 #if CONFIG_FUNCTION_ALIGNMENT > 0
c27cd083cfb9d3 Mark Rutland 2023-01-23 83 #define __function_aligned __aligned(CONFIG_FUNCTION_ALIGNMENT)
c27cd083cfb9d3 Mark Rutland 2023-01-23 84 #else
c27cd083cfb9d3 Mark Rutland 2023-01-23 85 #define __function_aligned
c27cd083cfb9d3 Mark Rutland 2023-01-23 86 #endif
c27cd083cfb9d3 Mark Rutland 2023-01-23 87

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki