summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorXi Ruoyao <xry111@xry111.site>2023-07-21 07:59:07 +0800
committerTomas Mraz <tomas@openssl.org>2023-08-01 19:41:46 +0200
commit160f48941d143cf2682df4e938ba953c96ac3c7a (patch)
treea55fd96b3ef8624512c176958aebe43abb80c510 /util
parenteb2ff04cc75934fed2d8b6f3085d262978ae6033 (diff)
Add system guessing for linux64-loongarch64 target
Now the default is linux-generic32, it's not good for loongarch64. We can also test if the assembler supports vector instructions here and disable asm if not. Closes #21340. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21510)
Diffstat (limited to 'util')
-rwxr-xr-xutil/perl/OpenSSL/config.pm12
1 files changed, 12 insertions, 0 deletions
diff --git a/util/perl/OpenSSL/config.pm b/util/perl/OpenSSL/config.pm
index 13d1d60fad..fef32c9323 100755
--- a/util/perl/OpenSSL/config.pm
+++ b/util/perl/OpenSSL/config.pm
@@ -675,6 +675,18 @@ EOF
defines => [ 'B_ENDIAN' ] } ],
[ 'sh.*-.*-linux2', { target => "linux-generic32",
defines => [ 'L_ENDIAN' ] } ],
+ [ 'loongarch64-.*-linux2',
+ sub {
+ my $disable = [ 'asm' ];
+ if ( okrun('echo xvadd.w \$xr0,\$xr0,\$xr0',
+ "$CC -c -x assembler - -o /dev/null 2>/dev/null") ) {
+ $disable = [];
+ }
+ return { target => "linux64-loongarch64",
+ defines => [ 'L_ENDIAN' ],
+ disable => $disable, };
+ }
+ ],
[ 'm68k.*-.*-linux2', { target => "linux-generic32",
defines => [ 'B_ENDIAN' ] } ],
[ 's390-.*-linux2', { target => "linux-generic32",