From 5370cbddbb9da3b656555dccb8ccb20c589b88a1 Mon Sep 17 00:00:00 2001 From: Terry Burton Date: Sat, 6 Jun 2020 22:22:50 +0100 Subject: [PATCH] Allow the developer build macro WITH_VERIFY_PTR to be disabled -DWITH_VERIFY_PTR=1 significantly scews the function call profile. --- configure | 20 ++++++++++++++++++-- configure.ac | 20 ++++++++++++++++++-- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/configure b/configure index edf08649a05..e7f6a138233 100755 --- a/configure +++ b/configure @@ -736,6 +736,7 @@ ac_subst_files='' ac_user_opts=' enable_option_checking enable_developer +enable_verify_ptr enable_largefile enable_strict_dependencies enable_werror @@ -1406,6 +1407,7 @@ Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-developer enables features of interest to developers. + --disable-verify-ptr disables the VERIFY_PTR developer build option. --disable-largefile omit support for large files --enable-strict-dependencies fail configure on lack of module dependancy. --enable-werror causes the build to fail if any warnings are generated. @@ -2486,6 +2488,20 @@ if test "x$developer" = "xyes"; then : ${CFLAGS=-g3} fi +# Check whether --enable-verify-ptr was given. +if test "${enable_verify_ptr+set}" = set; then : + enableval=$enable_verify_ptr; case "$enableval" in + no) + verify_ptr="" + ;; + *) + verify_ptr="-DWITH_VERIFY_PTR=1" + esac +else + verify_ptr="-DWITH_VERIFY_PTR=1" +fi + + ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do @@ -11258,10 +11274,10 @@ fi $as_echo "$ax_cv_cc_weverything_flag" >&6; } if test "x$ax_cv_cc_weverything_flag" = "xyes"; then - devflags="$devflags -W -Weverything -Wformat=2 -Wno-missing-field-initializers -Wno-date-time -Wno-padded -Wno-gnu-zero-variadic-macro-arguments -Wno-shorten-64-to-32 -Wno-sign-conversion -Wno-conversion -Wno-switch-enum -Wno-gnu-statement-expression -Wno-extended-offsetof -Wno-cast-align -Wno-documentation-unknown-command -Wno-covered-switch-default -Wno-packed -DWITH_VERIFY_PTR=1" + devflags="$devflags -W -Weverything -Wformat=2 -Wno-missing-field-initializers -Wno-date-time -Wno-padded -Wno-gnu-zero-variadic-macro-arguments -Wno-shorten-64-to-32 -Wno-sign-conversion -Wno-conversion -Wno-switch-enum -Wno-gnu-statement-expression -Wno-extended-offsetof -Wno-cast-align -Wno-documentation-unknown-command -Wno-covered-switch-default -Wno-packed $verify_ptr" else if test "x$GCC" = "xyes"; then - devflags="$devflags -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -W -Wredundant-decls -Wundef -Wformat-y2k -Wno-format-extra-args -Wno-format-zero-length -Wno-cast-align -Wformat-nonliteral -Wformat-security -Wformat=2 -DWITH_VERIFY_PTR=1" + devflags="$devflags -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -W -Wredundant-decls -Wundef -Wformat-y2k -Wno-format-extra-args -Wno-format-zero-length -Wno-cast-align -Wformat-nonliteral -Wformat-security -Wformat=2 $verify_ptr" INSTALLSTRIP="" fi fi diff --git a/configure.ac b/configure.ac index c72511ab390..1b1febf68a2 100644 --- a/configure.ac +++ b/configure.ac @@ -100,6 +100,22 @@ if test "x$developer" = "xyes"; then : ${CFLAGS=-g3} fi +dnl # +dnl # The developer option WITH_VERIFY_PTR significantly scews profiling so +dnl # we allow it to be disabled. +dnl # +AC_ARG_ENABLE(verify-ptr, +[ --disable-verify-ptr disables WITH_VERIFY_PTR developer build option.], +[ case "$enableval" in + no) + verify_ptr="" + ;; + *) + verify_ptr="-DWITH_VERIFY_PTR=1" + esac ], +[ verify_ptr="-DWITH_VERIFY_PTR=1" ], +) + dnl ############################################################# dnl # dnl # 0. Checks for compiler, libtool, and command line options. @@ -1739,10 +1755,10 @@ if test "x$developer" = "xyes"; then dnl # AX_CC_WEVERYTHING_FLAG if test "x$ax_cv_cc_weverything_flag" = "xyes"; then - devflags="$devflags -W -Weverything -Wformat=2 -Wno-missing-field-initializers -Wno-date-time -Wno-padded -Wno-gnu-zero-variadic-macro-arguments -Wno-shorten-64-to-32 -Wno-sign-conversion -Wno-conversion -Wno-switch-enum -Wno-gnu-statement-expression -Wno-extended-offsetof -Wno-cast-align -Wno-documentation-unknown-command -Wno-covered-switch-default -Wno-packed -DWITH_VERIFY_PTR=1" + devflags="$devflags -W -Weverything -Wformat=2 -Wno-missing-field-initializers -Wno-date-time -Wno-padded -Wno-gnu-zero-variadic-macro-arguments -Wno-shorten-64-to-32 -Wno-sign-conversion -Wno-conversion -Wno-switch-enum -Wno-gnu-statement-expression -Wno-extended-offsetof -Wno-cast-align -Wno-documentation-unknown-command -Wno-covered-switch-default -Wno-packed $verify_ptr" else if test "x$GCC" = "xyes"; then - devflags="$devflags -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -W -Wredundant-decls -Wundef -Wformat-y2k -Wno-format-extra-args -Wno-format-zero-length -Wno-cast-align -Wformat-nonliteral -Wformat-security -Wformat=2 -DWITH_VERIFY_PTR=1" + devflags="$devflags -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -W -Wredundant-decls -Wundef -Wformat-y2k -Wno-format-extra-args -Wno-format-zero-length -Wno-cast-align -Wformat-nonliteral -Wformat-security -Wformat=2 $verify_ptr" INSTALLSTRIP="" fi fi -- 2.47.3