Bug 389781 NSS should be built size-optimized on Linux, Windows, and Mac

r=julien.pierre.boogz
This commit is contained in:
christophe.ravel.bugs%sun.com 2007-08-15 15:30:08 +00:00
Родитель d89abb6c41
Коммит 5ba34627e5
25 изменённых файлов: 101 добавлений и 10 удалений

Просмотреть файл

@ -104,8 +104,12 @@ endif
OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -Wmost -fpascal-strings -no-cpp-precomp -fno-common -pipe -DDARWIN -DHAVE_STRERROR -DHAVE_BSD_FLOCK $(DARWIN_SDK_CFLAGS)
ifdef BUILD_OPT
ifeq (11,$(ALLOW_OPT_CODE_SIZE)$(OPT_CODE_SIZE))
OPTIMIZER = -Oz
else
OPTIMIZER = -O2
endif
endif
ARCH = darwin

Просмотреть файл

@ -148,8 +148,12 @@ ifeq ($(OS_RELEASE),2.0)
endif
ifdef BUILD_OPT
ifeq (11,$(ALLOW_OPT_CODE_SIZE)$(OPT_CODE_SIZE))
OPTIMIZER = -Os
else
OPTIMIZER = -O2
endif
endif
ifeq ($(USE_PTHREADS),1)
OS_PTHREAD = -lpthread

Просмотреть файл

@ -97,7 +97,11 @@ ifdef NS_USE_GCC
_GEN_IMPORT_LIB=-Wl,--out-implib,$(IMPORT_LIBRARY)
DLLFLAGS += -mno-cygwin -o $@ -shared -Wl,--export-all-symbols $(if $(IMPORT_LIBRARY),$(_GEN_IMPORT_LIB))
ifdef BUILD_OPT
ifeq (11,$(ALLOW_OPT_CODE_SIZE)$(OPT_CODE_SIZE))
OPTIMIZER += -Os
else
OPTIMIZER += -O2
endif
DEFINES += -UDEBUG -U_DEBUG -DNDEBUG
#
# Add symbolic information for a profiler
@ -116,7 +120,11 @@ ifdef NS_USE_GCC
else # !NS_USE_GCC
ifdef BUILD_OPT
OS_CFLAGS += -MD
ifeq (11,$(ALLOW_OPT_CODE_SIZE)$(OPT_CODE_SIZE))
OPTIMIZER += -O1
else
OPTIMIZER += -O2
endif
DEFINES += -UDEBUG -U_DEBUG -DNDEBUG
DLLFLAGS += -OUT:"$@"
#

Просмотреть файл

@ -56,4 +56,21 @@ TAR = /bin/tar
NOMD_CFLAGS += $(OPTIMIZER) $(NOMD_OS_CFLAGS) $(XP_DEFINE) $(DEFINES) \
$(INCLUDES) $(XCFLAGS)
# Optimization of code for size
# OPT_CODE_SIZE
# =1: The code can be optimized for size.
# The code is actually optimized for size only if ALLOW_OPT_CODE_SIZE=1
# in a given source code directory (in manifest.mn)
# =0: Never optimize the code for size.
#
# Default value = 0 unless MOZILLA_SECURITY_BUILD is defined.
# Can be overwritten from the make command line.
ifndef OPT_CODE_SIZE
ifdef MOZILLA_SECURITY_BUILD
OPT_CODE_SIZE = 1
else
OPT_CODE_SIZE = 0
endif
endif
MK_COMMAND = included

Просмотреть файл

@ -34,7 +34,7 @@
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
MANIFEST_CVS_ID = "@(#) $RCSfile: manifest.mn,v $ $Revision: 1.5 $ $Date: 2005-01-20 02:25:44 $"
MANIFEST_CVS_ID = "@(#) $RCSfile: manifest.mn,v $ $Revision: 1.6 $ $Date: 2007-08-15 15:29:49 $"
CORE_DEPTH = ../../..
@ -57,3 +57,6 @@ CSRCS = \
REQUIRES = nspr
LIBRARY_NAME = asn1
# This part of the code, including all sub-dirs, can be optimized for size
export ALLOW_OPT_CODE_SIZE = 1

Просмотреть файл

@ -34,7 +34,7 @@
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
MANIFEST_CVS_ID = "@(#) $RCSfile: manifest.mn,v $ $Revision: 1.9 $ $Date: 2005-12-19 17:53:28 $"
MANIFEST_CVS_ID = "@(#) $RCSfile: manifest.mn,v $ $Revision: 1.10 $ $Date: 2007-08-15 15:29:50 $"
CORE_DEPTH = ../../..
@ -66,3 +66,6 @@ CSRCS = \
REQUIRES = nspr
LIBRARY_NAME = nssb
# This part of the code, including all sub-dirs, can be optimized for size
export ALLOW_OPT_CODE_SIZE = 1

Просмотреть файл

@ -70,3 +70,5 @@ REQUIRES = dbm
LIBRARY_NAME = certdb
# This part of the code, including all sub-dirs, can be optimized for size
export ALLOW_OPT_CODE_SIZE = 1

Просмотреть файл

@ -62,3 +62,5 @@ REQUIRES = dbm
LIBRARY_NAME = certhi
# This part of the code, including all sub-dirs, can be optimized for size
export ALLOW_OPT_CODE_SIZE = 1

Просмотреть файл

@ -34,7 +34,7 @@
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
MANIFEST_CVS_ID = "@(#) $RCSfile: manifest.mn,v $ $Revision: 1.9 $ $Date: 2005-12-16 00:48:01 $"
MANIFEST_CVS_ID = "@(#) $RCSfile: manifest.mn,v $ $Revision: 1.10 $ $Date: 2007-08-15 15:29:52 $"
CORE_DEPTH = ../../..
@ -81,3 +81,6 @@ CSRCS = \
REQUIRES = nspr
LIBRARY_NAME = nssckfw
# This part of the code, including all sub-dirs, can be optimized for size
export ALLOW_OPT_CODE_SIZE = 1

Просмотреть файл

@ -73,3 +73,6 @@ CSRCS = crmfenc.c \
$(NULL)
LIBRARY_NAME = crmf
# This part of the code, including all sub-dirs, can be optimized for size
export ALLOW_OPT_CODE_SIZE = 1

Просмотреть файл

@ -65,3 +65,6 @@ LIBSRCS = \
$(NULL)
CSRCS = $(LIBSRCS)
# This part of the code, including all sub-dirs, can be optimized for size
export ALLOW_OPT_CODE_SIZE = 1

Просмотреть файл

@ -34,7 +34,7 @@
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
MANIFEST_CVS_ID = "@(#) $RCSfile: manifest.mn,v $ $Revision: 1.11 $ $Date: 2005-01-20 02:25:47 $"
MANIFEST_CVS_ID = "@(#) $RCSfile: manifest.mn,v $ $Revision: 1.12 $ $Date: 2007-08-15 15:29:54 $"
CORE_DEPTH = ../../..
@ -68,3 +68,6 @@ endif
REQUIRES = nspr
LIBRARY_NAME = nssdev
# This part of the code, including all sub-dirs, can be optimized for size
export ALLOW_OPT_CODE_SIZE = 1

Просмотреть файл

@ -55,3 +55,6 @@ REQUIRES = dbm
EXPORTS = jar.h jar-ds.h jarfile.h
DEFINES = -DMOZILLA_CLIENT=1
# This part of the code, including all sub-dirs, can be optimized for size
export ALLOW_OPT_CODE_SIZE = 1

Просмотреть файл

@ -41,3 +41,5 @@ DEPTH = ../../..
DIRS = include pkix pkix_pl_nss \
$(NULL)
# This part of the code, including all sub-dirs, can be optimized for size
export ALLOW_OPT_CODE_SIZE = 1

Просмотреть файл

