From: Richard Levitte Date: Mon, 7 Mar 2016 14:00:45 +0000 (+0100) Subject: Unified - adapt the generation of cpuid, uplink and buildinf to use GENERATE X-Git-Tag: OpenSSL_1_1_0-pre4~191 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=0a4edb931b883b9973721ae012e60c028387dd50;p=oweals%2Fopenssl.git Unified - adapt the generation of cpuid, uplink and buildinf to use GENERATE This gets rid of the BEGINRAW..ENDRAW sections in crypto/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 --- diff --git a/crypto/Makefile.in b/crypto/Makefile.in index 9e407df3d0..7a5a9889b4 100644 --- a/crypto/Makefile.in +++ b/crypto/Makefile.in @@ -64,7 +64,7 @@ buildinf.h: ../Makefile $(PERL) $(TOP)/util/mkbuildinf.pl "$(CC) $(CFLAGS_Q)" "$(PLATFORM)" >buildinf.h x86cpuid.s: x86cpuid.pl perlasm/x86asm.pl - $(PERL) x86cpuid.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@ + $(PERL) x86cpuid.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) $@ applink.o: $(TOP)/ms/applink.c $(CC) $(CFLAGS) -c -o $@ $(TOP)/ms/applink.c @@ -73,18 +73,18 @@ uplink.o: $(TOP)/ms/uplink.c applink.o $(CC) $(CFLAGS) -c -o $@ $(TOP)/ms/uplink.c uplink-x86.s: $(TOP)/ms/uplink-x86.pl - $(PERL) $(TOP)/ms/uplink-x86.pl $(PERLASM_SCHEME) > $@ + $(PERL) $(TOP)/ms/uplink-x86.pl $(PERLASM_SCHEME) $@ -x86_64cpuid.s: x86_64cpuid.pl; $(PERL) x86_64cpuid.pl $(PERLASM_SCHEME) > $@ +x86_64cpuid.s: x86_64cpuid.pl; $(PERL) x86_64cpuid.pl $(PERLASM_SCHEME) $@ ia64cpuid.s: ia64cpuid.S; $(CC) $(CFLAGS) -E ia64cpuid.S > $@ ppccpuid.s: ppccpuid.pl; $(PERL) ppccpuid.pl $(PERLASM_SCHEME) $@ pariscid.s: pariscid.pl; $(PERL) pariscid.pl $(PERLASM_SCHEME) $@ alphacpuid.s: alphacpuid.pl (preproc=$$$$.$@.S; trap "rm $$preproc" INT; \ - $(PERL) alphacpuid.pl > $$preproc && \ + $(PERL) alphacpuid.pl $$preproc && \ $(CC) -E -P $$preproc > $@ && rm $$preproc) -arm64cpuid.S: arm64cpuid.pl; $(PERL) arm64cpuid.pl $(PERLASM_SCHEME) > $@ -armv4cpuid.S: armv4cpuid.pl; $(PERL) armv4cpuid.pl $(PERLASM_SCHEME) > $@ +arm64cpuid.S: arm64cpuid.pl; $(PERL) arm64cpuid.pl $(PERLASM_SCHEME) $@ +armv4cpuid.S: armv4cpuid.pl; $(PERL) armv4cpuid.pl $(PERLASM_SCHEME) $@ subdirs: @target=all; $(RECURSIVE_MAKE) diff --git a/crypto/alphacpuid.pl b/crypto/alphacpuid.pl index 5b0e21bc90..8af0f09d4b 100644 --- a/crypto/alphacpuid.pl +++ b/crypto/alphacpuid.pl @@ -1,4 +1,8 @@ #!/usr/bin/env perl + +$output = pop; +open STDOUT,">$stdout"; + print <<'___'; .text @@ -214,3 +218,5 @@ OPENSSL_instrument_bus2: .end OPENSSL_instrument_bus2 ___ } + +close STDOUT; diff --git a/crypto/build.info b/crypto/build.info index 471a9fd2f8..01d3766b58 100644 --- a/crypto/build.info +++ b/crypto/build.info @@ -11,38 +11,19 @@ EXTRA= ../ms/uplink-x86.pl ../ms/uplink.c ../ms/applink.c \ ppccpuid.pl pariscid.pl alphacpuid.pl arm64cpuid.pl armv4cpuid.pl DEPEND[cversion.o]=buildinf.h +GENERATE[buildinf.h]=../util/mkbuildinf.pl "$(CC) $(CFLAGS_Q)" "$(PLATFORM)" +DEPEND[buildinf.h]=configdata.pm -BEGINRAW[descrip.mms] -[.crypto]buildinf.h : configdata.pm - $(PERL) {- catfile(catdir($sourcedir, "[-]"), "util", "mkbuildinf.pl") -} "$(CC) $(CFLAGS)" "$(PLATFORM)" > [.crypto]buildinf.h -ENDRAW[descrip.mms] +GENERATE[uplink-x86.s]=../ms/uplink-x86.pl $(PERLASM_SCHEME) -BEGINRAW[Makefile] -crypto/buildinf.h : configdata.pm - $(PERL) $(SRCDIR)/util/mkbuildinf.pl "$(CC) $(CFLAGS_Q)" "$(PLATFORM)" > crypto/buildinf.h +GENERATE[x86cpuid.s]=x86cpuid.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) +DEPEND[x86cpuid.s]=perlasm/x86asm.pl -##### APPLINK, UPLINK and CPUID assembler implementations +GENERATE[x86_64cpuid.s]=x86_64cpuid.pl $(PERLASM_SCHEME) -{- $builddir -}/uplink-x86.s: $(SRCDIR)/ms/uplink-x86.pl - CC="$(CC)" $(PERL) $(SRCDIR)/ms/uplink-x86.pl $(PERLASM_SCHEME) > $@ - -{- $builddir -}/x86cpuid.s: {- $sourcedir -}/x86cpuid.pl {- $sourcedir -}/perlasm/x86asm.pl - CC="$(CC)" $(PERL) {- $sourcedir -}/x86cpuid.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@ - -{- $builddir -}/x86_64cpuid.s: {- $sourcedir -}/x86_64cpuid.pl - CC="$(CC)" $(PERL) {- $sourcedir -}/x86_64cpuid.pl $(PERLASM_SCHEME) > $@ -{- $builddir -}/ia64cpuid.s: {- $sourcedir -}/ia64cpuid.S - $(CC) $(CFLAGS) -E {- $sourcedir -}/ia64cpuid.S > $@ -{- $builddir -}/ppccpuid.s: {- $sourcedir -}/ppccpuid.pl - CC="$(CC)" $(PERL) {- $sourcedir -}/ppccpuid.pl $(PERLASM_SCHEME) $@ -{- $builddir -}/pariscid.s: {- $sourcedir -}/pariscid.pl - CC="$(CC)" $(PERL) {- $sourcedir -}/pariscid.pl $(PERLASM_SCHEME) $@ -{- $builddir -}/alphacpuid.s: {- $sourcedir -}/alphacpuid.pl - (preproc=$$$$.$@.S; trap "rm $$preproc" INT; \ - CC="$(CC)" $(PERL) {- $sourcedir -}/alphacpuid.pl > $$preproc && \ - $(CC) -E -P $$preproc > $@ && rm $$preproc) -{- $builddir -}/arm64cpuid.S: {- $sourcedir -}/arm64cpuid.pl - CC="$(CC)" $(PERL) {- $sourcedir -}/arm64cpuid.pl $(PERLASM_SCHEME) > $@ -{- $builddir -}/armv4cpuid.S: {- $sourcedir -}/armv4cpuid.pl - CC="$(CC)" $(PERL) {- $sourcedir -}/armv4cpuid.pl $(PERLASM_SCHEME) > $@ -ENDRAW[Makefile] +GENERATE[ia64cpuid.s]=ia64cpuid.S +GENERATE[ppccpuid.s]=ppccpuid.pl $(PERLASM_SCHEM +GENERATE[pariscid.s]=pariscid.pl $(PERLASM_SCHEM +GENERATE[alphacpuid.s]=alphacpuid.pl +GENERATE[arm64cpuid.S]=arm64cpuid.pl $(PERLASM_SCHEME) +GENERATE[armv4cpuid.S]=armv4cpuid.pl $(PERLASM_SCHEME) diff --git a/crypto/x86cpuid.pl b/crypto/x86cpuid.pl index 86772329bc..48c4cf204b 100644 --- a/crypto/x86cpuid.pl +++ b/crypto/x86cpuid.pl @@ -4,6 +4,10 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; push(@INC, "${dir}perlasm", "perlasm"); require "x86asm.pl"; +$output = pop; +open OUT,">$output"; +*STDOUT=*OUT; + &asm_init($ARGV[0],"x86cpuid"); for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); } @@ -487,3 +491,5 @@ my $max = "ebp"; &hidden("OPENSSL_ia32cap_P"); &asm_finish(); + +close STDOUT; diff --git a/ms/uplink-x86.pl b/ms/uplink-x86.pl index 53b998d270..4a2f042c34 100755 --- a/ms/uplink-x86.pl +++ b/ms/uplink-x86.pl @@ -6,6 +6,9 @@ require "x86asm.pl"; require "uplink-common.pl"; +$output = pop; +open STDOUT,">$output"; + &asm_init($ARGV[0],"uplink-x86"); &external_label("OPENSSL_Uplink"); @@ -31,3 +34,5 @@ for ($i=1;$i<=$N;$i++) { &data_word(&label("_\$lazy${i}")); } &asm_finish(); + +close OUTPUT;