[linux-next:master 1565/1734] include/linux/fortify-string.h:98:19: error: initializer element is not constant

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   d25ee88530253138d0b20d43511ca5acbda4e9f7
commit: 6303361147fc8984dd259b54c189592cd0551ab6 [1565/1734] fortify: Work around Clang inlining bugs
config: arm64-allyesconfig (https://download.01.org/0day-ci/archive/20220125/202201252321.dRmWZ8wW-lkp@xxxxxxxxx/config)
compiler: aarch64-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=6303361147fc8984dd259b54c189592cd0551ab6
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 6303361147fc8984dd259b54c189592cd0551ab6
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/firmware/ lib//

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

   In file included from include/linux/string.h:253,
                    from include/linux/bitmap.h:11,
                    from include/linux/cpumask.h:12,
                    from include/linux/smp.h:13,
                    from arch/arm64/include/asm/arch_timer.h:18,
                    from arch/arm64/include/asm/timex.h:8,
                    from include/linux/timex.h:65,
                    from include/linux/time32.h:13,
                    from include/linux/time.h:60,
                    from arch/arm64/include/asm/stat.h:12,
                    from include/linux/stat.h:6,
                    from include/linux/module.h:13,
                    from drivers/firmware/xilinx/zynqmp-debug.c:14:
>> include/linux/fortify-string.h:98:19: error: initializer element is not constant
      98 | #define strlen(p) __fortify_strlen(p, __builtin_object_size(p, 1))
         |                   ^~~~~~~~~~~~~~~~
   drivers/firmware/xilinx/zynqmp-debug.c:32:44: note: in expansion of macro 'strlen'
      32 | #define PM_API(id)               {id, #id, strlen(#id)}
         |                                            ^~~~~~
   drivers/firmware/xilinx/zynqmp-debug.c:34:9: note: in expansion of macro 'PM_API'
      34 |         PM_API(PM_GET_API_VERSION),
         |         ^~~~~~
   include/linux/fortify-string.h:98:19: note: (near initialization for 'pm_api_list[0].api_name_len')
      98 | #define strlen(p) __fortify_strlen(p, __builtin_object_size(p, 1))
         |                   ^~~~~~~~~~~~~~~~
   drivers/firmware/xilinx/zynqmp-debug.c:32:44: note: in expansion of macro 'strlen'
      32 | #define PM_API(id)               {id, #id, strlen(#id)}
         |                                            ^~~~~~
   drivers/firmware/xilinx/zynqmp-debug.c:34:9: note: in expansion of macro 'PM_API'
      34 |         PM_API(PM_GET_API_VERSION),
         |         ^~~~~~
>> include/linux/fortify-string.h:98:19: error: initializer element is not constant
      98 | #define strlen(p) __fortify_strlen(p, __builtin_object_size(p, 1))
         |                   ^~~~~~~~~~~~~~~~
   drivers/firmware/xilinx/zynqmp-debug.c:32:44: note: in expansion of macro 'strlen'
      32 | #define PM_API(id)               {id, #id, strlen(#id)}
         |                                            ^~~~~~
   drivers/firmware/xilinx/zynqmp-debug.c:35:9: note: in expansion of macro 'PM_API'
      35 |         PM_API(PM_QUERY_DATA),
         |         ^~~~~~
   include/linux/fortify-string.h:98:19: note: (near initialization for 'pm_api_list[1].api_name_len')
      98 | #define strlen(p) __fortify_strlen(p, __builtin_object_size(p, 1))
         |                   ^~~~~~~~~~~~~~~~
   drivers/firmware/xilinx/zynqmp-debug.c:32:44: note: in expansion of macro 'strlen'
      32 | #define PM_API(id)               {id, #id, strlen(#id)}
         |                                            ^~~~~~
   drivers/firmware/xilinx/zynqmp-debug.c:35:9: note: in expansion of macro 'PM_API'
      35 |         PM_API(PM_QUERY_DATA),
         |         ^~~~~~


vim +98 include/linux/fortify-string.h

    96	
    97	/* defined after fortified strnlen to reuse it. */
  > 98	#define strlen(p) __fortify_strlen(p, __builtin_object_size(p, 1))
    99	__FORTIFY_INLINE __kernel_size_t __fortify_strlen(const char *p, const size_t p_size)
   100	{
   101		__kernel_size_t ret;
   102	
   103		/* Give up if we don't know how large p is. */
   104		if (p_size == (size_t)-1)
   105			return __underlying_strlen(p);
   106		ret = strnlen(p, p_size);
   107		if (p_size <= ret)
   108			fortify_panic(__func__);
   109		return ret;
   110	}
   111	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux