Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
asn1c
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
asn1c
Commits
cb4eddbe
Commit
cb4eddbe
authored
Sep 15, 2017
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make sanitization default
parent
e29a30e7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
15 deletions
+37
-15
configure.ac
configure.ac
+37
-15
No files found.
configure.ac
View file @
cb4eddbe
...
@@ -111,31 +111,53 @@ AC_ARG_ENABLE(test-Werror,
...
@@ -111,31 +111,53 @@ AC_ARG_ENABLE(test-Werror,
TESTSUITE_CFLAGS="${TESTSUITE_CFLAGS} -Werror -W -Wpointer-arith"
TESTSUITE_CFLAGS="${TESTSUITE_CFLAGS} -Werror -W -Wpointer-arith"
])
])
SANITIZER_CFLAGS=""
dnl Enable Undefined Behavior Sanitizer, if supported.
AC_ARG_ENABLE([test-ubsan],
[AS_HELP_STRING([--disable-test-ubsan],
[Disable Undefined Behavior Sanitizer for tests])],
[disable_test_ubsan=$enableval], [disable_test_ubsan=maybe])
AS_IF([test "x$disable_test_ubsan" != xno], [
AX_CHECK_COMPILE_FLAG([-fsanitize=undefined],
[SANITIZER_CFLAGS="${SANITIZER_CFLAGS} -fsanitize=undefined"],
[
AS_IF([test "x$disable_test_ubsan" != xmaybe], [
AC_MSG_FAILURE(
[--disable-test-ubsan=$disable_test_ubsan is given, but not supported on target.
https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html#how-to-build])])
])
])
dnl Enable Address Sanitizer, if supported by gcc (4.8+) or clang.
dnl Enable Address Sanitizer, if supported by gcc (4.8+) or clang.
dnl http://clang.llvm.org/docs/AddressSanitizer.html
dnl http://clang.llvm.org/docs/AddressSanitizer.html
dnl https://code.google.com/p/address-sanitizer/wiki/HowToBuild
AC_ARG_ENABLE([test-asan],
AC_ARG_ENABLE([test-asan],
[AS_HELP_STRING([--enable-test-asan], [Enable Address Sanitizer for tests of generated code])],
[AS_HELP_STRING([--disable-test-asan],
[enable_test_asan=$enableval], [enable_test_asan=no])
[Disable Address Sanitizer for tests])],
AS_IF([test "x$enable_test_asan" != xno], [
[disable_test_asan=$enableval], [disable_test_asan=maybe])
AS_IF([test "x$disable_test_asan" != xno], [
AX_CHECK_COMPILE_FLAG([-fsanitize=address],
AX_CHECK_COMPILE_FLAG([-fsanitize=address],
[S
KELETONS_CFLAGS="${SKELETONS_CFLAGS} -fsanitize=address"
[S
ANITIZER_CFLAGS="${SANITIZER_CFLAGS} -fsanitize=address"],
TESTSUITE_CFLAGS="${TESTSUITE_CFLAGS} -fsanitize=address"],
[
[echo disabling; enable_test_asan=no])
AS_IF([test "x$disable_test_asan" != xmaybe], [
AS_IF([test "x$enable_test_asan" = xno], [
AC_MSG_FAILURE(
AC_MSG_FAILURE(
[--disable-test-asan=$disable_test_asan is given, but not supported on target.
[--enable-test-asan is given, but not supported on this platform.
Check out https://clang.llvm.org/docs/AddressSanitizer.html#how-to-build])])
Check out https://code.google.com/p/address-sanitizer/wiki/HowToBuild])
])
])
dnl Keep error messages nice. Also consider:
dnl Keep error messages nice. Also consider:
dnl export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer
dnl export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer
dnl export ASAN_OPTIONS=symbolize=1
dnl export ASAN_OPTIONS=symbolize=1
AX_CHECK_COMPILE_FLAG([-fno-omit-frame-pointer],
AX_CHECK_COMPILE_FLAG([-fno-omit-frame-pointer],
[SKELETONS_CFLAGS="${SKELETONS_CFLAGS} -fno-omit-frame-pointer"
[SANITIZER_CFLAGS="${SANITIZER_CFLAGS} -fno-omit-frame-pointer"])
TESTSUITE_CFLAGS="${TESTSUITE_CFLAGS} -fno-omit-frame-pointer"],
])
[], [])
])
TESTSUITE_CFLAGS="${TESTSUICE_CFLAGS} ${SANITIZER_CFLAGS}"
SKELETONS_CFLAGS="${SKELETONS_CFLAGS} ${SANITIZER_CFLAGS}"
AC_SUBST(ADD_CFLAGS)
AC_SUBST(ADD_CFLAGS)
AC_SUBST(SANITIZER_CFLAGS)
AC_SUBST(TESTSUITE_CFLAGS)
AC_SUBST(TESTSUITE_CFLAGS)
AC_SUBST(SKELETONS_CFLAGS)
AC_SUBST(SKELETONS_CFLAGS)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment