diff mbox series

predefine __ATOMIC_ACQUIRE & friends as weak

Message ID 20220614001725.29431-1-lucvoo@kernel.org (mailing list archive)
State Mainlined, archived
Headers show
Series predefine __ATOMIC_ACQUIRE & friends as weak | expand

Commit Message

Luc Van Oostenryck June 14, 2022, 12:17 a.m. UTC
From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>

In kernel's arch/mips/Makefile the whole content of gcc's -dM is used
for CHECKFLAGS. This conflict with some macros also defined internally:
	builtin:1:9: warning: preprocessor token __ATOMIC_ACQUIRE redefined
	builtin:0:0: this was the original definition

Fix this by using a weak define for these macros.

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 predefine.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/predefine.c b/predefine.c
index 98e38a04579d..5b0f0caf4c35 100644
--- a/predefine.c
+++ b/predefine.c
@@ -179,12 +179,12 @@  void predefined_macros(void)
 	if (arch_target->has_int128)
 		predefined_sizeof("INT128", "", 128);
 
-	predefine("__ATOMIC_RELAXED", 0, "0");
-	predefine("__ATOMIC_CONSUME", 0, "1");
-	predefine("__ATOMIC_ACQUIRE", 0, "3");
-	predefine("__ATOMIC_RELEASE", 0, "4");
-	predefine("__ATOMIC_ACQ_REL", 0, "7");
-	predefine("__ATOMIC_SEQ_CST", 0, "8");
+	predefine("__ATOMIC_RELAXED", 1, "0");
+	predefine("__ATOMIC_CONSUME", 1, "1");
+	predefine("__ATOMIC_ACQUIRE", 1, "3");
+	predefine("__ATOMIC_RELEASE", 1, "4");
+	predefine("__ATOMIC_ACQ_REL", 1, "7");
+	predefine("__ATOMIC_SEQ_CST", 1, "8");
 
 	predefine("__ORDER_LITTLE_ENDIAN__", 1, "1234");
 	predefine("__ORDER_BIG_ENDIAN__", 1, "4321");