arch/loongarch/include/asm/percpu.h:20:4: error: #error compiler support for the model attribute is necessary when a recent assembler is used

From: kernel test robot
Date: Fri Sep 22 2023 - 05:26:03 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 27bbf45eae9ca98877a2d52a92a188147cd61b07
commit: 38b10b269d04540aee05c34a059dcf304cfce0a8 LoongArch: Tweak CFLAGS for Clang compatibility
date: 3 months ago
config: loongarch-loongson3_defconfig (https://download.01.org/0day-ci/archive/20230922/202309221713.iTLkJPrI-lkp@xxxxxxxxx/config)
compiler: loongarch64-linux-gcc (GCC) 12.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230922/202309221713.iTLkJPrI-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 <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202309221713.iTLkJPrI-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

In file included from include/linux/percpu.h:12,
from include/linux/context_tracking_state.h:5,
from include/linux/hardirq.h:5,
from include/linux/interrupt.h:11,
from sound/pci/bt87x.c:11:
>> arch/loongarch/include/asm/percpu.h:20:4: error: #error compiler support for the model attribute is necessary when a recent assembler is used
20 | # error compiler support for the model attribute is necessary when a recent assembler is used
| ^~~~~


vim +20 arch/loongarch/include/asm/percpu.h

10
11 /*
12 * The "address" (in fact, offset from $r21) of a per-CPU variable is close to
13 * the loading address of main kernel image, but far from where the modules are
14 * loaded. Tell the compiler this fact when using explicit relocs.
15 */
16 #if defined(MODULE) && defined(CONFIG_AS_HAS_EXPLICIT_RELOCS)
17 # if __has_attribute(model)
18 # define PER_CPU_ATTRIBUTES __attribute__((model("extreme")))
19 # else
> 20 # error compiler support for the model attribute is necessary when a recent assembler is used
21 # endif
22 #endif
23

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