New option to generate 80386 code.

This commit is contained in:
Ulf Möller 1999-03-31 12:38:27 +00:00
parent 6d02d8e444
commit 2613c1fa2f
11 changed files with 31 additions and 17 deletions

View file

@ -5,6 +5,10 @@
Changes between 0.9.2b and 0.9.3
*) New config option to avoid instructions that are illegal on the 80386.
The default code is faster, but requires at least a 486.
[Ulf Möller]
*) Got rid of old SSL2_CLIENT_VERSION (inconsistently used) and
SSL2_SERVER_VERSION (not used at all) macros, which are now the
same as SSL2_VERSION anyway.

View file

@ -272,6 +272,7 @@ my $rc5_enc="rc5_enc.o";
my $md5_obj="";
my $sha1_obj="";
my $rmd160_obj="";
my $processor="";
if ($#ARGV < 0)
{
@ -286,6 +287,8 @@ foreach (@ARGV)
{
if ($_ =~ /^no-asm$/)
{ $no_asm=1; }
elsif ($_ =~ /^386$/)
{ $processor=386; }
elsif ($_ =~ /^-/)
{
if ($_ =~ /^-[lL](.*)$/)
@ -389,6 +392,7 @@ while (<IN>)
s/^MD5_ASM_OBJ=.*$/MD5_ASM_OBJ= $md5_obj/;
s/^SHA1_ASM_OBJ=.*$/SHA1_ASM_OBJ= $sha1_obj/;
s/^RMD160_ASM_OBJ=.*$/RMD160_ASM_OBJ= $rmd160_obj/;
s/^PROCESSOR=.*/PROCESSOR= $processor/;
print OUT $_."\n";
}
close(IN);
@ -406,6 +410,7 @@ print "RC5_ENC =$rc5_obj\n";
print "MD5_OBJ_ASM =$md5_obj\n";
print "SHA1_OBJ_ASM =$sha1_obj\n";
print "RMD160_OBJ_ASM=$rmd160_obj\n";
print "PROCESSOR =$processor\n";
my $des_ptr=0;
my $des_risc1=0;

View file

@ -23,10 +23,17 @@
This will build and install OpenSSL in the default location, which is (for
historical reasons) /usr/local/ssl. If you want to install it anywhere else,
do this after running `sh config':
do this after running `./config':
$ perl util/ssldir.pl /new/install/path
There are several options to ./config to customize the build:
-DRSAref Build with RSADSI's RSAREF toolkit.
no-asm Build with no assembler code.
386 Use the 80386 instruction set only (the default x86 code is
more efficient, but requires at least a 486).
If anything goes wrong, follow the detailed instructions below. If your
operating system is not (yet) supported by OpenSSL, see the section on
porting to a new system.

View file

@ -60,6 +60,10 @@ BN_ASM= bn_asm.o
#BN_ASM= asm/x86w16.o # 16 bit code for Windows 3.1/DOS
#BN_ASM= asm/x86w32.o # 32 bit code for Windows 3.1
# For x86 assembler: Set PROCESSOR to 386 if you want to support
# the 80386.
PROCESSOR=
# Set DES_ENC to des_enc.o if you want to use the C version
#There are 4 x86 assember options.
DES_ENC= asm/dx86-out.o asm/yx86-out.o
@ -163,14 +167,14 @@ all: Makefile.ssl
@for i in $(DIRS) ;\
do \
(cd $$i && echo "making all in $$i..." && \
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' SDIRS='${SDIRS}' AR='${AR}' all ) || exit 1; \
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' SDIRS='${SDIRS}' AR='${AR}' PROCESSOR='$(PROCESSOR)' all ) || exit 1; \
done;
sub_all:
@for i in $(DIRS) ;\
do \
(cd $$i && echo "making all in $$i..." && \
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' all ) || exit 1; \
$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='$(PROCESSOR)' all ) || exit 1; \
done;
Makefile.ssl: Makefile.org

View file

@ -64,7 +64,7 @@ asm/bx86bsdi.o: asm/bx86unix.cpp
$(CPP) -DBSDI asm/bx86unix.cpp | sed 's/ :/:/' | as -o asm/bx86bsdi.o
asm/bx86unix.cpp:
(cd asm; perl bf-586.pl cpp >bx86unix.cpp)
(cd asm; perl bf-586.pl cpp $(PROCESSOR) >bx86unix.cpp)
files:
perl $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO

View file

@ -4,7 +4,7 @@ push(@INC,"perlasm","../../perlasm");
require "x86asm.pl";
require "cbc.pl";
&asm_init($ARGV[0],"bf-586.pl");
&asm_init($ARGV[0],"bf-586.pl",$ARGV[$#ARGV] eq "386");
$BF_ROUNDS=16;
$BF_OFF=($BF_ROUNDS+2)*4;

View file

@ -67,7 +67,7 @@ asm/cx86bsdi.o: asm/cx86unix.cpp
$(CPP) -DBSDI asm/cx86unix.cpp | sed 's/ :/:/' | as -o asm/cx86bsdi.o
asm/cx86unix.cpp: asm/cast-586.pl
(cd asm; perl cast-586.pl cpp >cx86unix.cpp)
(cd asm; perl cast-586.pl cpp $(PROCESSOR) >cx86unix.cpp)
files:
perl $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO

View file

@ -7,7 +7,7 @@ push(@INC,"perlasm","../../perlasm");
require "x86asm.pl";
require "cbc.pl";
&asm_init($ARGV[0],"cast-586.pl");
&asm_init($ARGV[0],"cast-586.pl",$ARGV[$#ARGV] eq "386");
$CAST_ROUNDS=16;
$L="edi";
@ -173,3 +173,4 @@ sub E_CAST {
&xor( $L, $tmp1);
# XXX
}

View file

@ -15,14 +15,9 @@ sub main'asm_finish
sub main'asm_init
{
($type,$fn)=@_;
($type,$fn,$i386)=@_;
$filename=$fn;
if ($ARGV[$#ARGV] eq "386")
{
$i386=1;
}
$cpp=$sol=$aout=$win32=0;
if ( ($type eq "elf"))
{ require "x86unix.pl"; }
@ -37,8 +32,6 @@ sub main'asm_init
else
{
print STDERR <<"EOF";
Usage: $filename <target> [386]
Pick one target type from
elf - linux, FreeBSD etc
a.out - old linux

View file

@ -61,7 +61,7 @@ asm/sx86bsdi.o: asm/sx86unix.cpp
$(CPP) -DBSDI asm/sx86unix.cpp | sed 's/ :/:/' | as -o asm/sx86bsdi.o
asm/sx86unix.cpp:
(cd asm; perl sha1-586.pl cpp >sx86unix.cpp)
(cd asm; perl sha1-586.pl cpp $(PROCESSOR) >sx86unix.cpp)
files:
perl $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO

View file

@ -5,7 +5,7 @@ $normal=0;
push(@INC,"perlasm","../../perlasm");
require "x86asm.pl";
&asm_init($ARGV[0],"sha1-586.pl");
&asm_init($ARGV[0],"sha1-586.pl",$ARGV[$#ARGV] eq "386");
$A="eax";
$B="ebx";