I am using FreeBSD 8.1-RELEASE amd64 and I am building OpenSSL 1.0.0c

When I run `make | tee t` I get output that ends with:

/usr/X11R6/bin/perl5 asm/sha1-x86_64.pl elf > sha1-x86_64.s
gcc -I.. -I../.. -I../asn1 -I../evp -I../../include  -fPIC -DOPENSSL_PIC 
-DOPENSSL_THREADS -pthread -D_THREAD_SAFE -D_REENTRANT -DDSO_DLFCN 
-DHAVE_DLFCN_H -DL_ENDIAN -DTERMIOS -O3 -DMD32_REG_T=int -Wall 
-DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM 
-DMD5_ASM -DAES_ASM -DWHIRLPOOL_ASM -c -o sha1-x86_64.o sha1-x86_64.s
/usr/X11R6/bin/perl5 asm/sha512-x86_64.pl elf sha256-x86_64.s
.text

.globl  sha256_block_data_order
.type   sha256_block_data_order,@function
.align  16
sha256_block_data_order:
        pushq   %rbx
... asm ...
.long   0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2
gcc -I.. -I../.. -I../asn1 -I../evp -I../../include  -fPIC -DOPENSSL_PIC 
-DOPENSSL_THREADS -pthread -D_THREAD_SAFE -D_REENTRANT -DDSO_DLFCN 
-DHAVE_DLFCN_H -DL_ENDIAN -DTERMIOS -O3 -DMD32_REG_T=int -Wall 
-DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM 
-DMD5_ASM -DAES_ASM -DWHIRLPOOL_ASM -c -o sha256-x86_64.o sha256-x86_64.s
gcc: sha256-x86_64.s: No such file or directory
gcc: No input files specified
*** Error code 1

This appears to be due to a bug in crypto/perlasm/x86_64-xlate.pl
which stats its stdout and its output file to see if it needs to
redirect its output. Or it could be due to a bug in the Makefile which
invokes the script inconsistently.

When it is running inside tee it gets 0,0 for the device and inode of
stdout, and undef,undef for the device and inode of the nonexistent output
file. These compare numerically equal so it thinks they are the same, and
spits its output to stdout instead of redirecting it to the output file.

One possibility is to fix the perl script like this:


--- crypto/perlasm/x86_64-xlate.pl~     2010-10-10 22:14:17.000000000 +0100
+++ crypto/perlasm/x86_64-xlate.pl      2011-01-18 16:49:06.000000000 +0000
@@ -66,7 +66,7 @@
   my ($outdev,$outino,@junk)=stat($output);

     open STDOUT,">$output" || die "can't open $output: $!"
-       if ($stddev!=$outdev || $stdino!=$outino);
+       if (!defined($outdev) || $stddev!=$outdev || $stdino!=$outino);
 }

 my $gas=1;     $gas=0 if ($output =~ /\.asm$/);


Alternatively it could be due to a bug in the Makefile which invokes the
perl asm scripts inconsistently.


--- crypto/sha/Makefile~        2008-11-12 08:19:03.000000000 +0000
+++ crypto/sha/Makefile 2011-01-18 17:06:15.000000000 +0000
@@ -61,8 +61,8 @@

 # Solaris make has to be explicitly told
 sha1-x86_64.s: asm/sha1-x86_64.pl;     $(PERL) asm/sha1-x86_64.pl 
$(PERLASM_SCHEME) > $@
-sha256-x86_64.s:asm/sha512-x86_64.pl;  $(PERL) asm/sha512-x86_64.pl 
$(PERLASM_SCHEME) $@
-sha512-x86_64.s:asm/sha512-x86_64.pl;  $(PERL) asm/sha512-x86_64.pl 
$(PERLASM_SCHEME) $@
+sha256-x86_64.s:asm/sha512-x86_64.pl;  $(PERL) asm/sha512-x86_64.pl 
$(PERLASM_SCHEME) > $@
+sha512-x86_64.s:asm/sha512-x86_64.pl;  $(PERL) asm/sha512-x86_64.pl 
$(PERLASM_SCHEME) > $@
 sha1-sparcv9.s:        asm/sha1-sparcv9.pl;    $(PERL) asm/sha1-sparcv9.pl $@ 
$(CFLAGS)
 sha256-sparcv9.s:asm/sha512-sparcv9.pl;        $(PERL) asm/sha512-sparcv9.pl 
$@ $(CFLAGS)
 sha512-sparcv9.s:asm/sha512-sparcv9.pl;        $(PERL) asm/sha512-sparcv9.pl 
$@ $(CFLAGS)


Tony.
-- 
f.anthony.n.finch  <d...@dotat.at>  http://dotat.at/
HUMBER THAMES DOVER WIGHT PORTLAND: NORTH BACKING WEST OR NORTHWEST, 5 TO 7,
DECREASING 4 OR 5, OCCASIONALLY 6 LATER IN HUMBER AND THAMES. MODERATE OR
ROUGH. RAIN THEN FAIR. GOOD.

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to