Skip to content

Commit

Permalink
Bug 1336087 - Remove USE_ASAN and other sanitizers from Makefile buil…
Browse files Browse the repository at this point in the history
…d system r=franziskus

Differential Revision: https://nss-review.dev.mozaws.net/D186

--HG--
extra : amend_source : f7ad58f414a2b17c06ba2799933341bd95a75945
  • Loading branch information
Tim Taubert committed Feb 3, 2017
1 parent 23d77df commit cf588f5
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 84 deletions.
9 changes: 0 additions & 9 deletions Makefile
Expand Up @@ -96,15 +96,6 @@ NSPR_CONFIGURE_ENV := $(filter-out -arch x86_64,$(NSPR_CONFIGURE_ENV))
NSPR_CONFIGURE_ENV := $(filter-out -arch i386,$(NSPR_CONFIGURE_ENV))
NSPR_CONFIGURE_ENV := $(filter-out -arch ppc,$(NSPR_CONFIGURE_ENV))

ifdef SANITIZER_CFLAGS
ifdef BUILD_OPT
NSPR_CONFIGURE_OPTS += --enable-debug-symbols
endif
NSPR_CONFIGURE_ENV += CFLAGS='$(SANITIZER_CFLAGS)' \
CXXFLAGS='$(SANITIZER_CFLAGS)' \
LDFLAGS='$(SANITIZER_LDFLAGS)'
endif

