Commit 16760a30 authored by Andy Polyakov's avatar Andy Polyakov
Browse files

Proper support for OpenBSD-i386 shared build, including assember modules!

"Proper" means "compiles and passes test." Versioning is broken (I think).
parent 2b247cf8
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -116,7 +116,7 @@ my $bits2="SIXTY_FOUR_BIT ";

my $x86_elf_asm="x86cpuid-elf.o:asm/bn86-elf.o asm/co86-elf.o:asm/dx86-elf.o asm/yx86-elf.o::asm/bx86-elf.o:asm/mx86-elf.o:asm/sx86-elf.o asm/s512sse2-elf.o:asm/cx86-elf.o:asm/rx86-elf.o:asm/rm86-elf.o:asm/r586-elf.o";
my $x86_coff_asm="x86cpuid-cof.o:asm/bn86-cof.o asm/co86-cof.o:asm/dx86-cof.o asm/yx86-cof.o::asm/bx86-cof.o:asm/mx86-cof.o:asm/sx86-cof.o asm/s512sse2-cof.o:asm/cx86-cof.o:asm/rx86-cof.o:asm/rm86-cof.o:asm/r586-cof.o";
my $x86_out_asm="x86cpuid-out.o:asm/bn86-out.o asm/co86-out.o:asm/dx86-out.o asm/yx86-out.o::asm/bx86-out.o:asm/mx86-out.o:asm/sx86-out.o asm/s512sse2-out.o:asm/cx86-out.o:asm/rx86-out.o:asm/rm86-out.o:asm/r586-out.o";
my $x86_out_asm="x86cpuid-out.o:bn86-out.o co86-out.o:dx86-out.o yx86-out.o::bx86-out.o:mx86-out.o:sx86-out.o s512sse2-out.o:cx86-out.o:rx86-out.o:rm86-out.o:r586-out.o";
my $no_asm="::::::::::";

# -DB_ENDIAN slows things down on a sparc for md5, but helps sha1.
@@ -363,7 +363,7 @@ my %table=(
# Some OpenBSD from Bob Beck <beck@obtuse.com>
"OpenBSD",		"gcc:-DTERMIOS -O3 -fomit-frame-pointer::(unknown):::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"OpenBSD-alpha",	"gcc:-DTERMIOS -O3 -fomit-frame-pointer::(unknown):::SIXTY_FOUR_BIT_LONG DES_INT DES_PTR DES_RISC2:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"OpenBSD-i386",		"gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"OpenBSD-i386",		"gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer::(unknown):::BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_out_asm}:dlfcn:bsd-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"OpenBSD-m68k",		"gcc:-DTERMIOS -O3 -fomit-frame-pointer::(unknown):::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"OpenBSD-m88k",		"gcc:-DTERMIOS -O3 -fomit-frame-pointer::(unknown):::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"OpenBSD-mips",		"gcc:-DL_ENDIAN -DTERMIOS -O3 -fomit-frame-pointer::(unknown):::BN_LLONG RC2_CHAR RC4_INDEX DES_INT DES_UNROLL DES_RISC2:${no_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+34 −1
Original line number Diff line number Diff line
@@ -167,6 +167,36 @@ link_a.gnu:
link_app.gnu:
	@ $(DO_GNU_APP); $(LINK_APP)

link_o.bsd:
	@if ${DETECT_GNU_LD}; then $(DO_GNU_SO); else \
	$(CALC_VERSIONS); \
	SHLIB=lib$(LIBNAME).so; \
	SHLIB_SUFFIX=; \
	LIBDEPS=; \
	ALLSYMSFLAGS="-Wl,-Bforcearchive"; \
	NOALLSYMSFLAGS=; \
	SHAREDFLAGS="-shared -nostdlib"; \
	SHAREDCMD=$(CC); \
	fi; $(LINK_SO_O)
link_a.bsd:
	@if ${DETECT_GNU_LD}; then $(DO_GNU_SO); else \
	$(CALC_VERSIONS); \
	SHLIB=lib$(LIBNAME).so; \
	SHLIB_SUFFIX=; \
	LIBDEPS=; \
	ALLSYMSFLAGS="-Wl,-Bforcearchive"; \
	NOALLSYMSFLAGS=; \
	SHAREDFLAGS="-shared -nostdlib"; \
	SHAREDCMD=$(CC); \
	fi; $(LINK_SO_A)
link_app.bsd:
	@if ${DETECT_GNU_LD}; then $(DO_GNU_APP); else \
	LDCMD=$(CC); \
	LDFLAGS="-Wl,-rpath,$(LIBPATH)"; \
	LIBDEPS="$(LIBDEPS)"; \
	APPNAME="$(APPNAME)"; \
	fi; $(LINK_APP)

# For Darwin AKA Mac OS/X (dyld)
link_o.darwin:
	@ $(CALC_VERSIONS); \
