From 6d33da3487143023b176ebe8164cf05df6f5fbf6 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Mon, 7 Mar 2016 15:46:42 +0100 Subject: Unified - adapt the generation of des assembler to use GENERATE This gets rid of the BEGINRAW..ENDRAW sections in crypto/des/build.info. This also moves the assembler generating perl scripts to take the output file name as last command line argument, where necessary. Reviewed-by: Andy Polyakov --- crypto/des/Makefile.in | 4 ++-- crypto/des/asm/crypt586.pl | 5 +++++ crypto/des/asm/des-586.pl | 5 +++++ crypto/des/build.info | 17 ++++++----------- 4 files changed, 18 insertions(+), 13 deletions(-) (limited to 'crypto') diff --git a/crypto/des/Makefile.in b/crypto/des/Makefile.in index c056804d35..93a715a7fb 100644 --- a/crypto/des/Makefile.in +++ b/crypto/des/Makefile.in @@ -59,9 +59,9 @@ dest4-sparcv9.S: asm/dest4-sparcv9.pl $(PERL) asm/dest4-sparcv9.pl $(PERLASM_SCHEME) $@ des-586.s: asm/des-586.pl ../perlasm/x86asm.pl ../perlasm/cbc.pl - $(PERL) asm/des-586.pl $(PERLASM_SCHEME) $(CFLAGS) > $@ + $(PERL) asm/des-586.pl $(PERLASM_SCHEME) $(CFLAGS) $@ crypt586.s: asm/crypt586.pl ../perlasm/x86asm.pl ../perlasm/cbc.pl - $(PERL) asm/crypt586.pl $(PERLASM_SCHEME) $(CFLAGS) > $@ + $(PERL) asm/crypt586.pl $(PERLASM_SCHEME) $(CFLAGS) $@ files: $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO diff --git a/crypto/des/asm/crypt586.pl b/crypto/des/asm/crypt586.pl index e36f7d44bd..d94528ff7c 100644 --- a/crypto/des/asm/crypt586.pl +++ b/crypto/des/asm/crypt586.pl @@ -10,6 +10,9 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; push(@INC,"${dir}","${dir}../../perlasm"); require "x86asm.pl"; +$output=pop; +open STDOUT,">$output"; + &asm_init($ARGV[0],"crypt586.pl"); $L="edi"; @@ -19,6 +22,8 @@ $R="esi"; &fcrypt_body("fcrypt_body"); &asm_finish(); +close STDOUT; + sub fcrypt_body { local($name,$do_ip)=@_; diff --git a/crypto/des/asm/des-586.pl b/crypto/des/asm/des-586.pl index bd6a7dd6b7..e56eae47dd 100644 --- a/crypto/des/asm/des-586.pl +++ b/crypto/des/asm/des-586.pl @@ -15,6 +15,9 @@ require "desboth.pl"; # format. # +$output=pop; +open STDOUT,">$output"; + &asm_init($ARGV[0],"des-586.pl"); $L="edi"; @@ -39,6 +42,8 @@ $small_footprint=1 if (grep(/\-DOPENSSL_SMALL_FOOTPRINT/,@ARGV)); &asm_finish(); +close STDOUT; + sub DES_encrypt_internal() { &function_begin_B("_x86_DES_encrypt"); diff --git a/crypto/des/build.info b/crypto/des/build.info index d3c5c1f64c..ee2f67fa52 100644 --- a/crypto/des/build.info +++ b/crypto/des/build.info @@ -8,16 +8,11 @@ SOURCE[../../libcrypto]=\ fcrypt.c xcbc_enc.c rpc_enc.c cbc_cksm.c \ read2pwd.c -BEGINRAW[Makefile] -##### DES assembler implementations +GENERATE[des_enc-sparc.S]=asm/des_enc.m4 +GENERATE[dest4-sparcv9.S]=asm/dest4-sparcv9.pl $(PERLASM_SCHEME) -{- $builddir -}/des_enc-sparc.S: {- $sourcedir -}/asm/des_enc.m4 - m4 -B 8192 {- $sourcedir -}/asm/des_enc.m4 > $@ -{- $builddir -}/dest4-sparcv9.S: {- $sourcedir -}/asm/dest4-sparcv9.pl - CC="$(CC)" $(PERL) {- $sourcedir -}/asm/dest4-sparcv9.pl $(PERLASM_SCHEME) $@ +GENERATE[des-586.s]=asm/des-586.pl $(PERLASM_SCHEME) $(CFLAGS) +DEPEND[des-586.s]=../perlasm/x86asm.pl ../perlasm/cbc.pl +GENERATE[crypt586.s]=asm/crypt586.pl $(PERLASM_SCHEME) $(CFLAGS) +DEPEND[crypt586.s]=../perlasm/x86asm.pl ../perlasm/cbc.pl -{- $builddir -}/des-586.s: {- $sourcedir -}/asm/des-586.pl {- $sourcetop -}/crypto/perlasm/x86asm.pl {- $sourcetop -}/crypto/perlasm/cbc.pl - CC="$(CC)" $(PERL) {- $sourcedir -}/asm/des-586.pl $(PERLASM_SCHEME) $(CFLAGS) > $@ -{- $builddir -}/crypt586.s: {- $sourcedir -}/asm/crypt586.pl {- $sourcetop -}/crypto/perlasm/x86asm.pl {- $sourcetop -}/crypto/perlasm/cbc.pl - CC="$(CC)" $(PERL) {- $sourcedir -}/asm/crypt586.pl $(PERLASM_SCHEME) $(CFLAGS) > $@ -ENDRAW[Makefile] -- cgit v1.2.3