]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - crypto/aes/asm/aes-parisc.pl
Do not silently truncate files on perlasm errors
[thirdparty/openssl.git] / crypto / aes / asm / aes-parisc.pl
index 714dcfbbe3b72ff3b629fc60083d37e9314ab664..1229ec6a2faaf2f7bc9506ee16e1551751ca2a49 100644 (file)
@@ -1,7 +1,14 @@
-#!/usr/bin/env perl
+#! /usr/bin/env perl
+# Copyright 2009-2018 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the OpenSSL license (the "License").  You may not use
+# this file except in compliance with the License.  You can obtain a copy
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+
 
 # ====================================================================
-# Written by Andy Polyakov <appro@fy.chalmers.se> for the OpenSSL
+# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
 # project. The module is, however, dual licensed under OpenSSL and
 # CRYPTOGAMS licenses depending on where you obtain it. For further
 # details see http://www.openssl.org/~appro/cryptogams/.
@@ -1005,18 +1012,27 @@ L\$AES_Td
        .STRINGZ "AES for PA-RISC, CRYPTOGAMS by <appro\@openssl.org>"
 ___
 
+if (`$ENV{CC} -Wa,-v -c -o /dev/null -x assembler /dev/null 2>&1`
+       =~ /GNU assembler/) {
+    $gnuas = 1;
+}
+
 foreach (split("\n",$code)) {
        s/\`([^\`]*)\`/eval $1/ge;
 
-       # translate made up instructons: _ror, _srm
+       # translate made up instructions: _ror, _srm
        s/_ror(\s+)(%r[0-9]+),/shd$1$2,$2,/                             or
 
        s/_srm(\s+%r[0-9]+),([0-9]+),/
                $SIZE_T==4 ? sprintf("extru%s,%d,8,",$1,31-$2)
                :            sprintf("extrd,u%s,%d,8,",$1,63-$2)/e;
 
+       s/(\.LEVEL\s+2\.0)W/$1w/        if ($gnuas && $SIZE_T==8);
+       s/\.SPACE\s+\$TEXT\$/.text/     if ($gnuas && $SIZE_T==8);
+       s/\.SUBSPA.*//                  if ($gnuas && $SIZE_T==8);
        s/,\*/,/                        if ($SIZE_T==4);
        s/\bbv\b(.*\(%r2\))/bve$1/      if ($SIZE_T==8);
+
        print $_,"\n";
 }
-close STDOUT;
+close STDOUT or die "error closing STDOUT: $!";