]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
s390: Add CC_HAS_ASM_IMMEDIATE_STRINGS
authorHeiko Carstens <hca@linux.ibm.com>
Fri, 9 Jan 2026 15:31:36 +0000 (16:31 +0100)
committerHeiko Carstens <hca@linux.ibm.com>
Tue, 27 Jan 2026 11:16:15 +0000 (12:16 +0100)
Upcoming changes to s390 specific inline assemblies require the usage of
strings as immediate input operands. This works only with gcc-9 and newer
compilers. With gcc-8 this leads to a compile error:

void bar(void) { asm volatile("" :: "i" ("foo")); }

Results in:

In function 'bar':
 warning: asm operand 0 probably doesn't match constraints
  asm volatile("" :: "i" ("foo"));
  ^~~
 error: impossible constraint in 'asm'

Provide a CC_HAS_ASM_IMMEDIATE_STRINGS config option which allows to tell
if the compiler supports strings as immediate input operands.
Based on that conditional code can be provided.

Reviewed-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/Kconfig

index cd856318ffe5517ba25984c0d7e7e70d92fa386d..fcce8c5db703d30f407dd52c5e49045c79f7abe6 100644 (file)
@@ -69,6 +69,12 @@ config CC_HAS_ASM_AOR_FORMAT_FLAGS
          Clang versions before 19.1.0 do not support A,
          O, and R inline assembly format flags.
 
+config CC_HAS_ASM_IMMEDIATE_STRINGS
+       def_bool !(CC_IS_GCC && GCC_VERSION < 90000)
+       help
+         GCC versions before 9.0.0 cannot handle strings as immediate
+         input operands in inline assemblies.
+
 config CC_HAS_STACKPROTECTOR_GLOBAL
        def_bool $(cc-option, -mstack-protector-guard=global -mstack-protector-guard-record)