зеркало из https://github.com/mozilla/gecko-dev.git
More work on shared libraries for NSS.
1. Implemented a way to link all the objects in archive libraries into a shared library. I query each subdirectory for the list of objects comprising an archive library (the get_objs makefile target) and link these objects as opposed to the archive libraries. Not all linkers support the --whole-archive, -all, or -z allextract options. The *sym.c solution cannot fully control what objects in the archive libraries are pulled and what symbols are exported. 2. Moved pkcs7 from libsmime3.so to libnss3.so because certread.c in libcerthi.a (part of libnss3.so) depends on some PKCS7 functions, which creates a circular dependency between libsmime3.so and libnss3.so. This should work on all Unix platforms.
This commit is contained in:
Родитель
261d99acb9
Коммит
d8b46439c0
|
@ -303,6 +303,9 @@ ifneq ($(POLICY),)
|
|||
-$(PLCYPATCH) $(PLCYPATCH_ARGS) $@
|
||||
endif
|
||||
|
||||
get_objs:
|
||||
@echo $(OBJS)
|
||||
|
||||
$(LIBRARY): $(OBJS)
|
||||
@$(MAKE_OBJDIR)
|
||||
rm -f $@
|
||||
|
@ -314,6 +317,10 @@ $(IMPORT_LIBRARY): $(SHARED_LIBRARY)
|
|||
wlib +$(SHARED_LIBRARY)
|
||||
endif
|
||||
|
||||
ifdef SHARED_LIBRARY_LIBS
|
||||
SUB_SHLOBJS = $(foreach dir,$(SHARED_LIBRARY_DIRS),$(addprefix $(dir)/,$(shell $(MAKE) -C $(dir) --no-print-directory get_objs)))
|
||||
endif
|
||||
|
||||
$(SHARED_LIBRARY): $(OBJS)
|
||||
@$(MAKE_OBJDIR)
|
||||
rm -f $@
|
||||
|
@ -344,7 +351,7 @@ else
|
|||
$(LINK_DLL) -MAP $(DLLBASE) $(OBJS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS) $(LD_LIBS)
|
||||
endif
|
||||
else
|
||||
$(MKSHLIB) -o $@ $(OBJS) $(LD_LIBS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS)
|
||||
$(MKSHLIB) -o $@ $(OBJS) $(SUB_SHLOBJS) $(LD_LIBS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS)
|
||||
chmod +x $@
|
||||
endif
|
||||
endif
|
||||
|
|
|
@ -33,11 +33,11 @@
|
|||
CORE_DEPTH = ../..
|
||||
DEPTH = ../..
|
||||
|
||||
DIRS = crmf jar \
|
||||
DIRS = crmf jar pkcs7 \
|
||||
certhigh pk11wrap cryptohi \
|
||||
softoken certdb crypto \
|
||||
util freebl nss pkcs12 fortcrypt \
|
||||
base ckfw pkcs7 smime ssl
|
||||
base ckfw smime ssl
|
||||
#
|
||||
# these dirs are not built at the moment
|
||||
#
|
||||
|
|
|
@ -78,25 +78,37 @@ else
|
|||
|
||||
# $(PROGRAM) has explicit dependencies on $(EXTRA_LIBS)
|
||||
CRYPTOLIB=$(DIST)/lib/libfreebl.$(LIB_SUFFIX)
|
||||
CRYPTODIR=../freebl
|
||||
ifdef MOZILLA_SECURITY_BUILD
|
||||
CRYPTOLIB=$(DIST)/lib/libcrypto.$(LIB_SUFFIX)
|
||||
CRYPTODIR=../crypto
|
||||
endif
|
||||
ifdef MOZILLA_BSAFE_BUILD
|
||||
CRYPTOLIB+=$(DIST)/lib/libbsafe.$(LIB_SUFFIX)
|
||||
CRYPTOLIB+=$(DIST)/lib/libfreebl.$(LIB_SUFFIX)
|
||||
endif
|
||||
EXTRA_LIBS += \
|
||||
SHARED_LIBRARY_LIBS = \
|
||||
$(DIST)/lib/libpkcs7.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/libcerthi.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/libpk11wrap.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/libcryptohi.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/libcerthi.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/libpk11wrap.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/libsoftoken.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/libcertdb.$(LIB_SUFFIX) \
|
||||
$(CRYPTOLIB) \
|
||||
$(DIST)/lib/libsecutil.$(LIB_SUFFIX) \
|
||||
$(NULL)
|
||||
EXTRA_LIBS += \
|
||||
$(DIST)/lib/libdbm.$(LIB_SUFFIX) \
|
||||
$(NULL)
|
||||
ifdef MOZILLA_BSAFE_BUILD
|
||||
EXTRA_LIBS+=$(DIST)/lib/libbsafe.$(LIB_SUFFIX)
|
||||
endif
|
||||
SHARED_LIBRARY_DIRS = \
|
||||
../pkcs7 \
|
||||
../certhigh \
|
||||
../pk11wrap \
|
||||
../cryptohi \
|
||||
../softoken \
|
||||
../certdb \
|
||||
$(CRYPTODIR) \
|
||||
../util \
|
||||
$(NULL)
|
||||
|
||||
# $(PROGRAM) has NO explicit dependencies on $(EXTRA_SHARED_LIBS)
|
||||
# $(EXTRA_SHARED_LIBS) come before $(OS_LIBS), except on AIX.
|
||||
|
@ -108,3 +120,10 @@ EXTRA_SHARED_LIBS += \
|
|||
$(NULL)
|
||||
endif
|
||||
|
||||
#ifeq ($(OS_ARCH),SunOS)
|
||||
#MKSHLIB += -z text -M mapfile
|
||||
#endif
|
||||
|
||||
#ifeq ($(OS_ARCH),Linux)
|
||||
#MKSHLIB += -Wl,--version-script,mapfile
|
||||
#endif
|
||||
|
|
|
@ -40,7 +40,6 @@ MODULE = security
|
|||
|
||||
CSRCS = \
|
||||
nssinit.c \
|
||||
nsssym.c\
|
||||
$(NULL)
|
||||
|
||||
REQUIRES = security dbm
|
||||
|
|
|
@ -48,7 +48,6 @@ ifeq ($(OS_ARCH), WINNT)
|
|||
|
||||
EXTRA_LIBS += \
|
||||
$(DIST)/lib/pkcs12.lib \
|
||||
$(DIST)/lib/pkcs7.lib \
|
||||
$(DIST)/lib/nss3.lib \
|
||||
$(DIST)/lib/$(NSPR31_LIB_PREFIX)plc4.lib \
|
||||
$(DIST)/lib/$(NSPR31_LIB_PREFIX)plds4.lib \
|
||||
|
@ -59,9 +58,12 @@ else
|
|||
|
||||
# $(PROGRAM) has NO explicit dependencies on $(EXTRA_SHARED_LIBS)
|
||||
# $(EXTRA_SHARED_LIBS) come before $(OS_LIBS), except on AIX.
|
||||
EXTRA_LIBS += \
|
||||
SHARED_LIBRARY_LIBS = \
|
||||
$(DIST)/lib/libpkcs12.${LIB_SUFFIX} \
|
||||
$(DIST)/lib/libpkcs7.${LIB_SUFFIX} \
|
||||
$(NULL)
|
||||
|
||||
SHARED_LIBRARY_DIRS = \
|
||||
../pkcs12 \
|
||||
$(NULL)
|
||||
|
||||
EXTRA_SHARED_LIBS += \
|
||||
|
|
|
@ -67,7 +67,6 @@ CSRCS = \
|
|||
cmsutil.c \
|
||||
smimemessage.c \
|
||||
smimeutil.c \
|
||||
smimesym.c \
|
||||
$(NULL)
|
||||
|
||||
REQUIRES = security dbm
|
||||
|
|
Загрузка…
Ссылка в новой задаче