diff options
author | Jed Davis <jld@mozilla.com> | 2016-02-27 14:05:04 -0800 |
---|---|---|
committer | Jed Davis <jld@mozilla.com> | 2016-02-27 14:05:04 -0800 |
commit | 811ab1ca4c2ebddf3f79d4c63199e8c9aa44c8d0 (patch) | |
tree | 349330006517830f3087968a070c6fba48583fe4 /Makefile | |
parent | ea083b0c8c0d62b88324b76c66c7cda78289843d (diff) | |
download | nss-hg-811ab1ca4c2ebddf3f79d4c63199e8c9aa44c8d0.tar.gz |
Bug 1233568: Add support for building with Address Sanitizer. r=wtc.
This is controlled by setting USE_ASAN=1 when building. Like the other
build flags, it must also be set while testing.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -83,7 +83,16 @@ ifdef USE_STATIC_RTL NSPR_CONFIGURE_OPTS += --enable-static-rtl endif ifdef NS_USE_GCC -NSPR_COMPILERS = CC=gcc CXX=g++ +NSPR_CONFIGURE_ENV = CC=gcc CXX=g++ +endif + +ifdef SANITIZER_CFLAGS +ifdef BUILD_OPT +NSPR_CONFIGURE_OPTS += --enable-debug-symbols +endif +NSPR_CONFIGURE_ENV += CFLAGS='$(SANITIZER_CFLAGS)' \ + CXXFLAGS='$(SANITIZER_CFLAGS)' \ + LDFLAGS='$(SANITIZER_LFLAGS)' endif # @@ -110,7 +119,7 @@ endif $(NSPR_CONFIG_STATUS): $(NSPR_CONFIGURE) mkdir -p $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME) cd $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME) ; \ - $(NSPR_COMPILERS) sh ../configure \ + $(NSPR_CONFIGURE_ENV) sh ../configure \ $(NSPR_CONFIGURE_OPTS) \ --with-dist-prefix='$(NSPR_PREFIX)' \ --with-dist-includedir='$(NSPR_PREFIX)/include' |