diff options
author | Martin Thomson <martin.thomson@gmail.com> | 2015-10-30 08:03:44 +0900 |
---|---|---|
committer | Martin Thomson <martin.thomson@gmail.com> | 2015-10-30 08:03:44 +0900 |
commit | 7c6171f8a06e9f6ac87d90fd7d5ca043b9a89a1c (patch) | |
tree | 790e19bc0d644af2bce23962e0515d461def5742 /coreconf/Linux.mk | |
parent | 8d8f4cceb3df8c15ed41f268b2eff4c72d9491a7 (diff) | |
download | nss-hg-7c6171f8a06e9f6ac87d90fd7d5ca043b9a89a1c.tar.gz |
Bug 1211568 - Improve performance of build, r=glandium
Diffstat (limited to 'coreconf/Linux.mk')
-rw-r--r-- | coreconf/Linux.mk | 59 |
1 files changed, 3 insertions, 56 deletions
diff --git a/coreconf/Linux.mk b/coreconf/Linux.mk index b3b5e408d..7a2411876 100644 --- a/coreconf/Linux.mk +++ b/coreconf/Linux.mk @@ -4,6 +4,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. include $(CORE_DEPTH)/coreconf/UNIX.mk +include $(CORE_DEPTH)/coreconf/Werror.mk # # The default implementation strategy for Linux is now pthreads @@ -132,70 +133,16 @@ endif endif ifndef COMPILER_TAG -COMPILER_TAG = _$(shell $(CC) -? 2>&1 >/dev/null | sed -e 's/:.*//;1q') -CCC_COMPILER_TAG = _$(shell $(CCC) -? 2>&1 >/dev/null | sed -e 's/:.*//;1q') +COMPILER_TAG := _$(CC_NAME) endif ifeq ($(USE_PTHREADS),1) OS_PTHREAD = -lpthread endif -OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) $(ARCHFLAG) -Wall -pipe -ffunction-sections -fdata-sections -DLINUX -Dlinux -DHAVE_STRERROR +OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) $(ARCHFLAG) $(WARNING_CFLAGS) -pipe -ffunction-sections -fdata-sections -DLINUX -Dlinux -DHAVE_STRERROR OS_LIBS = $(OS_PTHREAD) -ldl -lc -# This tests to see if enabling the warning is possible before -# setting an option to disable it. -disable_warning=$(shell $(CC) -x c -E -Werror -W$(1) /dev/null >/dev/null 2>&1 && echo -Wno-$(1)) - -ifeq ($(COMPILER_TAG),_clang) - # -Qunused-arguments : clang objects to arguments that it doesn't understand - # and fixing this would require rearchitecture - OS_CFLAGS += -Qunused-arguments - # -Wno-parentheses-equality : because clang warns about macro expansions - OS_CFLAGS += $(call disable_warning,parentheses-equality) - ifdef BUILD_OPT - # clang is unable to handle glib's expansion of strcmp and similar for optimized - # builds, so ignore the resulting errors. - # See https://llvm.org/bugs/show_bug.cgi?id=20144 - OS_CFLAGS += $(call disable_warning,array-bounds) - OS_CFLAGS += $(call disable_warning,unevaluated-expression) - endif -endif - -ifndef NSS_ENABLE_WERROR - ifneq ($(OS_TARGET),Android) - # Android lollipop generates the following warning: - # error: call to 'sprintf' declared with attribute warning: - # sprintf is often misused; please use snprintf [-Werror] - # So, just suppress -Werror entirely on Android - NSS_ENABLE_WERROR = 0 - $(warning !!! OS_TARGET is Android, disabling -Werror) - else - ifeq ($(COMPILER_TAG),_clang) - # Clang reports its version as an older gcc, but it's OK - NSS_ENABLE_WERROR = 1 - else - NSS_ENABLE_WERROR := $(shell \ - [ `$(CC) -dumpversion | cut -f 1 -d . -` -eq 4 -a \ - `$(CC) -dumpversion | cut -f 2 -d . -` -ge 8 -o \ - `$(CC) -dumpversion | cut -f 1 -d . -` -ge 5 ] && \ - echo 1 || echo 0) - ifneq ($(NSS_ENABLE_WERROR),1) - $(warning !!! Unable to find gcc 4.8 or greater, disabling -Werror) - endif - endif - endif - export NSS_ENABLE_WERROR -endif - -ifeq (1,$(NSS_ENABLE_WERROR)) - OS_CFLAGS += -Werror -else - # Old versions of gcc (< 4.8) don't support #pragma diagnostic in functions. - # Use this to disable use of that #pragma and the warnings it suppresses. - OS_CFLAGS += -DNSS_NO_GCC48 -endif - ifdef USE_PTHREADS DEFINES += -D_REENTRANT endif |