#
# Some pwd commands on Windows (for example, the pwd
# command in Cygwin) return a pathname that begins
Expand Down
25 changes: 4 additions & 21 deletions automation/taskcluster/graph/src/extend.js
Expand Up @@ -18,8 +18,7 @@ const WINDOWS_CHECKOUT_CMD =
queue.filter(task => {
if (task.group == "Builds") {
// Remove extra builds on {A,UB}San and ARM.
if (task.collection == "asan" || task.collection == "arm-debug" ||
task.collection == "gyp-asan") {
if (task.collection == "asan" || task.collection == "arm-debug") {
return false;
}

Expand Down Expand Up @@ -48,7 +47,7 @@ queue.filter(task => {
}

// GYP builds with -Ddisable_libpkix=1 by default.
if ((task.collection == "gyp" || task.collection == "gyp-asan") &&
if ((task.collection == "gyp" || task.collection == "asan") &&
task.tests == "chains") {
return false;
}
Expand All @@ -57,7 +56,7 @@ queue.filter(task => {
});

queue.map(task => {
if (task.collection == "asan" || task.collection == "gyp-asan") {
if (task.collection == "asan") {
// CRMF and FIPS tests still leak, unfortunately.
if (task.tests == "crmf" || task.tests == "fips") {
task.env.ASAN_OPTIONS = "detect_leaks=0";
Expand Down Expand Up @@ -118,34 +117,18 @@ export default async function main() {
image: LINUX_IMAGE
});

await scheduleLinux("Linux 64 (debug, gyp, asan, ubsan)", {
await scheduleLinux("Linux 64 (GYP, ASan, debug)", {
command: [
"/bin/bash",
"-c",
"bin/checkout.sh && nss/automation/taskcluster/scripts/build_gyp.sh -g -v --ubsan --asan"
],
env: {
UBSAN_OPTIONS: "print_stacktrace=1",
NSS_DISABLE_ARENA_FREE_LIST: "1",
NSS_DISABLE_UNLOAD: "1",
CC: "clang",
CCC: "clang++"
},
platform: "linux64",
collection: "gyp-asan",
image: LINUX_IMAGE
});

await scheduleLinux("Linux 64 (ASan, debug)", {
env: {
UBSAN_OPTIONS: "print_stacktrace=1",
NSS_DISABLE_ARENA_FREE_LIST: "1",
NSS_DISABLE_UNLOAD: "1",
CC: "clang",
CCC: "clang++",
USE_UBSAN: "1",
USE_ASAN: "1",
USE_64: "1"
},
platform: "linux64",
collection: "asan",
Expand Down
5 changes: 1 addition & 4 deletions automation/taskcluster/graph/src/try_syntax.js
Expand Up @@ -23,7 +23,7 @@ function parseOptions(opts) {

// Parse platforms.
let allPlatforms = ["linux", "linux64", "linux64-asan", "win64", "arm",
"linux64-gyp", "linux64-gyp-asan", "linux64-fuzz"];
"linux64-gyp", "linux64-fuzz"];
let platforms = intersect(opts.platform.split(/\s*,\s*/), allPlatforms);

// If the given value is nonsense or "none" default to all platforms.
Expand Down Expand Up @@ -108,7 +108,6 @@ function filter(opts) {
"linux64-asan": "linux64",
"linux64-fuzz": "linux64",
"linux64-gyp": "linux64",
"linux64-gyp-asan": "linux64",
"win64": "windows2012-64",
"arm": "linux32"
};
Expand All @@ -123,8 +122,6 @@ function filter(opts) {
keep &= coll("arm-opt") || coll("arm-debug");
} else if (platform == "linux64-gyp") {
keep &= coll("gyp");
} else if (platform == "linux64-gyp-asan") {
keep &= coll("gyp-asan");
} else if (platform == "linux64-fuzz") {
keep &= coll("fuzz");
} else {
Expand Down
3 changes: 0 additions & 3 deletions coreconf/Darwin.mk
Expand Up @@ -145,6 +145,3 @@ ifeq (3,$(SYS_SQLITE3_VERSION_MAJOR))
NSS_USE_SYSTEM_SQLITE = 1
endif
endif

include $(CORE_DEPTH)/coreconf/sanitizers.mk
DARWIN_SDK_SHLIBFLAGS += $(SANITIZER_LDFLAGS)
4 changes: 0 additions & 4 deletions coreconf/Linux.mk
Expand Up @@ -147,9 +147,7 @@ DSO_LDOPTS = -shared $(ARCHFLAG) -Wl,--gc-sections
# 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
Expand Down Expand Up @@ -209,5 +207,3 @@ OS_CFLAGS += --coverage
LDFLAGS += --coverage
DSO_LDOPTS += --coverage
endif

include $(CORE_DEPTH)/coreconf/sanitizers.mk
9 changes: 2 additions & 7 deletions coreconf/arch.mk
Expand Up @@ -12,7 +12,7 @@
# OS_TARGET User defined, or set to OS_ARCH
# CPU_ARCH (from unmame -m or -p, ONLY on WINNT)
# OS_CONFIG OS_TARGET + OS_RELEASE
# OBJDIR_TAG (uses ASAN_TAG, GCOV_TAG, 64BIT_TAG)
# OBJDIR_TAG (uses GCOV_TAG, 64BIT_TAG)
# OBJDIR_NAME
#######################################################################

Expand Down Expand Up @@ -268,11 +268,6 @@ OS_CONFIG = $(OS_TARGET)$(OS_RELEASE)
# to distinguish between debug and release builds.
#

ifeq ($(USE_ASAN), 1)
ASAN_TAG = _ASAN
else
ASAN_TAG =
endif
ifeq ($(USE_GCOV), 1)
GCOV_TAG = _GCOV
else
Expand All @@ -283,7 +278,7 @@ ifeq ($(USE_64), 1)
else
64BIT_TAG =
endif
OBJDIR_TAG_BASE=$(ASAN_TAG)$(GCOV_TAG)$(64BIT_TAG)
OBJDIR_TAG_BASE=$(GCOV_TAG)$(64BIT_TAG)

ifdef BUILD_OPT
OBJDIR_TAG = $(OBJDIR_TAG_BASE)_OPT
Expand Down
35 changes: 0 additions & 35 deletions coreconf/sanitizers.mk

This file was deleted.

1 change: 0 additions & 1 deletion tests/all.sh
Expand Up @@ -62,7 +62,6 @@
# -------------------------------------------------------
# BUILT_OPT - use optimized/debug build
# USE_64 - use 64bit/32bit build
# USE_ASAN - use Address Sanitizer build
#
# Optional environment variables to enable specific NSS features:
# ---------------------------------------------------------------
Expand Down

0 comments on commit cf588f5

Please sign in to comment.