提交 0a4edb93 编写于 作者: R Richard Levitte

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: NAndy Polyakov <appro@openssl.org>
上级 184bc45f
......@@ -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)
......
#!/usr/bin/env perl
$output = pop;
open STDOUT,">$stdout";
print <<'___';
.text
......@@ -214,3 +218,5 @@ OPENSSL_instrument_bus2:
.end OPENSSL_instrument_bus2
___
}
close STDOUT;
......@@ -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)
......@@ -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;
......@@ -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;
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册