x86_64 assembly pack: make Windows build more robust.
authorAndy Polyakov <appro@openssl.org>
Tue, 22 Jan 2013 21:11:31 +0000 (22:11 +0100)
committerAndy Polyakov <appro@openssl.org>
Tue, 22 Jan 2013 21:27:28 +0000 (22:27 +0100)
PR: 2963 and a number of others

17 files changed:
crypto/aes/asm/aes-x86_64.pl
crypto/aes/asm/aesni-sha1-x86_64.pl
crypto/aes/asm/aesni-x86_64.pl
crypto/aes/asm/bsaes-x86_64.pl
crypto/aes/asm/vpaes-x86_64.pl
crypto/bn/asm/modexp512-x86_64.pl
crypto/camellia/asm/cmll-x86_64.pl
crypto/md5/asm/md5-x86_64.pl
crypto/modes/asm/ghash-x86_64.pl
crypto/rc4/asm/rc4-md5-x86_64.pl
crypto/rc4/asm/rc4-x86_64.pl
crypto/sha/asm/sha1-x86_64.pl
crypto/sha/asm/sha512-x86_64.pl
crypto/whrlpool/asm/wp-x86_64.pl
crypto/x86_64cpuid.pl
engines/asm/e_padlock-x86_64.pl
ms/uplink-x86_64.pl

index 01f9cb7f8e020063dda8c57446c4d1f20127966f..e95593e35e0bd985abf9c5994b1811037e291b87 100755 (executable)
@@ -37,7 +37,8 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or
 die "can't locate x86_64-xlate.pl";
 
-open STDOUT,"| \"$^X\" $xlate $flavour $output";
+open OUT,"| \"$^X\" $xlate $flavour $output";
+*STDOUT=*OUT;
 
 $verticalspin=1;       # unlike 32-bit version $verticalspin performs
                        # ~15% better on both AMD and Intel cores
index f8f133b231bfac3d2be12933f527a8bc3ea0cb3e..2a5071d880ef717e5e4e99b698575dc702f23db6 100644 (file)
@@ -77,7 +77,8 @@ $avx=1 if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
           `ml64 2>&1` =~ /Version ([0-9]+)\./ &&
           $1>=10);
 
-open STDOUT,"| \"$^X\" $xlate $flavour $output";
+open OUT,"| \"$^X\" $xlate $flavour $output";
+*STDOUT=*OUT;
 
 # void aesni_cbc_sha1_enc(const void *inp,
 #                      void *out,
index 318e52fe9d4530e66dd3304bd98aaf1e072950f7..8a3090491657e9882ee30e21eb0c659666a0e377 100644 (file)
@@ -179,7 +179,8 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or
 die "can't locate x86_64-xlate.pl";
 
-open STDOUT,"| \"$^X\" $xlate $flavour $output";
+open OUT,"| \"$^X\" $xlate $flavour $output";
+*STDOUT=*OUT;
 
 $movkey = $PREFIX eq "aesni" ? "movups" : "movups";
 @_4args=$win64?        ("%rcx","%rdx","%r8", "%r9") :  # Win64 order
index f5f05c0e73f6c607c89d15bc2500e9ad986775a3..ceb02b50ddb60d283345b27ad8a5a3d4a3b92534 100644 (file)
@@ -105,7 +105,8 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or
 die "can't locate x86_64-xlate.pl";
 
-open STDOUT,"| \"$^X\" $xlate $flavour $output";
+open OUT,"| \"$^X\" $xlate $flavour $output";
+*STDOUT=*OUT;
 
 my ($inp,$out,$len,$key,$ivp)=("%rdi","%rsi","%rdx","%rcx");
 my @XMM=map("%xmm$_",(15,0..14));      # best on Atom, +10% over (0..15)
index bca97fdcdf75d0512f082b752ea51b30c9c6eae1..6e41066344521efa4d1099c163b6733f3c7f10ea 100644 (file)
@@ -56,7 +56,8 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or
 die "can't locate x86_64-xlate.pl";
 
-open STDOUT,"| \"$^X\" $xlate $flavour $output";
+open OUT,"| \"$^X\" $xlate $flavour $output";
+*STDOUT=*OUT;
 
 $PREFIX="vpaes";
 
index 28b6dab2f0c2cfea07966dcc45b5d1861392132f..bfd6e975416de8c9bc51b55f994b6fcb2f5ef5f6 100644 (file)
@@ -68,7 +68,8 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or
 die "can't locate x86_64-xlate.pl";
 
-open STDOUT,"| \"$^X\" $xlate $flavour $output";
+open OUT,"| \"$^X\" $xlate $flavour $output";
+*STDOUT=*OUT;
 
 use strict;
 my $code=".text\n\n";
index 53e41f2e5ea323c7981fc108e8bc7d6299b7b753..d94f46b887e516cab8cf932320760192bd62a178 100644 (file)
@@ -40,7 +40,8 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or
 die "can't locate x86_64-xlate.pl";
 
