Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: disable debug and sanitizers by default #251

Merged
merged 1 commit into from
Jan 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/sh -x

configureOpts="--disable-sanitizers --disable-debug"
configureOpts=""

while getopts ":hd" opt; do
case ${opt} in
h ) echo "Use -d to turn on sanitizers (for debugging only)"
exit;;
d ) configureOpts=""
d ) configureOpts="--enable-debug"
;;
\? ) echo "Usage: $0 [-h] [-d]"
exit;;
Expand Down
12 changes: 6 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ AX_CODE_COVERAGE

dnl is_release must be lowercase because AX_CHECK_ENABLE_DEBUG calls m4_tolower
dnl on its fourth argument.
AX_CHECK_ENABLE_DEBUG([yes], , [UNUSED_NDEBUG], [$is_release])
AX_CHECK_ENABLE_DEBUG([no], , , [$is_release])

AC_PROG_CC

Expand Down Expand Up @@ -132,14 +132,14 @@ AC_CHECK_HEADERS([fcntl.h float.h inttypes.h limits.h locale.h netinet/in.h path

AC_CONFIG_FILES([Makefile])

# Enable address sanitizer for non-release builds. The performance hit is a
# Enable address sanitizer for debug builds. The performance hit is a
# 50% increase of wallclock time for the testsuite on my machine.
if test x$is_release = xyes; then
default_sanitizers=
else
if test "x$ax_enable_debug" = "xyes"; then
default_sanitizers=address
else
default_sanitizers=
fi
AX_SANITIZERS(, [$default_sanitizers], [AC_DEFINE([I3LOCK_ASAN_ENABLED], [], [Enable ASAN])])
AX_SANITIZERS(, [$default_sanitizers])

AC_OUTPUT

Expand Down