Browse Source

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 <appro@openssl.org>
master
Richard Levitte 7 years ago
parent
commit
0a4edb931b
5 changed files with 35 additions and 37 deletions
  1. +6
    -6
      crypto/Makefile.in
  2. +6
    -0
      crypto/alphacpuid.pl
  3. +12
    -31
      crypto/build.info
  4. +6
    -0
      crypto/x86cpuid.pl
  5. +5
    -0
      ms/uplink-x86.pl

+ 6
- 6
crypto/Makefile.in View File

@ -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)


+ 6
- 0
crypto/alphacpuid.pl View File

@ -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;

+ 12
- 31
crypto/build.info View File

@ -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)

+ 6
- 0
crypto/x86cpuid.pl View File

@ -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;

+ 5
- 0
ms/uplink-x86.pl View File

@ -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;

Loading…
Cancel
Save