Skip to contentSkip to conversation

Makefile: disallow data races on gcc-10 as well

PATCH In review Sergei Trofimovich 3 participants 4 messages Mar 17, 2020 – Mar 19, 2020 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: disallow data races on gcc-10 as well

gcc-10 will rename --param=allow-store-data-races=0 to -fno-allow-store-data-races.

The flag change happened at https://gcc.gnu.org/PR92046.

---
 Makefile | 1 +
 1 file changed, 1 insertion(+)
Makefile +1 -0
index 171f2b004c8a..9696eb2cd5a1 100644
@@ -714,6 +714,7 @@ endif
 
 # Tell gcc to never replace conditional load with a non-conditional one
 KBUILD_CFLAGS	+= $(call cc-option,--param=allow-store-data-races=0)
+KBUILD_CFLAGS	+= $(call cc-option,-fno-allow-store-data-races)
 
 include scripts/Makefile.kcov
 include scripts/Makefile.gcc-plugins
Signature · 1 line
2.25.1
#1 lore raw
Quoted 19 lines · Sergei Trofimovich

gcc-10 will rename --param=allow-store-data-races=0 to -fno-allow-store-data-races.

The flag change happened at https://gcc.gnu.org/PR92046.

---
 Makefile | 1 +
 1 file changed, 1 insertion(+)
Makefile +0 -0
index 171f2b004c8a..9696eb2cd5a1 100644

Makefile endif · line 717

Quoted 4 lines
Makefile +1 -0
@@ -714,6 +714,7 @@ endif
 
 # Tell gcc to never replace conditional load with a non-conditional one
 KBUILD_CFLAGS	+= $(call cc-option,--param=allow-store-data-races=0)
+KBUILD_CFLAGS	+= $(call cc-option,-fno-allow-store-data-races)

I have to say I can't really read gcc sources without major cerebral pain, so let me me dense here: what happens to gcc<10 if you pass -fno-allow-store-data-races to it?

My expectation would be that it would just blow up in fatal error, meaning that after we apply your patch, kernel couldn't be successfully compiled by any compiler that doesn't understand '-fno-allow-store-data-races' (which is just about any compiler on this planet).

Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs
Acked-by
#2 lore raw
Quoted 17 lines · Jiri Kosina
Quoted 17 lines

The flag change happened at https://gcc.gnu.org/PR92046.

---
 Makefile | 1 +
 1 file changed, 1 insertion(+)
Makefile +0 -0
index 171f2b004c8a..9696eb2cd5a1 100644
@@ -714,6 +714,7 @@ endif
 
Quoted 7 lines

Makefile endif · line 717

Quoted 3 lines
Makefile +1 -0
 # Tell gcc to never replace conditional load with a non-conditional one
 KBUILD_CFLAGS	+= $(call cc-option,--param=allow-store-data-races=0)
+KBUILD_CFLAGS	+= $(call cc-option,-fno-allow-store-data-races)

I have to say I can't really read gcc sources without major cerebral pain, so let me me dense here: what happens to gcc<10 if you pass -fno-allow-store-data-races to it?

Sorry, brainfart on my side, your patch is good :)

Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs
#3 lore raw
Quoted 30 lines · Jiri Kosina
Quoted 17 lines · Jiri Kosina
Quoted 17 lines

The flag change happened at https://gcc.gnu.org/PR92046.

---
 Makefile | 1 +
 1 file changed, 1 insertion(+)
Makefile +0 -0
index 171f2b004c8a..9696eb2cd5a1 100644
@@ -714,6 +714,7 @@ endif
 
Quoted 7 lines

Makefile endif · line 717

Quoted 3 lines
Makefile +1 -0
 # Tell gcc to never replace conditional load with a non-conditional one
 KBUILD_CFLAGS      += $(call cc-option,--param=allow-store-data-races=0)
+KBUILD_CFLAGS      += $(call cc-option,-fno-allow-store-data-races)

I have to say I can't really read gcc sources without major cerebral pain, so let me me dense here: what happens to gcc<10 if you pass -fno-allow-store-data-races to it?

Sorry, brainfart on my side, your patch is good :)

Quoted 8 lines

Thanks,

--
Jiri Kosina
SUSE Labs

Applied to linux-kbuild with Jiri's Ack.

Thanks.

Signature · 2 lines
Best Regards
Masahiro Yamada