]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
s390x: set minimum architecture level to z10
authorAmaan Qureshi <git@amaanq.com>
Fri, 20 Mar 2026 00:40:20 +0000 (20:40 -0400)
committerTomas Mraz <tomas@openssl.foundation>
Fri, 27 Mar 2026 16:32:28 +0000 (17:32 +0100)
The keccak1600 perlasm file (`keccak1600-s390x.pl`) emits `cijne`, a
z10 compare-immediate-and-branch instruction, without declaring a
minimum architecture level. GCC defaults to `-march=z900` on s390x,
causing assembler errors when building with the default toolchain
flags:

    keccak1600-s390x.S:399: Error: Unrecognized opcode: `cijne'

z900 has been out of service since 2014, the Linux kernel requires
z196 minimum, and clang already defaults to z10 on s390x. A
`.machine "z10"` GAS directive in the generated assembly resolves the
error by declaring the architecture level the file already requires.

Ref: #27323

Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Fri Mar 27 16:32:22 2026
(Merged from https://github.com/openssl/openssl/pull/30507)

(cherry picked from commit 189cf6f0b873e21902e1b1fc6f85fd89d003b847)

crypto/sha/asm/keccak1600-s390x.pl

index 5bd5f04cdaf960220f91c52d5095e2a9e90c8b73..696dcbb86384555055eea7105c54577a58c4b733 100755 (executable)
@@ -67,6 +67,7 @@ my @rhotates = ([  0,  1, 62, 28, 27 ],
 
 $code.=<<___;
 .text
+.machine       "z10"
 
 .type  __KeccakF1600,\@function
 .align 32