x86_64 assembly pack: make Windows build more robust [from master].
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 22:00:02 +0000 (23:00 +0100)
PR: 2963 and a number of others

crypto/aes/asm/aes-x86_64.pl
crypto/camellia/asm/cmll-x86_64.pl
crypto/md5/asm/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
ms/uplink-x86_64.pl

index 2fb2923d459bd0bc7f834e1401a13924a7b83c50..25f5fbd1226588e351bbe29fe252fea6a332a267 100755 (executable)
@@ -36,7 +36,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 10e2298288712ef9298ac723d4920044d6ac5e31..9f4b82fa48219540f398e483a8a1dc852868e328 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 721f0490f5dda436ad70e13deb847e89c5e27ba5..f11224d17220123fbc2d7a632b7833ea17745d25 100755 (executable)
@@ -120,7 +120,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 63f87e467ebff01c7a67a33f0e7ade928066cd08..ed655ea952fba0331a160007d7b968f840fffde2 100755 (executable)
@@ -69,7 +69,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 9e7e9aa5198a047a275cc6a341e557d3265bdad4..3352962701c9e4293f99c93787e22b840dce9049 100755 (executable)
@@ -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;
 
 $ctx="%rdi";   # 1st arg
 $inp="%rsi";   # 2nd arg
index d039304a8749b205ce3de2f612e4f05a12830d33..2bc543a192f0171fee33b5346b074f5c05edc5a7 100755 (executable)
@@ -51,7 +51,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;
 
 if ($output =~ /512/) {
        $func="sha512_block_data_order";
index 9be1cc2238b581b78838364ee6b1053309e14737..24b2ff60c38b78fd6631993159dd0b6d86a8c99b 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 c3a4cc9d81921a5d04b502520e69edcca4688ef8..cd2567a26cff500ce8241abdbfe41cc253ed1b26 100644 (file)
@@ -7,7 +7,8 @@ if ($flavour =~ /\./) { $output = $flavour; undef $flavour; }
 $win64=0; $win64=1 if ($flavour =~ /[nm]asm|mingw64/ || $output =~ /\.asm$/);
 
 $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
-open STDOUT,"| \"$^X\" ${dir}perlasm/x86_64-xlate.pl $flavour $output";
+open OUT,"| \"$^X\" ${dir}perlasm/x86_64-xlate.pl $flavour $output";
+*STDOUT=*OUT;
 
 if ($win64)    { $arg1="%rcx"; $arg2="%rdx"; }
 else           { $arg1="%rdi"; $arg2="%rsi"; }
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";