@ -57,3 +57,6 @@ MAPFILE = $(OBJDIR)/nss.def
LIBRARY_NAME = nss
LIBRARY_VERSION = 3
# This part of the code, including all sub-dirs, can be optimized for size
export ALLOW_OPT_CODE_SIZE = 1

Просмотреть файл

@ -92,3 +92,6 @@ DEFINES += -DSHLIB_SUFFIX=\"$(DLL_SUFFIX)\" -DSHLIB_PREFIX=\"$(DLL_PREFIX)\" \
ifdef DEBUG_PKCS11
DEFINES += -DDEBUG_MODULE -DFORCE_PR_LOG
endif
# This part of the code, including all sub-dirs, can be optimized for size
export ALLOW_OPT_CODE_SIZE = 1

Просмотреть файл

@ -60,3 +60,6 @@ CSRCS = \
REQUIRES = dbm
LIBRARY_NAME = pkcs12
# This part of the code, including all sub-dirs, can be optimized for size
export ALLOW_OPT_CODE_SIZE = 1

Просмотреть файл

@ -62,3 +62,6 @@ CSRCS = \
REQUIRES = dbm
LIBRARY_NAME = pkcs7
# This part of the code, including all sub-dirs, can be optimized for size
export ALLOW_OPT_CODE_SIZE = 1

Просмотреть файл

@ -34,7 +34,7 @@
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
MANIFEST_CVS_ID = "@(#) $RCSfile: manifest.mn,v $ $Revision: 1.14 $ $Date: 2005-01-20 02:25:49 $"
MANIFEST_CVS_ID = "@(#) $RCSfile: manifest.mn,v $ $Revision: 1.15 $ $Date: 2007-08-15 15:30:01 $"
CORE_DEPTH = ../../..
@ -73,3 +73,6 @@ REQUIRES = nspr
LIBRARY_NAME = nsspki
LIBRARY_VERSION = 3
# This part of the code, including all sub-dirs, can be optimized for size
export ALLOW_OPT_CODE_SIZE = 1

Просмотреть файл

@ -34,7 +34,7 @@
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
MANIFEST_CVS_ID = "@(#) $RCSfile: manifest.mn,v $ $Revision: 1.9 $ $Date: 2005-01-20 02:25:49 $"
MANIFEST_CVS_ID = "@(#) $RCSfile: manifest.mn,v $ $Revision: 1.10 $ $Date: 2007-08-15 15:30:02 $"
CORE_DEPTH = ../../..
@ -67,3 +67,6 @@ xCSRCS = \
REQUIRES = nspr
#LIBRARY_NAME = pki1
# This part of the code, including all sub-dirs, can be optimized for size
export ALLOW_OPT_CODE_SIZE = 1

Просмотреть файл

@ -79,3 +79,6 @@ REQUIRES = dbm
LIBRARY_NAME = smime
LIBRARY_VERSION = 3
# This part of the code, including all sub-dirs, can be optimized for size
export ALLOW_OPT_CODE_SIZE = 1

Просмотреть файл

@ -97,3 +97,5 @@ ifdef SQLITE_UNSAFE_THREADS
DEFINES += -DSQLITE_UNSAFE_THREADS
endif
# This part of the code, including all sub-dirs, can be optimized for size
export ALLOW_OPT_CODE_SIZE = 1

Просмотреть файл

@ -61,3 +61,6 @@ CSRCS = \
ifdef DEBUG_PKCS11
DEFINES += -DDEBUG_MODULE
endif
# This part of the code, including all sub-dirs, can be optimized for size
export ALLOW_OPT_CODE_SIZE = 1

Просмотреть файл

@ -83,3 +83,5 @@ CSRCS = \
LIBRARY_NAME = ssl
LIBRARY_VERSION = 3
# This part of the code, including all sub-dirs, can be optimized for size
export ALLOW_OPT_CODE_SIZE = 1

Просмотреть файл

@ -99,3 +99,6 @@ MODULE = nss
REQUIRES = dbm
LIBRARY_NAME = secutil
# This part of the code, including all sub-dirs, can be optimized for size
export ALLOW_OPT_CODE_SIZE = 1