Skip to contentSkip to conversation

kunit: fixes Compilation error on s390

PATCH In review Alessandro Carminati 4 participants 4 messages Mar 29, 2025 – Mar 31, 2025

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kunit: fixes Compilation error on s390

The current implementation of suppressing warning backtraces uses __func__, which is a compile-time constant only for non -fPIC compilation. GCC's support for this situation in position-independent code varies across versions and architectures.

On the s390 architecture, -fPIC is required for compilation, and support for this scenario is available in GCC 11 and later.

Fixes d8b14a2 ("bug/kunit: core support for suppressing warning backtraces")
---
 lib/kunit/Kconfig | 1 +
 1 file changed, 1 insertion(+)
lib/kunit/Kconfig +1 -0
index 201402f0ab49..6c937144dcea 100644
@@ -17,6 +17,7 @@ if KUNIT
 
 config KUNIT_SUPPRESS_BACKTRACE
 	bool "KUnit - Enable backtrace suppression"
+	depends on (!S390 && CC_IS_GCC) || (CC_IS_GCC && GCC_VERSION >= 110000)
 	default y
 	help
 	  Enable backtrace suppression for KUnit. If enabled, backtraces
Signature · 1 line
2.34.1
#1 lore raw

Hi Alessandro,

Quoted 6 lines · On Sat, 29 Mar 2025 15:03:20 +0000 Alessandro Carminati <[email protected]>…

The current implementation of suppressing warning backtraces uses __func__, which is a compile-time constant only for non -fPIC compilation. GCC's support for this situation in position-independent code varies across versions and architectures.

Quoted 6 lines

On the s390 architecture, -fPIC is required for compilation, and support for this scenario is available in GCC 11 and later.

Fixes d8b14a2 ("bug/kunit: core support for suppressing warning backtraces")

Please keep all the commit message tags together at the end of the commit message.

Signature · 2 lines
Cheers,
Stephen Rothwell
Acked-by on v1 1/1
#2 lore raw
In reply to Alessandro Carminati
Quoted 6 lines · Alessandro Carminati

The current implementation of suppressing warning backtraces uses __func__, which is a compile-time constant only for non -fPIC compilation. GCC's support for this situation in position-independent code varies across versions and architectures.

Quoted 7 lines

On the s390 architecture, -fPIC is required for compilation, and support for this scenario is available in GCC 11 and later.

Fixes d8b14a2 ("bug/kunit: core support for suppressing warning backtraces")

---

Makes sense and seems to work here. Thanks!

Cheers,
-- David

Quoted 18 lines
 lib/kunit/Kconfig | 1 +
 1 file changed, 1 insertion(+)
lib/kunit/Kconfig +1 -1
index 201402f0ab49..6c937144dcea 100644
@@ -17,6 +17,7 @@ if KUNIT
 
 config KUNIT_SUPPRESS_BACKTRACE
        bool "KUnit - Enable backtrace suppression"
+       depends on (!S390 && CC_IS_GCC) || (CC_IS_GCC && GCC_VERSION >= 110000)
        default y
        help
          Enable backtrace suppression for KUnit. If enabled, backtraces
--

2.34.1

maintainer Acked-by on v1 1/1
#3 lore raw
In reply to Alessandro Carminati
Quoted 8 lines · Alessandro Carminati

The current implementation of suppressing warning backtraces uses __func__, which is a compile-time constant only for non -fPIC compilation. GCC's support for this situation in position-independent code varies across versions and architectures.

On the s390 architecture, -fPIC is required for compilation, and support for this scenario is available in GCC 11 and later.

Quoted 6 lines
Fixes d8b14a2 ("bug/kunit: core support for suppressing warning backtraces")
---
 lib/kunit/Kconfig | 1 +
 1 file changed, 1 insertion(+)