Commit 3cc9a89d authored by Andy Polyakov's avatar Andy Polyakov
Browse files

Unified targets for ELF assembler modules. Tested on Linux, Solaris and

FreeBSD. Goal is to extend support even to SCO5, UnixWare/OpenUnix...
parent 46a0d4fb
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -161,7 +161,7 @@ my %table=(
# surrounds it with #APP #NO_APP comment pair which (at least Solaris
# 7_x86) /usr/ccs/bin/as fails to assemble with "Illegal mnemonic"
# error message.
"solaris-x86-gcc","gcc:-O3 -fomit-frame-pointer -m486 -Wall -DL_ENDIAN -DOPENSSL_NO_INLINE_ASM::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_sol_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"solaris-x86-gcc","gcc:-O3 -fomit-frame-pointer -m486 -Wall -DL_ENDIAN -DOPENSSL_NO_INLINE_ASM::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",

#### Solaris x86 with Sun C setups
"solaris-x86-cc","cc:-fast -O -Xa::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR::::::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+9 −1
Original line number Diff line number Diff line
@@ -72,6 +72,14 @@ TAR= tar
TARFLAGS= --no-recursion
MAKEDEPPROG=makedepend

# 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=$(CFLAG)

# Set BN_ASM to bn_asm.o if you want to use the C version
BN_ASM= bn_asm.o
#BN_ASM= bn_asm.o
@@ -208,7 +216,7 @@ all: Makefile.ssl build_all openssl.pc
BUILD_CMD=if echo " $(DIRS) " | grep " $$i " >/dev/null 2>/dev/null; then \
	if [ -d "$$i" ]; then \
		(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}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' all ) || exit 1; \
		$(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' AS='${AS}' ASFLAGS='${ASFLAGS}' 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}' PERL='${PERL}' RANLIB='${RANLIB}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' all ) || exit 1; \
	else \
		$(MAKE) $$i; \
	fi; fi
+3 −9
Original line number Diff line number Diff line
@@ -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.

+5 −24
Original line number Diff line number Diff line
@@ -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=
@@ -75,22 +67,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
@@ -180,7 +161,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.

+3 −9
Original line number Diff line number Diff line
@@ -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.

Loading