Skip to contentSkip to conversation

ARM: crypto: comment out gcc warning that breaks clang builds

PATCH In review Greg Kroah-Hartman 3 participants 6 messages Jul 31, 2022 – Aug 1, 2022

Subsystems (2)
lore
Share & tools
lore

Greg Kroah-Hartman

author maintainer
#0 lore raw

PATCH 1/1 ARM: crypto: comment out gcc warning that breaks clang builds

From: Greg Kroah-Hartman <[email protected]>

The gcc build warning prevents all clang-built kernels from working properly, so comment it out to fix the build.

This is a -stable kernel only patch for now, it will be resolved differently in mainline releases in the future.

Cc "Jason A. Donenfeld" <[email protected]>
Cc "Justin M. Forbes" <[email protected]>
Cc Ard Biesheuvel <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Nicolas Pitre <[email protected]>
Cc Nathan Chancellor <[email protected]>
Cc Nick Desaulniers <[email protected]>
---
 arch/arm/lib/xor-neon.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/lib/xor-neon.c +2 -1
index b99dd8e1c93f..7ba6cf826162 100644
@@ -26,8 +26,9 @@ MODULE_LICENSE("GPL");
  * While older versions of GCC do not generate incorrect code, they fail to
  * recognize the parallel nature of these functions, and emit plain ARM code,
  * which is known to be slower than the optimized ARM code in asm-arm/xor.h.
+ *
+ * #warning This code requires at least version 4.6 of GCC
  */
-#warning This code requires at least version 4.6 of GCC
 #endif
 
 #pragma GCC diagnostic ignored "-Wunused-variable"
Signature · 1 line
2.37.1
#1 lore raw
Quoted 26 lines · Greg Kroah-Hartman

From: Greg Kroah-Hartman <[email protected]>

The gcc build warning prevents all clang-built kernels from working properly, so comment it out to fix the build.

This is a -stable kernel only patch for now, it will be resolved differently in mainline releases in the future.

Cc "Jason A. Donenfeld" <[email protected]>
Cc "Justin M. Forbes" <[email protected]>
Cc Ard Biesheuvel <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Nicolas Pitre <[email protected]>
Cc Nathan Chancellor <[email protected]>
Cc Nick Desaulniers <[email protected]>
---
 arch/arm/lib/xor-neon.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/lib/xor-neon.c +0 -0
index b99dd8e1c93f..7ba6cf826162 100644

arch/arm/lib/xor-neon.c MODULE_LICENSE("GPL"); · line 34

Quoted 10 lines
arch/arm/lib/xor-neon.c +2 -1
@@ -26,8 +26,9 @@ MODULE_LICENSE("GPL");
  * While older versions of GCC do not generate incorrect code, they fail to
  * recognize the parallel nature of these functions, and emit plain ARM code,
  * which is known to be slower than the optimized ARM code in asm-arm/xor.h.
+ *
+ * #warning This code requires at least version 4.6 of GCC
  */
-#warning This code requires at least version 4.6 of GCC
 #endif
 
 #pragma GCC diagnostic ignored "-Wunused-variable"

LGTM but doesn't Clang also complain about the GCC specific pragma?

author maintainer
#2 lore raw
Quoted 37 lines · Ard Biesheuvel
Quoted 35 lines · Greg Kroah-Hartman

From: Greg Kroah-Hartman <[email protected]>

The gcc build warning prevents all clang-built kernels from working properly, so comment it out to fix the build.

This is a -stable kernel only patch for now, it will be resolved differently in mainline releases in the future.

Cc "Jason A. Donenfeld" <[email protected]>
Cc "Justin M. Forbes" <[email protected]>
Cc Ard Biesheuvel <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Nicolas Pitre <[email protected]>
Cc Nathan Chancellor <[email protected]>
Cc Nick Desaulniers <[email protected]>
---
 arch/arm/lib/xor-neon.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/lib/xor-neon.c +2 -1
index b99dd8e1c93f..7ba6cf826162 100644
@@ -26,8 +26,9 @@ MODULE_LICENSE("GPL");
  * While older versions of GCC do not generate incorrect code, they fail to
  * recognize the parallel nature of these functions, and emit plain ARM code,
  * which is known to be slower than the optimized ARM code in asm-arm/xor.h.
+ *
+ * #warning This code requires at least version 4.6 of GCC
  */
-#warning This code requires at least version 4.6 of GCC
 #endif
 
Quoted 3 lines

arch/arm/lib/xor-neon.c MODULE_LICENSE("GPL"); · line 34

Quoted 1 line
arch/arm/lib/xor-neon.c +0 -0
 #pragma GCC diagnostic ignored "-Wunused-variable"

