summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
Diffstat (limited to 'crypto')
-rw-r--r--crypto/bf/Makefile.ssl12
-rw-r--r--crypto/bn/Makefile.ssl29
-rw-r--r--crypto/cast/Makefile.ssl12
-rw-r--r--crypto/des/Makefile.ssl31
-rw-r--r--crypto/md5/Makefile.ssl20
-rw-r--r--crypto/perlasm/x86asm.pl9
-rw-r--r--crypto/perlasm/x86unix.pl32
-rw-r--r--crypto/rc4/Makefile.ssl12
-rw-r--r--crypto/rc5/Makefile.ssl12
-rw-r--r--crypto/ripemd/Makefile.ssl12
-rw-r--r--crypto/sha/Makefile.ssl12
11 files changed, 65 insertions, 128 deletions
diff --git a/crypto/bf/Makefile.ssl b/crypto/bf/Makefile.ssl
index bd3cedc4f8..bb14a0ee82 100644
--- a/crypto/bf/Makefile.ssl
+++ b/crypto/bf/Makefile.ssl
@@ -49,14 +49,8 @@ lib: $(LIBOBJ)
@touch lib
# elf
-asm/bx86-elf.o: asm/bx86unix.cpp
- $(CPP) -DELF -x c asm/bx86unix.cpp | as -o asm/bx86-elf.o
-
-# solaris
-asm/bx86-sol.o: asm/bx86unix.cpp
- $(CC) -E -DSOL asm/bx86unix.cpp | sed 's/^#.*//' > asm/bx86-sol.s
- as -o asm/bx86-sol.o asm/bx86-sol.s
- rm -f asm/bx86-sol.s
+asm/bx86-elf.s: asm/bf-586.pl ../perlasm/x86asm.pl ../perlasm/cbc.pl
+ (cd asm; $(PERL) bf-586.pl elf $(CFLAGS) $(PROCESSOR) > bx86-elf.s)
# a.out
asm/bx86-out.o: asm/bx86unix.cpp
@@ -103,7 +97,7 @@ dclean:
mv -f Makefile.new $(MAKEFILE)
clean:
- rm -f asm/bx86unix.cpp *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
+ rm -f asm/bx86unix.cpp asm/*-elf.* *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
# DO NOT DELETE THIS LINE -- make depend depends on it.
diff --git a/crypto/bn/Makefile.ssl b/crypto/bn/Makefile.ssl
index 1d37892013..c1547a8e6d 100644
--- a/crypto/bn/Makefile.ssl
+++ b/crypto/bn/Makefile.ssl
@@ -23,14 +23,6 @@ BN_ASM= bn_asm.o
CFLAGS= $(INCLUDES) $(CFLAG)
-# We let the C compiler driver to take care of .s files. This is done in
-# order to be excused from maintaining a separate set of architecture
-# dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
-# gcc, then the driver will automatically translate it to -xarch=v8plus
-# and pass it down to assembler.
-AS=$(CC) -c
-ASFLAGS=$(CFLAGS)
-
GENERAL=Makefile
TEST=bntest.c exptest.c
APPS=
@@ -73,22 +65,11 @@ lib: $(LIBOBJ)
@touch lib
# elf
-asm/bn86-elf.o: asm/bn86unix.cpp
- $(CPP) -DELF -x c asm/bn86unix.cpp | as -o asm/bn86-elf.o
-
-asm/co86-elf.o: asm/co86unix.cpp
- $(CPP) -DELF -x c asm/co86unix.cpp | as -o asm/co86-elf.o
-
-# solaris
-asm/bn86-sol.o: asm/bn86unix.cpp
- $(CC) -E -DSOL asm/bn86unix.cpp | sed 's/^#.*//' > asm/bn86-sol.s
- as -o asm/bn86-sol.o asm/bn86-sol.s
- rm -f asm/bn86-sol.s
+asm/bn86-elf.s: asm/bn-586.pl ../perlasm/x86asm.pl
+ (cd asm; $(PERL) bn-586.pl elf $(CFLAGS) > bn86-elf.s)
-asm/co86-sol.o: asm/co86unix.cpp
- $(CC) -E -DSOL asm/co86unix.cpp | sed 's/^#.*//' > asm/co86-sol.s
- as -o asm/co86-sol.o asm/co86-sol.s
- rm -f asm/co86-sol.s
+asm/co86-elf.s: asm/co-586.pl ../perlasm/x86asm.pl
+ (cd asm; $(PERL) co-586.pl elf $(CFLAGS) > co86-elf.s)
# a.out
asm/bn86-out.o: asm/bn86unix.cpp
@@ -178,7 +159,7 @@ dclean:
mv -f Makefile.new $(MAKEFILE)
clean:
- rm -f asm/co86unix.cpp asm/bn86unix.cpp *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff bn_asm.s
+ rm -f asm/co86unix.cpp asm/bn86unix.cpp asm/*-elf.* *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff bn_asm.s
# DO NOT DELETE THIS LINE -- make depend depends on it.
diff --git a/crypto/cast/Makefile.ssl b/crypto/cast/Makefile.ssl
index c18d86845e..70c47bf8e6 100644
--- a/crypto/cast/Makefile.ssl
+++ b/crypto/cast/Makefile.ssl
@@ -52,14 +52,8 @@ lib: $(LIBOBJ)
@touch lib
# elf
-asm/cx86-elf.o: asm/cx86unix.cpp
- $(CPP) -DELF -x c asm/cx86unix.cpp | as -o asm/cx86-elf.o
-
-# solaris
-asm/cx86-sol.o: asm/cx86unix.cpp
- $(CC) -E -DSOL asm/cx86unix.cpp | sed 's/^#.*//' > asm/cx86-sol.s
- as -o asm/cx86-sol.o asm/cx86-sol.s
- rm -f asm/cx86-sol.s
+asm/cx86-elf.s: asm/cast-586.pl ../perlasm/x86asm.pl ../perlasm/cbc.pl
+ (cd asm; $(PERL) cast-586.pl elf $(CLAGS) $(PROCESSOR) > cx86-elf.s)
# a.out
asm/cx86-out.o: asm/cx86unix.cpp
@@ -104,7 +98,7 @@ dclean:
mv -f Makefile.new $(MAKEFILE)
clean:
- rm -f asm/cx86unix.cpp *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
+ rm -f asm/cx86unix.cpp asm/*-elf.* *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
# DO NOT DELETE THIS LINE -- make depend depends on it.
diff --git a/crypto/des/Makefile.ssl b/crypto/des/Makefile.ssl
index 2edb542db9..548573f4b1 100644
--- a/crypto/des/Makefile.ssl
+++ b/crypto/des/Makefile.ssl
@@ -66,30 +66,11 @@ des: des.o cbc3_enc.o lib
$(CC) $(CFLAGS) -o des des.o cbc3_enc.o $(LIB)
# elf
-asm/dx86-elf.o: asm/dx86unix.cpp
- $(CPP) -DELF \
- `(echo $(CFLAGS) | egrep -ie '-[fK]PIC') > /dev/null 2>&1 && echo -DPIC; exit 0`\
- -x c asm/dx86unix.cpp | as -o asm/dx86-elf.o
-
-asm/yx86-elf.o: asm/yx86unix.cpp
- $(CPP) -DELF \
- `(echo $(CFLAGS) | egrep -ie '-[fK]PIC') > /dev/null 2>&1 && echo -DPIC; exit 0`\
- -x c asm/yx86unix.cpp | as -o asm/yx86-elf.o
-
-# solaris
-asm/dx86-sol.o: asm/dx86unix.cpp
- $(CC) -E -DSOL \
- `(echo $(CFLAGS) | egrep -ie '-[fK]PIC') > /dev/null 2>&1 && echo -DPIC; exit 0`\
- asm/dx86unix.cpp | sed 's/^#.*//' > asm/dx86-sol.s
- as -o asm/dx86-sol.o asm/dx86-sol.s
- rm -f asm/dx86-sol.s
-
-asm/yx86-sol.o: asm/yx86unix.cpp
- $(CC) -E -DSOL \
- `(echo $(CFLAGS) | egrep -ie '-[fK]PIC') > /dev/null 2>&1 && echo -DPIC; exit 0`\
- asm/yx86unix.cpp | sed 's/^#.*//' > asm/yx86-sol.s
- as -o asm/yx86-sol.o asm/yx86-sol.s
- rm -f asm/yx86-sol.s
+asm/dx86-elf.s: asm/des-586.pl ../perlasm/x86asm.pl ../perlasm/cbc.pl
+ (cd asm; $(PERL) des-586.pl elf $(CFLAGS) > dx86-elf.s)
+
+asm/yx86-elf.s: asm/crypt586.pl ../perlasm/x86asm.pl ../perlasm/cbc.pl
+ (cd asm; $(PERL) crypt586.pl elf $(CFLAGS) > yx86-elf.s)
# a.out
asm/dx86-out.o: asm/dx86unix.cpp
@@ -145,7 +126,7 @@ dclean:
mv -f Makefile.new $(MAKEFILE)
clean:
- rm -f asm/dx86unix.cpp asm/yx86unix.cpp *.o asm/*.o *.obj des lib tags core .pure .nfs* *.old *.bak fluff
+ rm -f asm/dx86unix.cpp asm/yx86unix.cpp asm/*-elf.* *.o asm/*.o *.obj des lib tags core .pure .nfs* *.old *.bak fluff
# DO NOT DELETE THIS LINE -- make depend depends on it.
diff --git a/crypto/md5/Makefile.ssl b/crypto/md5/Makefile.ssl
index e28bb92451..56cab5d882 100644
--- a/crypto/md5/Makefile.ssl
+++ b/crypto/md5/Makefile.ssl
@@ -21,14 +21,6 @@ MD5_ASM_OBJ=
CFLAGS= $(INCLUDES) $(CFLAG)
-# We let the C compiler driver to take care of .s files. This is done in
-# order to be excused from maintaining a separate set of architecture
-# dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
-# gcc, then the driver will automatically translate it to -xarch=v8plus
-# and pass it down to assembler.
-AS=$(CC) -c
-ASFLAGS=$(CFLAGS)
-
GENERAL=Makefile
TEST=md5test.c
APPS=
@@ -55,14 +47,8 @@ lib: $(LIBOBJ)
@touch lib
# elf
-asm/mx86-elf.o: asm/mx86unix.cpp
- $(CPP) -DELF -x c asm/mx86unix.cpp | as -o asm/mx86-elf.o
-
-# solaris
-asm/mx86-sol.o: asm/mx86unix.cpp
- $(CC) -E -DSOL asm/mx86unix.cpp | sed 's/^#.*//' > asm/mx86-sol.s
- as -o asm/mx86-sol.o asm/mx86-sol.s
- rm -f asm/mx86-sol.s
+asm/mx86-elf.s: asm/md5-586.pl ../perlasm/x86asm.pl
+ (cd asm; $(PERL) md5-586.pl elf $(CFLAGS) > mx86-elf.s)
# a.out
asm/mx86-out.o: asm/mx86unix.cpp
@@ -125,7 +111,7 @@ dclean:
mv -f Makefile.new $(MAKEFILE)
clean:
- rm -f asm/mx86unix.cpp *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
+ rm -f asm/mx86unix.cpp asm/*-elf.* *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
# DO NOT DELETE THIS LINE -- make depend depends on it.
diff --git a/crypto/perlasm/x86asm.pl b/crypto/perlasm/x86asm.pl
index 9a3d85b098..1cb96e914a 100644
--- a/crypto/perlasm/x86asm.pl
+++ b/crypto/perlasm/x86asm.pl
@@ -18,9 +18,9 @@ sub main'asm_init
($type,$fn,$i386)=@_;
$filename=$fn;
- $cpp=$sol=$aout=$win32=$gaswin=0;
+ $elf=$cpp=$sol=$aout=$win32=$gaswin=0;
if ( ($type eq "elf"))
- { require "x86unix.pl"; }
+ { $elf=1; require "x86unix.pl"; }
elsif ( ($type eq "a.out"))
{ $aout=1; require "x86unix.pl"; }
elsif ( ($type eq "gaswin"))
@@ -47,6 +47,9 @@ EOF
exit(1);
}
+ $pic=0;
+ for (@ARGV) { $pic=1 if (/\-[fK]PIC/i); }
+
&asm_init_output();
&comment("Don't even think of reading this code");
@@ -91,7 +94,7 @@ $tmp
#undef SIZE
#undef TYPE
#define SIZE(a,b)
-#define TYPE(a,b)
+#define TYPE(a,b) .def a; .scl 2; .type 32; .endef
#endif /* __CYGWIN || __DJGPP */
#endif
diff --git a/crypto/perlasm/x86unix.pl b/crypto/perlasm/x86unix.pl
index 3ad889ffd6..72bde061c5 100644
--- a/crypto/perlasm/x86unix.pl
+++ b/crypto/perlasm/x86unix.pl
@@ -345,15 +345,15 @@ sub main'function_end
popl %ebx
popl %ebp
ret
-.${func}_end:
+.L_${func}_end:
EOF
push(@out,$tmp);
if ($main'cpp)
- { push(@out,"\tSIZE($func,.${func}_end-$func)\n"); }
+ { push(@out,"\tSIZE($func,.L_${func}_end-$func)\n"); }
elsif ($main'gaswin)
{ $tmp=push(@out,"\t.align 4\n"); }
- else { push(@out,"\t.size\t$func,.${func}_end-$func\n"); }
+ else { push(@out,"\t.size\t$func,.L_${func}_end-$func\n"); }
push(@out,".ident \"$func\"\n");
$stack=0;
%label=();
@@ -426,6 +426,11 @@ sub main'swtmp
sub main'comment
{
+ if ($main'elf) # GNU and SVR4 as'es use different comment delimiters,
+ { # so we just skip comments...
+ push(@out,"\n");
+ return;
+ }
foreach (@_)
{
if (/^\s*$/)
@@ -546,7 +551,9 @@ sub popvars
sub main'picmeup
{
local($dst,$sym)=@_;
- local($tmp)=<<___;
+ if ($main'cpp)
+ {
+ local($tmp)=<<___;
#if (defined(ELF) || defined(SOL)) && defined(PIC)
.align 8
call 1f
@@ -557,7 +564,22 @@ sub main'picmeup
leal $sym,$regs{$dst}
#endif
___
- push(@out,$tmp);
+ push(@out,$tmp);
+ }
+ elsif ($main'pic && ($main'elf || $main'aout))
+ {
+ push(@out,"\t.align\t8\n");
+ &main'call(&main'label("PIC_me_up"));
+ &main'set_label("PIC_me_up");
+ &main'blindpop($dst);
+ &main'add($dst,"\$$under"."_GLOBAL_OFFSET_TABLE_+[.-".
+ &main'label("PIC_me_up") . "]");
+ &main'mov($dst,&main'DWP($sym."\@GOT",$dst));
+ }
+ else
+ {
+ &main'lea($dst,&main'DWP($sym));
+ }
}
sub main'blindpop { &out1("popl",@_); }
diff --git a/crypto/rc4/Makefile.ssl b/crypto/rc4/Makefile.ssl
index a1eb79fd08..b210b42f8f 100644
--- a/crypto/rc4/Makefile.ssl
+++ b/crypto/rc4/Makefile.ssl
@@ -52,14 +52,8 @@ lib: $(LIBOBJ)
@touch lib
# elf
-asm/rx86-elf.o: asm/rx86unix.cpp
- $(CPP) -DELF -x c asm/rx86unix.cpp | as -o asm/rx86-elf.o
-
-# solaris
-asm/rx86-sol.o: asm/rx86unix.cpp
- $(CC) -E -DSOL asm/rx86unix.cpp | sed 's/^#.*//' > asm/rx86-sol.s
- as -o asm/rx86-sol.o asm/rx86-sol.s
- rm -f asm/rx86-sol.s
+asm/rx86-elf.s: asm/rc4-586.pl ../perlasm/x86asm.pl
+ (cd asm; $(PERL) rc4-586.pl elf $(CFLAGS) > rx86-elf.s)
# a.out
asm/rx86-out.o: asm/rx86unix.cpp
@@ -104,7 +98,7 @@ dclean:
mv -f Makefile.new $(MAKEFILE)
clean:
- rm -f asm/rx86unix.cpp *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff asm/*.o
+ rm -f asm/rx86unix.cpp asm/*-elf.* *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff asm/*.o
# DO NOT DELETE THIS LINE -- make depend depends on it.
diff --git a/crypto/rc5/Makefile.ssl b/crypto/rc5/Makefile.ssl
index bb4704d5f5..3ad6655946 100644
--- a/crypto/rc5/Makefile.ssl
+++ b/crypto/rc5/Makefile.ssl
@@ -49,14 +49,8 @@ lib: $(LIBOBJ)
@touch lib
# elf
-asm/r586-elf.o: asm/r586unix.cpp
- $(CPP) -DELF -x c asm/r586unix.cpp | as -o asm/r586-elf.o
-
-# solaris
-asm/r586-sol.o: asm/r586unix.cpp
- $(CC) -E -DSOL asm/r586unix.cpp | sed 's/^#.*//' > asm/r586-sol.s
- as -o asm/r586-sol.o asm/r586-sol.s
- rm -f asm/r586-sol.s
+asm/r586-elf.s: asm/rc5-586.pl ../perlasm/x86asm.pl ../perlasm/cbc.pl
+ (cd asm; $(PERL) rc5-586.pl elf $(CFLAGS) > r586-elf.s)
# a.out
asm/r586-out.o: asm/r586unix.cpp
@@ -101,7 +95,7 @@ dclean:
mv -f Makefile.new $(MAKEFILE)
clean:
- rm -f asm/r586unix.cpp *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
+ rm -f asm/r586unix.cpp asm/*-elf.* *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
# DO NOT DELETE THIS LINE -- make depend depends on it.
diff --git a/crypto/ripemd/Makefile.ssl b/crypto/ripemd/Makefile.ssl
index 6f1a9c59a2..3583dfdcaf 100644
--- a/crypto/ripemd/Makefile.ssl
+++ b/crypto/ripemd/Makefile.ssl
@@ -47,14 +47,8 @@ lib: $(LIBOBJ)
@touch lib
# elf
-asm/rm86-elf.o: asm/rm86unix.cpp
- $(CPP) -DELF -x c asm/rm86unix.cpp | as -o asm/rm86-elf.o
-
-# solaris
-asm/rm86-sol.o: asm/rm86unix.cpp
- $(CC) -E -DSOL asm/rm86unix.cpp | sed 's/^#.*//' > asm/rm86-sol.s
- as -o asm/rm86-sol.o asm/rm86-sol.s
- rm -f asm/rm86-sol.s
+asm/rm86-elf.s: asm/rmd-586.pl ../perlasm/x86asm.pl
+ (cd asm; $(PERL) rmd-586.pl elf $(CFLAGS) > rm86-elf.s)
# a.out
asm/rm86-out.o: asm/rm86unix.cpp
@@ -99,7 +93,7 @@ dclean:
mv -f Makefile.new $(MAKEFILE)
clean:
- rm -f asm/rm86unix.cpp *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
+ rm -f asm/rm86unix.cpp asm/*-elf.* *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
# DO NOT DELETE THIS LINE -- make depend depends on it.
diff --git a/crypto/sha/Makefile.ssl b/crypto/sha/Makefile.ssl
index 64873976a4..864645c8b5 100644
--- a/crypto/sha/Makefile.ssl
+++ b/crypto/sha/Makefile.ssl
@@ -47,14 +47,8 @@ lib: $(LIBOBJ)
@touch lib
# elf
-asm/sx86-elf.o: asm/sx86unix.cpp
- $(CPP) -DELF -x c asm/sx86unix.cpp | as -o asm/sx86-elf.o
-
-# solaris
-asm/sx86-sol.o: asm/sx86unix.cpp
- $(CC) -E -DSOL asm/sx86unix.cpp | sed 's/^#.*//' > asm/sx86-sol.s
- as -o asm/sx86-sol.o asm/sx86-sol.s
- rm -f asm/sx86-sol.s
+asm/sx86-elf.s: asm/sha1-586.pl ../perlasm/x86asm.pl
+ (cd asm; $(PERL) sha1-586.pl elf $(CFLAGS) $(PROCESSOR) > sx86-elf.s)
# a.out
asm/sx86-out.o: asm/sx86unix.cpp
@@ -99,7 +93,7 @@ dclean:
mv -f Makefile.new $(MAKEFILE)
clean:
- rm -f asm/sx86unix.cpp *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff asm/*.o
+ rm -f asm/sx86unix.cpp asm/*-elf.* *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff asm/*.o
# DO NOT DELETE THIS LINE -- make depend depends on it.