1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
|
# HG changeset patch
# User Martin Thomson <martin.thomson@gmail.com>
# Date 1451888957 -39600
# Mon Jan 04 17:29:17 2016 +1100
# Node ID 7b4febd4ad04d5ffe8858a342f23cff58928ce10
# Parent afa3eeff3ca6fed718fb29324368a026fbe8ffd8
Bug 1226179 - Using -Werror on all unix platforms, r?gaston
diff --git a/coreconf/Darwin.mk b/coreconf/Darwin.mk
--- coreconf/Darwin.mk
+++ coreconf/Darwin.mk
@@ -77,17 +77,17 @@ endif
# The meaning of a common is ambiguous. It may be a true definition:
# int x = 0;
# or it may be a declaration of a symbol defined in another file:
# extern int x;
# Use the -fno-common option to force all commons to become true
# definitions so that the linker can catch multiply-defined symbols.
# Also, common symbols are not allowed with Darwin dynamic libraries.
-OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) $(WARNING_CFLAGS) -fno-common -pipe -DDARWIN -DHAVE_STRERROR -DHAVE_BSD_FLOCK $(DARWIN_SDK_CFLAGS)
+OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) -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
ifdef MOZ_DEBUG_SYMBOLS
diff --git a/coreconf/Linux.mk b/coreconf/Linux.mk
--- coreconf/Linux.mk
+++ coreconf/Linux.mk
@@ -1,15 +1,14 @@
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# 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
#
ifneq ($(OS_TARGET),Android)
USE_PTHREADS = 1
endif
@@ -135,17 +134,17 @@ endif
ifndef COMPILER_TAG
COMPILER_TAG := _$(CC_NAME)
endif
ifeq ($(USE_PTHREADS),1)
OS_PTHREAD = -lpthread
endif
-OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) $(ARCHFLAG) $(WARNING_CFLAGS) -pipe -ffunction-sections -fdata-sections -DLINUX -Dlinux -DHAVE_STRERROR
+OS_CFLAGS = $(DSO_CFLAGS) $(OS_REL_CFLAGS) $(ARCHFLAG) -pipe -ffunction-sections -fdata-sections -DLINUX -Dlinux -DHAVE_STRERROR
OS_LIBS = $(OS_PTHREAD) -ldl -lc
ifdef USE_PTHREADS
DEFINES += -D_REENTRANT
endif
ARCH = linux
diff --git a/coreconf/UNIX.mk b/coreconf/UNIX.mk
--- coreconf/UNIX.mk
+++ coreconf/UNIX.mk
@@ -57,8 +57,10 @@ else
INSTALL = $(NSINSTALL)
INSTALL += -R
endif
endif
define MAKE_OBJDIR
if test ! -d $(@D); then rm -rf $(@D); $(NSINSTALL) -D $(@D); fi
endef
+
+include $(CORE_DEPTH)/coreconf/Werror.mk
diff --git a/coreconf/WIN32.mk b/coreconf/WIN32.mk
--- coreconf/WIN32.mk
+++ coreconf/WIN32.mk
@@ -118,24 +118,24 @@ ifdef NS_USE_GCC
OPTIMIZER += -g
NULLSTRING :=
SPACE := $(NULLSTRING) # end of the line
USERNAME := $(subst $(SPACE),_,$(USERNAME))
USERNAME := $(subst -,_,$(USERNAME))
DEFINES += -DDEBUG -UNDEBUG -DDEBUG_$(USERNAME)
endif
else # !NS_USE_GCC
- OS_CFLAGS += -W3 -nologo -D_CRT_SECURE_NO_WARNINGS \
- -D_CRT_NONSTDC_NO_WARNINGS
+ WARNING_CFLAGS = -W3 -nologo -D_CRT_SECURE_NO_WARNINGS \
+ -D_CRT_NONSTDC_NO_WARNINGS
OS_DLLFLAGS += -nologo -DLL -SUBSYSTEM:WINDOWS
ifndef NSS_ENABLE_WERROR
NSS_ENABLE_WERROR = 1
endif
ifeq ($(NSS_ENABLE_WERROR),1)
- OS_CFLAGS += -WX
+ WARNING_CFLAGS += -WX
endif
ifeq ($(_MSC_VER),$(_MSC_VER_6))
ifndef MOZ_DEBUG_SYMBOLS
OS_DLLFLAGS += -PDB:NONE
endif
endif
ifdef USE_DYNAMICBASE
OS_DLLFLAGS += -DYNAMICBASE
diff --git a/coreconf/Werror.mk b/coreconf/Werror.mk
--- coreconf/Werror.mk
+++ coreconf/Werror.mk
@@ -1,14 +1,14 @@
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-# This sets warning flags for unix-like operating systems.
+# This sets WARNING_CFLAGS for unix-like operating systems.
ifndef CC_NAME
CC_NAME := $(shell $(CC) -? 2>&1 >/dev/null | sed -e 's/:.*//;1q')
export CC_NAME
endif
ifndef WARNING_CFLAGS
# This tests to see if enabling the warning is possible before
diff --git a/coreconf/command.mk b/coreconf/command.mk
--- coreconf/command.mk
+++ coreconf/command.mk
@@ -7,18 +7,18 @@
# Master "Core Components" default command macros; #
# can be overridden in <arch>.mk #
#######################################################################
AS = $(CC)
ASFLAGS += $(CFLAGS)
CCF = $(CC) $(CFLAGS)
LINK_DLL = $(LINK) $(OS_DLLFLAGS) $(DLLFLAGS) $(XLDFLAGS)
-CFLAGS = $(OPTIMIZER) $(OS_CFLAGS) $(XP_DEFINE) $(DEFINES) $(INCLUDES) \
- $(XCFLAGS)
+CFLAGS = $(OPTIMIZER) $(OS_CFLAGS) $(WARNING_CFLAGS) $(XP_DEFINE) \
+ $(DEFINES) $(INCLUDES) $(XCFLAGS)
PERL = perl
RANLIB = echo
TAR = /bin/tar
#
# For purify
#
NOMD_CFLAGS += $(OPTIMIZER) $(NOMD_OS_CFLAGS) $(XP_DEFINE) $(DEFINES) \
$(INCLUDES) $(XCFLAGS)
|