-open STDOUT,"| \"$^X\" $xlate $flavour $output";
+open OUT,"| \"$^X\" $xlate $flavour $output";
+*STDOUT=*OUT;
 
 sub hi() { my $r=shift; $r =~ s/%[er]([a-d])x/%\1h/;    $r; }
 sub lo() { my $r=shift; $r =~ s/%[er]([a-d])x/%\1l/;
index eea6802a8a70b172a2bca8053f3425ce7996e14f..a79d0e46ea16cb3b34619079bb07f0ec175f0ebd 100755 (executable)
@@ -117,7 +117,8 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; my $dir=$1; my $xlate;
 die "can't locate x86_64-xlate.pl";
 
 no warnings qw(uninitialized);
-open STDOUT,"| \"$^X\" $xlate $flavour $output";
+open OUT,"| \"$^X\" $xlate $flavour $output";
+*STDOUT=*OUT;
 
 $code .= <<EOF;
 .text
index fc877b7992f88fdca22bc7f2ae9bf64aa34e9422..cd93c0f95ec0da61f87913ab505df8be62a25130 100644 (file)
@@ -52,7 +52,8 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or
 die "can't locate x86_64-xlate.pl";
 
-open STDOUT,"| \"$^X\" $xlate $flavour $output";
+open OUT,"| \"$^X\" $xlate $flavour $output";
+*STDOUT=*OUT;
 
 # common register layout
 $nlo="%rax";
index 0e04df67b213a948232949b03c8a87ca89bc9d68..49d5438457c4cdf81345dd7dd398318054269470 100644 (file)
@@ -54,7 +54,8 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; my $dir=$1; my $xlate;
 ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or
 die "can't locate x86_64-xlate.pl";
 
-open STDOUT,"| \"$^X\" $xlate $flavour $output";
+open OUT,"| \"$^X\" $xlate $flavour $output";
+*STDOUT=*OUT;
 
 my ($dat,$in0,$out,$ctx,$inp,$len, $func,$nargs);
 
index 73fb81512183ad3a8103f0e1d7276fe26100b6b3..fa227631870354f78eee9f23b1f54a008d81c110 100755 (executable)
@@ -115,7 +115,8 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or
 die "can't locate x86_64-xlate.pl";
 
-open STDOUT,"| \"$^X\" $xlate $flavour $output";
+open OUT,"| \"$^X\" $xlate $flavour $output";
+*STDOUT=*OUT;
 
 $dat="%rdi";       # arg1
 $len="%rsi";       # arg2
index 96350413bee2c27af649a8c46f63216cb2f5dbbb..02422131936ecd0160a64a72a7df088f9a1db152 100755 (executable)
@@ -85,7 +85,8 @@ $avx=1 if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
           `ml64 2>&1` =~ /Version ([0-9]+)\./ &&
           $1>=10);
 
-open STDOUT,"| \"$^X\" $xlate $flavour $output";
+open OUT,"| \"$^X\" $xlate $flavour $output";
+*STDOUT=*OUT;
 
 $ctx="%rdi";   # 1st arg
 $inp="%rsi";   # 2nd arg
index ab9a0b472de4909357943eb1d6be13585e42e1fc..8f10f973e98c921f5e7dbfffa9b92647d6f81112 100755 (executable)
@@ -103,7 +103,8 @@ $avx=1 if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
           `ml64 2>&1` =~ /Version ([0-9]+)\./ &&
           $1>=10);
 
-open STDOUT,"| \"$^X\" $xlate $flavour $output";
+open OUT,"| \"$^X\" $xlate $flavour $output";
+*STDOUT=*OUT;
 
 if ($output =~ /512/) {
        $func="sha512_block_data_order";
index 855aabc8926e7bc86831b88f144f62b7c6e99bcf..5a3bdbcf20d1a36f41665497a93053bd6dcda2e3 100644 (file)
@@ -41,7 +41,8 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; my $dir=$1; my $xlate;
 ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or
 die "can't locate x86_64-xlate.pl";
 
-open STDOUT,"| \"$^X\" $xlate $flavour $output";
+open OUT,"| \"$^X\" $xlate $flavour $output";
+*STDOUT=*OUT;
 
 sub L() { $code.=".byte        ".join(',',@_)."\n"; }
 sub LL(){ $code.=".byte        ".join(',',@_).",".join(',',@_)."\n"; }
index 3a1adeecccde79af8d0fb6e0e5870f34aa7469f7..0cf68f1360ef2e9b49960c64f038ec78435e7a4a 100644 (file)
@@ -11,7 +11,8 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 ( $xlate="${dir}perlasm/x86_64-xlate.pl" and -f $xlate) or
 die "can't locate x86_64-xlate.pl";
 
-open STDOUT,"| \"$^X\" $xlate $flavour $output";
+open OUT,"| \"$^X\" $xlate $flavour $output";
+*STDOUT=*OUT;
 
 ($arg1,$arg2,$arg3,$arg4)=$win64?("%rcx","%rdx","%r8", "%r9") :        # Win64 order
                                 ("%rdi","%rsi","%rdx","%rcx"); # Unix order
index 5d197579616c74921ed8044f33760f0e3b710a6d..f8ba1e909f3d9420bcf81c27a96411c07f4fa301 100644 (file)
@@ -23,7 +23,8 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 ( $xlate="${dir}../../crypto/perlasm/x86_64-xlate.pl" and -f $xlate) or
 die "can't locate x86_64-xlate.pl";
 
-open STDOUT,"| \"$^X\" $xlate $flavour $output";
+open OUT,"| \"$^X\" $xlate $flavour $output";
+*STDOUT=*OUT;
 
 $code=".text\n";
 
index 2758c86d1e0595002d8a080ff416ac6974533843..48bf559ee120d80196d2a1a021c4715d74a5caba 100755 (executable)
@@ -2,7 +2,8 @@
 
 $output=shift;
 $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
-open STDOUT,"| \"$^X\" ${dir}../crypto/perlasm/x86_64-xlate.pl $output";
+open OUT,"| \"$^X\" ${dir}../crypto/perlasm/x86_64-xlate.pl $output";
+*STDOUT=*OUT;
 push(@INC,"${dir}.");
 
 require "uplink-common.pl";