@@ -707,7 +737,10 @@ symlink.cygwin symlib.alpha-osf1 symlink.tru64 symlink.tru64-rpath:
link_o.bsd-gcc-shared link_o.linux-shared link_o.gnu-shared: link_o.gnu
link_a.bsd-gcc-shared link_a.linux-shared link_a.gnu-shared: link_a.gnu
link_app.bsd-gcc-shared link_app.linux-shared link_app.gnu-shared: link_app.gnu
symlink.bsd-gcc-shared symlink.linux-shared symlink.gnu-shared: symlink.gnu
symlink.bsd-gcc-shared symlink.bsd-shared symlink.linux-shared symlink.gnu-shared: symlink.gnu
link_o.bsd-shared: link_o.bsd
link_a.bsd-shared: link_a.bsd
link_app.bsd-shared: link_app.bsd
link_o.darwin-shared: link_o.darwin
link_a.darwin-shared: link_a.darwin
link_app.darwin-shared: link_app.darwin
+3 −3
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ EX_LIBS=
 
CFLAGS= $(INCLUDE) $(CFLAG)
ASFLAGS= $(INCLUDE) $(ASFLAG)

AFLAGS=$(ASFLAGS)

LIBS=

@@ -67,8 +67,8 @@ x86cpuid-elf.s: x86cpuid.pl perlasm/x86asm.pl
	$(PERL) x86cpuid.pl elf $(CFLAGS) $(PROCESSOR) > $@
x86cpuid-cof.s: x86cpuid.pl perlasm/x86asm.pl
	$(PERL) x86cpuid.pl coff $(CFLAGS) $(PROCESSOR) > $@
x86cpuid-out.o: x86cpuid.pl perlasm/x86asm.pl
	$(PERL) x86cpuid.pl a.out $(CFLAGS) $(PROCESSOR) | as -o $@
x86cpuid-out.s: x86cpuid.pl perlasm/x86asm.pl
	$(PERL) x86cpuid.pl a.out $(CFLAGS) $(PROCESSOR) > $@

amd64cpuid.s: amd64cpuid.pl
	$(PERL) amd64cpuid.pl $@
+4 −3
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ BF_ENC= bf_enc.o

CFLAGS= $(INCLUDES) $(CFLAG)
ASFLAGS= $(INCLUDES) $(ASFLAG)
AFLAGS= $(ASFLAGS)

GENERAL=Makefile
TEST=bftest.c
@@ -56,8 +57,8 @@ asm/bx86-elf.s: asm/bf-586.pl ../perlasm/x86asm.pl ../perlasm/cbc.pl
asm/bx86-cof.s: asm/bf-586.pl ../perlasm/x86asm.pl ../perlasm/cbc.pl
	(cd asm; $(PERL) bf-586.pl coff $(CFLAGS) $(PROCESSOR) > ../$@)
# a.out
asm/bx86-out.o: asm/bf-586.pl ../perlasm/x86asm.pl ../perlasm/cbc.pl
	(cd asm; $(PERL) bf-586.pl a.out $(CFLAGS) $(PROCESSOR) | as -o ../$@)
bx86-out.s: asm/bf-586.pl ../perlasm/x86asm.pl ../perlasm/cbc.pl
	(cd asm; $(PERL) bf-586.pl a.out $(CFLAGS) $(PROCESSOR) > ../$@)

files:
	$(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
@@ -93,7 +94,7 @@ dclean:
	mv -f Makefile.new $(MAKEFILE)

clean:
	rm -f asm/bx86unix.cpp asm/*.s *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
	rm -f asm/bx86unix.cpp asm/*.s asm/*.o *.s *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff

# DO NOT DELETE THIS LINE -- make depend depends on it.

+6 −5
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ BN_ASM= bn_asm.o

CFLAGS= $(INCLUDES) $(CFLAG)
ASFLAGS= $(INCLUDES) $(ASFLAG)
AFLAGS= $(ASFLAGS)

GENERAL=Makefile
TEST=bntest.c exptest.c
@@ -78,10 +79,10 @@ asm/bn86-cof.s: asm/bn-586.pl ../perlasm/x86asm.pl
asm/co86-cof.s: asm/co-586.pl ../perlasm/x86asm.pl
	(cd asm; $(PERL) co-586.pl coff $(CFLAGS) > ../$@)
# a.out
asm/bn86-out.o: asm/bn-586.pl ../perlasm/x86asm.pl
	(cd asm; $(PERL) bn-586.pl a.out $(CFLAGS) | as -o ../$@)
asm/co86-out.o: asm/co-586.pl ../perlasm/x86asm.pl
	(cd asm; $(PERL) co-586.pl a.out $(CFLAGS) | as -o ../$@)
bn86-out.s: asm/bn-586.pl ../perlasm/x86asm.pl
	(cd asm; $(PERL) bn-586.pl a.out $(CFLAGS) > ../$@)
co86-out.s: asm/co-586.pl ../perlasm/x86asm.pl
	(cd asm; $(PERL) co-586.pl a.out $(CFLAGS) > ../$@)

asm/sparcv8.o: asm/sparcv8.S

@@ -146,7 +147,7 @@ dclean:
	mv -f Makefile.new $(MAKEFILE)

clean:
	rm -f asm/co86unix.cpp asm/bn86unix.cpp asm/*-elf.* asm/*-cof.* asm/*-out.* asm/ia64.s *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff bn_asm.s
	rm -f asm/co86unix.cpp asm/bn86unix.cpp asm/*-elf.* asm/*-cof.* asm/*-out.* asm/ia64.s *.s *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff bn_asm.s

# DO NOT DELETE THIS LINE -- make depend depends on it.

Loading