summaryrefslogtreecommitdiff
path: root/nss/coreconf/Linux.mk
diff options
context:
space:
mode:
Diffstat (limited to 'nss/coreconf/Linux.mk')
-rw-r--r--nss/coreconf/Linux.mk23
1 files changed, 17 insertions, 6 deletions
diff --git a/nss/coreconf/Linux.mk b/nss/coreconf/Linux.mk
index 7a24118..438dab4 100644
--- a/nss/coreconf/Linux.mk
+++ b/nss/coreconf/Linux.mk
@@ -3,8 +3,11 @@
# 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/.
+CC ?= gcc
+CCC ?= g++
+RANLIB ?= ranlib
+
include $(CORE_DEPTH)/coreconf/UNIX.mk
-include $(CORE_DEPTH)/coreconf/Werror.mk
#
# The default implementation strategy for Linux is now pthreads
@@ -17,10 +20,6 @@ ifeq ($(USE_PTHREADS),1)
IMPL_STRATEGY = _PTH
endif
-CC = gcc
-CCC = g++
-RANLIB = ranlib
-
DEFAULT_COMPILER = gcc
ifeq ($(OS_TARGET),Android)
@@ -140,7 +139,7 @@ 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
@@ -154,8 +153,12 @@ DSO_LDOPTS = -shared $(ARCHFLAG) -Wl,--gc-sections
# The linker on Red Hat Linux 7.2 and RHEL 2.1 (GNU ld version 2.11.90.0.8)
# incorrectly reports undefined references in the libraries we link with, so
# we don't use -z defs there.
+# Also, -z defs conflicts with Address Sanitizer, which emits relocations
+# against the libsanitizer runtime built into the main executable.
ZDEFS_FLAG = -Wl,-z,defs
+ifneq ($(USE_ASAN),1)
DSO_LDOPTS += $(if $(findstring 2.11.90.0.8,$(shell ld -v)),,$(ZDEFS_FLAG))
+endif
LDFLAGS += $(ARCHFLAG)
# On Maemo, we need to use the -rpath-link flag for even the standard system
@@ -211,3 +214,11 @@ PROCESS_MAP_FILE = grep -v ';-' $< | \
ifeq ($(OS_RELEASE),2.4)
DEFINES += -DNO_FORK_CHECK
endif
+
+ifdef USE_GCOV
+OS_CFLAGS += --coverage
+LDFLAGS += --coverage
+DSO_LDOPTS += --coverage
+endif
+
+include $(CORE_DEPTH)/coreconf/sanitizers.mk