зеркало из https://github.com/mozilla/pjs.git
Radical change to freebl "32-bit" builds on Solaris and HP-UX "32-bit".
Build two DSOs, both conforming to the platform's 32-bit ABI, one of which uses only 32-bit instructions, the other uses 64-bit instructions. Then load the best one for the local CPU at run time. This allows greatly enhanced performance on 64-bit CPUs while still supporting older 32-bit CPUs.
This commit is contained in:
Родитель
bcaf662a61
Коммит
b93956f65d
|
@ -56,6 +56,8 @@ include $(CORE_DEPTH)/coreconf/config.mk
|
||||||
|
|
||||||
-include config.mk
|
-include config.mk
|
||||||
|
|
||||||
|
CPORLN = ln -s
|
||||||
|
|
||||||
ifdef USE_64
|
ifdef USE_64
|
||||||
DEFINES += -DNSS_USE_64
|
DEFINES += -DNSS_USE_64
|
||||||
endif
|
endif
|
||||||
|
@ -69,6 +71,7 @@ endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(OS_ARCH),WINNT)
|
ifeq ($(OS_ARCH),WINNT)
|
||||||
|
CPORLN = cp
|
||||||
ifneq ($(OS_TARGET),WIN16)
|
ifneq ($(OS_TARGET),WIN16)
|
||||||
ASFILES = mpi_x86.asm
|
ASFILES = mpi_x86.asm
|
||||||
DEFINES += -DMP_ASSEMBLY_MULTIPLY -DMP_ASSEMBLY_SQUARE -DMP_ASSEMBLY_DIV_2DX1D
|
DEFINES += -DMP_ASSEMBLY_MULTIPLY -DMP_ASSEMBLY_SQUARE -DMP_ASSEMBLY_DIV_2DX1D
|
||||||
|
@ -101,22 +104,26 @@ endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(OS_ARCH), HP-UX)
|
ifeq ($(OS_ARCH), HP-UX)
|
||||||
|
MKSHLIB += +k +vshlibunsats -u FREEBL_GetVector +e FREEBL_GetVector
|
||||||
|
ifndef FREEBL_EXTENDED_BUILD
|
||||||
ifdef USE_PURE_32
|
ifdef USE_PURE_32
|
||||||
# build for DA1.1 (HP PA 1.1) pure 32 bit model
|
# build for DA1.1 (HP PA 1.1) pure 32 bit model
|
||||||
DEFINES += -DMP_USE_UINT_DIGIT -DMP_NO_MP_WORD
|
DEFINES += -DMP_USE_UINT_DIGIT -DMP_NO_MP_WORD
|
||||||
else
|
else
|
||||||
ifdef USE_64
|
ifdef USE_64
|
||||||
# this builds for DA2.0W (HP PA 2.0 Wide), the LP64 ABI, using 32-bit digits
|
# this builds for DA2.0W (HP PA 2.0 Wide), the LP64 ABI, using 32-bit digits
|
||||||
MPI_SRCS += montmulf.c
|
MPI_SRCS += mpi_hp.c
|
||||||
DEFINES += -DMP_USING_MONT_MULF -DMP_USE_UINT_DIGIT
|
ASFILES += hpma512.s hppa20.s
|
||||||
DEFINES += -DMP_USE_LONG_LONG_MULTIPLY -DMP_NO_MP_WORD
|
DEFINES += -DMP_ASSEMBLY_MULTIPLY -DMP_ASSEMBLY_SQUARE
|
||||||
else
|
else
|
||||||
# this builds for DA2.0 (HP PA 2.0 Narrow) hybrid model
|
# this builds for DA2.0 (HP PA 2.0 Narrow) hybrid model
|
||||||
# (the 32-bit ABI with 64-bit registers) using 32-bit digits
|
# (the 32-bit ABI with 64-bit registers) using 32-bit digits
|
||||||
MPI_SRCS += montmulf.c
|
MPI_SRCS += mpi_hp.c
|
||||||
DEFINES += -DMP_USING_MONT_MULF -DMP_USE_UINT_DIGIT
|
ASFILES += hpma512.s hppa20.s
|
||||||
DEFINES += -DMP_USE_LONG_LONG_MULTIPLY -DMP_NO_MP_WORD
|
DEFINES += -DMP_ASSEMBLY_MULTIPLY -DMP_ASSEMBLY_SQUARE
|
||||||
OS_CFLAGS += -Aa +e +DA2.0 +DS2.0
|
# This is done in coreconf by defining USE_LONG_LONGS
|
||||||
|
# OS_CFLAGS += -Aa +e +DA2.0 +DS2.0
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
@ -125,8 +132,10 @@ endif
|
||||||
ifeq ($(OS_TARGET),SunOS)
|
ifeq ($(OS_TARGET),SunOS)
|
||||||
ifeq ($(CPU_ARCH),sparc)
|
ifeq ($(CPU_ARCH),sparc)
|
||||||
ifndef NS_USE_GCC
|
ifndef NS_USE_GCC
|
||||||
|
ifndef USE_PURE_32
|
||||||
OS_CFLAGS += -xchip=ultra2
|
OS_CFLAGS += -xchip=ultra2
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
ifeq ($(OS_RELEASE),5.5.1)
|
ifeq ($(OS_RELEASE),5.5.1)
|
||||||
SYSV_SPARC = 1
|
SYSV_SPARC = 1
|
||||||
endif
|
endif
|
||||||
|
@ -141,6 +150,7 @@ ifeq ($(OS_RELEASE),5.8)
|
||||||
endif
|
endif
|
||||||
ifeq ($(SYSV_SPARC),1)
|
ifeq ($(SYSV_SPARC),1)
|
||||||
SOLARIS_AS = /usr/ccs/bin/as
|
SOLARIS_AS = /usr/ccs/bin/as
|
||||||
|
MKSHLIB += -B symbolic -z defs -z now -z text -M mapfile.Solaris
|
||||||
ifdef USE_PURE_32
|
ifdef USE_PURE_32
|
||||||
# this builds for Sparc v8 pure 32-bit architecture
|
# this builds for Sparc v8 pure 32-bit architecture
|
||||||
DEFINES += -DMP_USE_LONG_LONG_MULTIPLY -DMP_USE_UINT_DIGIT -DMP_NO_MP_WORD
|
DEFINES += -DMP_USE_LONG_LONG_MULTIPLY -DMP_USE_UINT_DIGIT -DMP_NO_MP_WORD
|
||||||
|
@ -203,34 +213,37 @@ endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
mp%.h : mpi/mp%.h
|
mp%.h : mpi/mp%.h
|
||||||
cd mpi; cp $@ ..
|
-$(CPORLN) $< .
|
||||||
|
|
||||||
mp%.c : mpi/mp%.c
|
mp%.c : mpi/mp%.c
|
||||||
cd mpi; cp $@ ..
|
-$(CPORLN) $< .
|
||||||
|
|
||||||
mp%.S : mpi/mp%.S
|
mp%.S : mpi/mp%.S
|
||||||
cd mpi; cp $@ ..
|
-$(CPORLN) $< .
|
||||||
|
|
||||||
mp%.s : mpi/mp%.s
|
mp%.s : mpi/mp%.s
|
||||||
cd mpi; cp $@ ..
|
-$(CPORLN) $< .
|
||||||
|
|
||||||
mp%.asm : mpi/mp%.asm
|
mp%.asm : mpi/mp%.asm
|
||||||
cd mpi; cp $@ ..
|
-$(CPORLN) $< .
|
||||||
|
|
||||||
logtab.h : mpi/logtab.h
|
logtab.h : mpi/logtab.h
|
||||||
cd mpi; cp $@ ..
|
-$(CPORLN) $< .
|
||||||
|
|
||||||
primes.c : mpi/primes.c
|
primes.c : mpi/primes.c
|
||||||
cd mpi; cp $@ ..
|
-$(CPORLN) $< .
|
||||||
|
|
||||||
vis%.il : mpi/vis%.il
|
vis%.il : mpi/vis%.il
|
||||||
cd mpi; cp $@ ..
|
-$(CPORLN) $< .
|
||||||
|
|
||||||
vis%.h : mpi/vis%.h
|
vis%.h : mpi/vis%.h
|
||||||
cd mpi; cp $@ ..
|
-$(CPORLN) $< .
|
||||||
|
|
||||||
mont% : mpi/mont%
|
mont% : mpi/mont%
|
||||||
cd mpi; cp $@ ..
|
-$(CPORLN) $< .
|
||||||
|
|
||||||
|
hp%.s : mpi/hp%.s
|
||||||
|
-$(CPORLN) $< .
|
||||||
|
|
||||||
.PRECIOUS : $(MPI_SRCS) $(MPI_HDRS) $(ASFILES)
|
.PRECIOUS : $(MPI_SRCS) $(MPI_HDRS) $(ASFILES)
|
||||||
|
|
||||||
|
@ -273,3 +286,34 @@ endif
|
||||||
ifeq ($(OS_ARCH), HP-UX)
|
ifeq ($(OS_ARCH), HP-UX)
|
||||||
$(OBJDIR)/mpmontg.o: mpmontg.c montmulf.h
|
$(OBJDIR)/mpmontg.o: mpmontg.c montmulf.h
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
$(OBJDIR)/ldvector.o $(OBJDIR)/loader.o : loader.h
|
||||||
|
|
||||||
|
ifdef FREEBL_EXTENDED_BUILD
|
||||||
|
|
||||||
|
PURE32DIR = $(OS_ARCH)pure32
|
||||||
|
ALL_TRASH += $(PURE32DIR)
|
||||||
|
|
||||||
|
FILES2LN = \
|
||||||
|
$(ALL_HDRS) \
|
||||||
|
$(ALL_CSRCS) \
|
||||||
|
$(wildcard *.tab) \
|
||||||
|
$(wildcard mapfile.*) \
|
||||||
|
Makefile manifest.mn config.mk
|
||||||
|
|
||||||
|
LINKEDFILES = $(addprefix $(PURE32DIR)/, $(FILES2LN))
|
||||||
|
|
||||||
|
$(PURE32DIR):
|
||||||
|
-mkdir $(PURE32DIR)
|
||||||
|
-ln -s ../mpi $(PURE32DIR)
|
||||||
|
|
||||||
|
$(LINKEDFILES) : $(PURE32DIR)/% : %
|
||||||
|
ln -s ../$* $(PURE32DIR)
|
||||||
|
|
||||||
|
libs::
|
||||||
|
$(MAKE) FREEBL_RECURSIVE_BUILD=1 USE_HYBRID=1 libs
|
||||||
|
|
||||||
|
libs:: $(PURE32DIR) $(LINKEDFILES)
|
||||||
|
cd $(PURE32DIR) && $(MAKE) FREEBL_RECURSIVE_BUILD=1 USE_PURE_32=1 libs
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
|
@ -31,14 +31,69 @@
|
||||||
# GPL.
|
# GPL.
|
||||||
#
|
#
|
||||||
|
|
||||||
#
|
# only do this in the outermost freebl build.
|
||||||
# Override TARGETS variable so that only static libraries
|
ifndef FREEBL_RECURSIVE_BUILD
|
||||||
# are specifed as dependencies within rules.mk.
|
# we only do this stuff for some of the 32-bit builds, no 64-bit builds
|
||||||
#
|
ifndef USE_64
|
||||||
|
|
||||||
TARGETS = $(LIBRARY)
|
ifeq ($(OS_ARCH), HP-UX)
|
||||||
SHARED_LIBRARY =
|
FREEBL_EXTENDED_BUILD = 1
|
||||||
IMPORT_LIBRARY =
|
endif
|
||||||
PURE_LIBRARY =
|
|
||||||
PROGRAM =
|
|
||||||
|
|
||||||
|
ifeq ($(OS_TARGET),SunOS)
|
||||||
|
ifeq ($(CPU_ARCH),sparc)
|
||||||
|
FREEBL_EXTENDED_BUILD = 1
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifdef FREEBL_EXTENDED_BUILD
|
||||||
|
# We're going to change this build so that it builds libfreebl.a with
|
||||||
|
# just loader.c. Then we have to build this directory twice again to
|
||||||
|
# build the two DSOs.
|
||||||
|
# To build libfreebl.a with just loader.c, we must now override many
|
||||||
|
# of the make variables setup by the prior inclusion of CORECONF's config.mk
|
||||||
|
|
||||||
|
CSRCS = loader.c
|
||||||
|
SIMPLE_OBJS = $(CSRCS:.c=$(OBJ_SUFFIX))
|
||||||
|
OBJS = $(addprefix $(OBJDIR)/$(PROG_PREFIX), $(SIMPLE_OBJS))
|
||||||
|
ALL_TRASH := $(TARGETS) $(OBJS) $(OBJDIR) LOGS TAGS $(GARBAGE) \
|
||||||
|
$(NOSUCHFILE) so_locations
|
||||||
|
endif
|
||||||
|
|
||||||
|
#end of 32-bit only stuff.
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Override the values defined in coreconf's ruleset.mk.
|
||||||
|
#
|
||||||
|
# - (1) LIBRARY: a static (archival) library
|
||||||
|
# - (2) SHARED_LIBRARY: a shared (dynamic link) library
|
||||||
|
# - (3) IMPORT_LIBRARY: an import library, used only on Windows
|
||||||
|
# - (4) PURE_LIBRARY: a library for Purify
|
||||||
|
# - (5) PROGRAM: an executable binary
|
||||||
|
#
|
||||||
|
# override these variables to prevent building a DSO/DLL.
|
||||||
|
TARGETS = $(LIBRARY)
|
||||||
|
SHARED_LIBRARY =
|
||||||
|
IMPORT_LIBRARY =
|
||||||
|
PURE_LIBRARY =
|
||||||
|
PROGRAM =
|
||||||
|
|
||||||
|
else
|
||||||
|
# This is a recursive build.
|
||||||
|
|
||||||
|
#ifeq ($(OS_ARCH), HP-UX)
|
||||||
|
EXTRA_LIBS += \
|
||||||
|
$(DIST)/lib/libsecutil.$(LIB_SUFFIX) \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
# $(PROGRAM) has NO explicit dependencies on $(EXTRA_SHARED_LIBS)
|
||||||
|
# $(EXTRA_SHARED_LIBS) come before $(OS_LIBS), except on AIX.
|
||||||
|
EXTRA_SHARED_LIBS += \
|
||||||
|
-L$(DIST)/lib/ \
|
||||||
|
-lplc4 \
|
||||||
|
-lplds4 \
|
||||||
|
-lnspr4 \
|
||||||
|
-lc
|
||||||
|
#endif
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
|
@ -34,7 +34,19 @@ CORE_DEPTH = ../../..
|
||||||
|
|
||||||
MODULE = security
|
MODULE = security
|
||||||
|
|
||||||
LIBRARY_NAME = freebl
|
ifndef FREEBL_RECURSIVE_BUILD
|
||||||
|
LIBRARY_NAME = freebl
|
||||||
|
else
|
||||||
|
ifdef USE_PURE_32
|
||||||
|
CORE_DEPTH = ../../../..
|
||||||
|
LIBRARY_NAME = freebl_pure32
|
||||||
|
else
|
||||||
|
LIBRARY_NAME = freebl_hybrid
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
# same version as rest of freebl
|
||||||
|
LIBRARY_VERSION = _3
|
||||||
|
|
||||||
REQUIRES =
|
REQUIRES =
|
||||||
|
|
||||||
|
@ -62,19 +74,36 @@ CSRCS = \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
else
|
else
|
||||||
CSRCS = \
|
CSRCS = \
|
||||||
|
ldvector.c \
|
||||||
prng_fips1861.c \
|
prng_fips1861.c \
|
||||||
sha_fast.c \
|
sha_fast.c \
|
||||||
md2.c \
|
md2.c \
|
||||||
md5.c \
|
md5.c \
|
||||||
alg2268.c \
|
alg2268.c \
|
||||||
arcfour.c \
|
arcfour.c \
|
||||||
|
arcfive.c \
|
||||||
desblapi.c \
|
desblapi.c \
|
||||||
des.c \
|
des.c \
|
||||||
|
rijndael.c \
|
||||||
dh.c \
|
dh.c \
|
||||||
pqg.c \
|
pqg.c \
|
||||||
dsa.c \
|
dsa.c \
|
||||||
rsa.c \
|
rsa.c \
|
||||||
$(MPI_SRCS) \
|
$(MPI_SRCS) \
|
||||||
rijndael.c \
|
|
||||||
$(NULL)
|
$(NULL)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ALL_CSRCS := $(CSRCS)
|
||||||
|
|
||||||
|
ALL_HDRS = \
|
||||||
|
blapi.h \
|
||||||
|
blapit.h \
|
||||||
|
des.h \
|
||||||
|
loader.h \
|
||||||
|
rijndael.h \
|
||||||
|
secmpi.h \
|
||||||
|
sha.h \
|
||||||
|
sha_fast.h \
|
||||||
|
vis_proto.h \
|
||||||
|
$(NULL)
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче