summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJafar Al-Gharaibeh <Jafaral@users.noreply.github.com>2018-06-12 18:11:55 +0200
committerGitHub <noreply@github.com>2018-06-12 18:11:55 +0200
commite789c0337cd587e904a400fdcec686d1e2394905 (patch)
treedd3f685d59d3019691d8aa89369ebe786bdd76ba
parentMerge pull request #2379 from qlyoung/docuser (diff)
parent*: disable all sanitizers for clippy build (diff)
downloadfrr-e789c0337cd587e904a400fdcec686d1e2394905.tar.xz
frr-e789c0337cd587e904a400fdcec686d1e2394905.zip
Merge pull request #2402 from qlyoung/germx-hand-sanitizer-kills-99-percent-of-germs
*: disable all sanitizers for clippy build
-rw-r--r--Makefile.am3
-rw-r--r--bgpd/Makefile.am4
-rw-r--r--common.am7
-rwxr-xr-xconfigure.ac18
-rw-r--r--lib/subdir.am6
-rw-r--r--tools/lsan-suppressions.txt6
-rw-r--r--vtysh/Makefile.am5
7 files changed, 23 insertions, 26 deletions
diff --git a/Makefile.am b/Makefile.am
index df03da3b6..5dc80b498 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,9 +3,8 @@
AUTOMAKE_OPTIONS = subdir-objects 1.12
include common.am
-AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/include -I$(top_srcdir)/lib \
+AM_CPPFLAGS += -I$(top_srcdir) -I$(top_srcdir)/include -I$(top_srcdir)/lib \
-I$(top_builddir) -I$(top_builddir)/include -I$(top_builddir)/lib
-AM_CFLAGS = $(WERROR)
VERSION_TYPE := $(shell if echo $(VERSION) | grep -q '^[0-9\.]*$$'; then echo RELEASE ; else echo DEV ; fi)
DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\" -DCONFDATE=$(CONFDATE) -DVERSION_TYPE_$(VERSION_TYPE)
LIBCAP = @LIBCAP@
diff --git a/bgpd/Makefile.am b/bgpd/Makefile.am
index 676138910..3880d2020 100644
--- a/bgpd/Makefile.am
+++ b/bgpd/Makefile.am
@@ -61,13 +61,11 @@ BGP_VNC_RFP_HD=
BGP_VNC_RFP_LD_FLAGS=
endif
-AM_CPPFLAGS = -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib \
+AM_CPPFLAGS += -I.. -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib \
$(BGP_VNC_RFAPI_INC) $(BGP_VNC_RFP_INC)
DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\"
INSTALL_SDATA=@INSTALL@ -m 600
-AM_CFLAGS = $(WERROR)
-
noinst_LIBRARIES = libbgp.a
module_LTLIBRARIES =
sbin_PROGRAMS = bgpd
diff --git a/common.am b/common.am
index a52e83119..73f36eed1 100644
--- a/common.am
+++ b/common.am
@@ -1,20 +1,21 @@
#
# Automake fragment intended to be shared by Makefile.am files in the
-# tree.
+# tree. When used, should be included at the very top of the file.
#
+AM_CPPFLAGS = @ASAN_FLAGS@ @TSAN_FLAGS@ @MSAN_FLAGS@ @WERROR@
+AM_CFLAGS = @ASAN_FLAGS@ @TSAN_FLAGS@ @MSAN_FLAGS@ @WERROR@
AM_V_CLIPPY = $(am__v_CLIPPY_$(V))
am__v_CLIPPY_ = $(am__v_CLIPPY_$(AM_DEFAULT_VERBOSITY))
am__v_CLIPPY_0 = @echo " CLIPPY " $@;
am__v_CLIPPY_1 =
-CLIPPY_SUPPRESSIONS = LSAN_OPTIONS="suppressions=$(top_builddir)/tools/lsan-suppressions.txt"
CLIPPY_DEPS = $(HOSTTOOLS)lib/clippy $(top_srcdir)/python/clidef.py
SUFFIXES = _clippy.c .proto .pb-c.c .pb-c.h .pb.h
.c_clippy.c:
@{ test -x $(top_builddir)/$(HOSTTOOLS)lib/clippy || $(MAKE) -C $(top_builddir)/$(HOSTTOOLS) lib/clippy; }
- $(AM_V_CLIPPY) $(CLIPPY_SUPPRESSIONS) $(top_builddir)/$(HOSTTOOLS)lib/clippy $(top_srcdir)/python/clidef.py -o $@ $<
+ $(AM_V_CLIPPY) $(top_builddir)/$(HOSTTOOLS)lib/clippy $(top_srcdir)/python/clidef.py -o $@ $<
## automake's "ylwrap" is a great piece of GNU software... not.
.l.c:
diff --git a/configure.ac b/configure.ac
index 35997a87e..3ec29cc38 100755
--- a/configure.ac
+++ b/configure.ac
@@ -190,8 +190,10 @@ AC_ARG_ENABLE([address-sanitizer], AS_HELP_STRING([--enable-address-sanitizer],
[enabled AddressSanitizer support for detecting a wide variety of \
memory allocation and deallocation errors]), \
[AC_DEFINE(HAVE_ADDRESS_SANITIZER, 1, [enable AddressSanitizer])
- CFLAGS="$CFLAGS -fsanitize=address"
- CXXFLAGS="$CXXFLAGS -fsanitize=address"
+ ASAN_FLAGS="-fsanitize=address"
+ SAN_CLIPPY_FLAGS="-fno-sanitize=all"
+ AC_SUBST([ASAN_FLAGS])
+ AC_SUBST([SAN_CLIPPY_FLAGS])
LIBS="-ldl $LIBS"
AC_TRY_COMPILE([],[const int i=0;],[AC_MSG_NOTICE([Address Sanitizer Enabled])],
[AC_MSG_ERROR([Address Sanitizer not available])])
@@ -201,8 +203,10 @@ dnl ThreadSanitizer support
AC_ARG_ENABLE([thread-sanitizer], AS_HELP_STRING([--enable-thread-sanitizer], \
[enabled ThreadSanitizer support for detecting data races]), \
[AC_DEFINE(HAVE_THREAD_SANITIZER, 1, [enable ThreadSanitizer])
- CFLAGS="$CFLAGS -fsanitize=thread"
- CXXFLAGS="$CXXFLAGS -fsanitize=thread"
+ TSAN_FLAGS="-fsanitize=thread"
+ SAN_CLIPPY_FLAGS="-fno-sanitize=all"
+ AC_SUBST([TSAN_FLAGS])
+ AC_SUBST([SAN_CLIPPY_FLAGS])
LIBS="-ldl $LIBS"
AC_TRY_COMPILE([],[const int i=0;],[AC_MSG_NOTICE([Thread Sanitizer Enabled])],
[AC_MSG_ERROR([Thread Sanitizer not available])])
@@ -212,8 +216,10 @@ dnl MemorySanitizer support
AC_ARG_ENABLE([memory-sanitizer], AS_HELP_STRING([--enable-memory-sanitizer], \
[enabled MemorySanitizer support for detecting uninitialized memory reads]), \
[AC_DEFINE(HAVE_THREAD_SANITIZER, 1, [enable MemorySanitizer])
- CFLAGS="$CFLAGS -fsanitize=memory -fPIE -pie"
- CXXFLAGS="$CXXFLAGS -fsanitize=memory -fPIE -pie"
+ MSAN_FLAGS="-fsanitize=memory -fPIE -pie"
+ SAN_CLIPPY_FLAGS="-fno-sanitize=all"
+ AC_SUBST([MSAN_FLAGS])
+ AC_SUBST([SAN_CLIPPY_FLAGS])
LIBS="-ldl $LIBS"
AC_TRY_COMPILE([],[const int i=0;],[AC_MSG_NOTICE([Memory Sanitizer Enabled])],
[AC_MSG_ERROR([Memory Sanitizer not available])])
diff --git a/lib/subdir.am b/lib/subdir.am
index c7ff35cc5..9472fabe1 100644
--- a/lib/subdir.am
+++ b/lib/subdir.am
@@ -2,7 +2,7 @@
# libfrr
#
lib_LTLIBRARIES += lib/libfrr.la
-lib_libfrr_la_LDFLAGS = -version-info 0:0:0
+lib_libfrr_la_LDFLAGS = -version-info 0:0:0
lib_libfrr_la_LIBADD = @LIBCAP@
lib_libfrr_la_SOURCES = \
@@ -235,8 +235,8 @@ lib_grammar_sandbox_SOURCES = \
lib_grammar_sandbox_LDADD = \
lib/libfrr.la
-lib_clippy_CPPFLAGS = $(AM_CPPFLAGS) -D_GNU_SOURCE -DBUILDING_CLIPPY
-lib_clippy_CFLAGS = $(PYTHON_CFLAGS)
+lib_clippy_CPPFLAGS = $(AM_CPPFLAGS) -D_GNU_SOURCE -DBUILDING_CLIPPY @SAN_CLIPPY_FLAGS@
+lib_clippy_CFLAGS = $(PYTHON_CFLAGS) $(AM_CFLAGS) @SAN_CLIPPY_FLAGS@
lib_clippy_LDADD = $(PYTHON_LIBS)
lib_clippy_SOURCES = \
lib/clippy.c \
diff --git a/tools/lsan-suppressions.txt b/tools/lsan-suppressions.txt
deleted file mode 100644
index 5d8bf6358..000000000
--- a/tools/lsan-suppressions.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-leak:clippy
-leak:PyObject_Malloc
-leak:PyObject_Realloc
-leak:PyList_Append
-leak:malloc
-leak:PyObject_GC_Resize
diff --git a/vtysh/Makefile.am b/vtysh/Makefile.am
index d82f9fd1b..5d6f890e9 100644
--- a/vtysh/Makefile.am
+++ b/vtysh/Makefile.am
@@ -1,5 +1,6 @@
## Process this file with Automake to create Makefile.in
+include ../common.am
if ENABLE_BGP_VNC
BGP_VNC_RFP_SRCDIR = @top_srcdir@/@LIBRFP@
@@ -16,14 +17,12 @@ BGP_VNC_RFAPI_INCDIR =
BGP_VNC_RFAPI_SRCDIR =
BGP_VNC_RFAPI_SRC =
endif
-AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib \
+AM_CPPFLAGS += -I$(top_srcdir) -I$(top_srcdir)/lib -I$(top_builddir)/lib \
$(BGP_VNC_RFAPI_INCDIR) $(BGP_VNC_RFP_INCDIR)
DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\"
LIBS = @LIBS@ @CURSES@ @LIBPAM@
-AM_CFLAGS = $(WERROR)
-
bin_PROGRAMS = vtysh
vtysh_SOURCES = vtysh_main.c vtysh.c vtysh_user.c vtysh_config.c