mainline build failure for loongarch allmodconfig with gcc-12

From: Sudip Mukherjee (Codethink)
Date: Tue Aug 23 2022 - 05:27:28 EST


Hi All,

I have been trying to build loongarch as part of my nightly builds, and
I can build loongson3_defconfig without any error. But allmodconfig fails
with the error:

In function '__cmpxchg',
inlined from 'ssh_seq_next' at drivers/platform/surface/aggregator/controller.c:61:9,
inlined from 'ssam_request_write_data' at drivers/platform/surface/aggregator/controller.c:1483:8,
inlined from 'ssam_request_sync_with_buffer' at drivers/platform/surface/aggregator/controller.c:1761:8:
././include/linux/compiler_types.h:354:45: error: call to '__compiletime_assert_9' declared with attribute error: BUILD_BUG failed
354 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^
././include/linux/compiler_types.h:335:25: note: in definition of macro '__compiletime_assert'
335 | prefix ## suffix(); \
| ^~~~~~
././include/linux/compiler_types.h:354:9: note: in expansion of macro '_compiletime_assert'
354 | _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
| ^~~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
39 | #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
| ^~~~~~~~~~~~~~~~~~
./include/linux/build_bug.h:59:21: note: in expansion of macro 'BUILD_BUG_ON_MSG'
59 | #define BUILD_BUG() BUILD_BUG_ON_MSG(1, "BUILD_BUG failed")
| ^~~~~~~~~~~~~~~~
./arch/loongarch/include/asm/cmpxchg.h:83:17: note: in expansion of macro 'BUILD_BUG'
83 | BUILD_BUG();
| ^~~~~~~~~

I will be happy to test any patch or provide any extra log if needed.


--
Regards
Sudip