LGTM but doesn't Clang also complain about the GCC specific pragma?

I don't know, all clang builds always failed at the first #warning line :)

#3 lore raw
Quoted 39 lines · Greg Kroah-Hartman
Quoted 37 lines · Ard Biesheuvel
Quoted 35 lines · Greg Kroah-Hartman

From: Greg Kroah-Hartman <[email protected]>

The gcc build warning prevents all clang-built kernels from working properly, so comment it out to fix the build.

This is a -stable kernel only patch for now, it will be resolved differently in mainline releases in the future.

Cc "Jason A. Donenfeld" <[email protected]>
Cc "Justin M. Forbes" <[email protected]>
Cc Ard Biesheuvel <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Nicolas Pitre <[email protected]>
Cc Nathan Chancellor <[email protected]>
Cc Nick Desaulniers <[email protected]>
---
 arch/arm/lib/xor-neon.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/lib/xor-neon.c +2 -1
index b99dd8e1c93f..7ba6cf826162 100644
@@ -26,8 +26,9 @@ MODULE_LICENSE("GPL");
  * While older versions of GCC do not generate incorrect code, they fail to
  * recognize the parallel nature of these functions, and emit plain ARM code,
  * which is known to be slower than the optimized ARM code in asm-arm/xor.h.
+ *
+ * #warning This code requires at least version 4.6 of GCC
  */
-#warning This code requires at least version 4.6 of GCC
 #endif
 
Quoted 5 lines
Quoted 3 lines

arch/arm/lib/xor-neon.c MODULE_LICENSE("GPL"); · line 34

Quoted 1 line
arch/arm/lib/xor-neon.c +0 -0
 #pragma GCC diagnostic ignored "-Wunused-variable"

LGTM but doesn't Clang also complain about the GCC specific pragma?

I don't know, all clang builds always failed at the first #warning line :)

Just tried it, and it appears to ignore the #pragma so we're all good.

author maintainer
#4 lore raw
Quoted 41 lines · Ard Biesheuvel
Quoted 39 lines · Greg Kroah-Hartman
Quoted 37 lines · Ard Biesheuvel
Quoted 35 lines · Greg Kroah-Hartman

From: Greg Kroah-Hartman <[email protected]>

The gcc build warning prevents all clang-built kernels from working properly, so comment it out to fix the build.

This is a -stable kernel only patch for now, it will be resolved differently in mainline releases in the future.

Cc "Jason A. Donenfeld" <[email protected]>
Cc "Justin M. Forbes" <[email protected]>
Cc Ard Biesheuvel <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Nicolas Pitre <[email protected]>
Cc Nathan Chancellor <[email protected]>
Cc Nick Desaulniers <[email protected]>
---
 arch/arm/lib/xor-neon.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/lib/xor-neon.c +2 -1
index b99dd8e1c93f..7ba6cf826162 100644
@@ -26,8 +26,9 @@ MODULE_LICENSE("GPL");
  * While older versions of GCC do not generate incorrect code, they fail to
  * recognize the parallel nature of these functions, and emit plain ARM code,
  * which is known to be slower than the optimized ARM code in asm-arm/xor.h.
+ *
+ * #warning This code requires at least version 4.6 of GCC
  */
-#warning This code requires at least version 4.6 of GCC
 #endif
 
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

arch/arm/lib/xor-neon.c MODULE_LICENSE("GPL"); · line 34

Quoted 1 line
arch/arm/lib/xor-neon.c +0 -0
 #pragma GCC diagnostic ignored "-Wunused-variable"

LGTM but doesn't Clang also complain about the GCC specific pragma?

I don't know, all clang builds always failed at the first #warning line :)

Just tried it, and it appears to ignore the #pragma so we're all good.

Wonderful, thanks for testing.

greg k-h

Acked-by on v1 1/1
#5 lore raw
In reply to Greg Kroah-Hartman
Quoted 9 lines · Greg Kroah-Hartman

From: Greg Kroah-Hartman <[email protected]>

The gcc build warning prevents all clang-built kernels from working properly, so comment it out to fix the build.

This is a -stable kernel only patch for now, it will be resolved differently in mainline releases in the future.

Quoted 8 lines
Cc "Jason A. Donenfeld" <[email protected]>
Cc "Justin M. Forbes" <[email protected]>
Cc Ard Biesheuvel <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Nicolas Pitre <[email protected]>
Cc Nathan Chancellor <[email protected]>
Cc Nick Desaulniers <[email protected]>

I always resisted this from going into mainline without actually making the code work
as intended on clang, but now that mainline kernels get it right and we have decided not to backport the new version, this is the best we can do for LTS backports.

Arnd