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
a7d64001
Commit
a7d64001
authored
Aug 23, 2017
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
using address sanitizer in tests
parent
f04d4e42
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
3 deletions
+27
-3
configure.ac
configure.ac
+26
-3
skeletons/tests/Makefile.am
skeletons/tests/Makefile.am
+1
-0
No files found.
configure.ac
View file @
a7d64001
...
...
@@ -93,9 +93,6 @@ AS_IF([test x$enable_code_coverage != xno], [
AC_SEARCH_LIBS(gcov_open, gcov, [LDFLAGS="$LDFLAGS $CODE_COVERAGE_LDFLAGS"])
])
AC_SUBST(ADD_CFLAGS)
AC_SUBST(TESTSUITE_CFLAGS)
dnl Skeletons should be very compatible with most of the compilers, hence
dnl very strict backward compatibility flags.
SKELETONS_CFLAGS="${ADD_CFLAGS} ${SKELETONS_CFLAGS}"
...
...
@@ -110,6 +107,32 @@ AX_CHECK_COMPILE_FLAG([-Wpedantic],
[SKELETONS_CFLAGS="$SKELETONS_CFLAGS -pedantic"], [], [-Werror])
],
[-Werror]) #clang 3.0 prints warning when the flag is not supported
dnl Enable Address Sanitizer, if supported by gcc (4.8+) or clang.
dnl http://clang.llvm.org/docs/AddressSanitizer.html
dnl https://code.google.com/p/address-sanitizer/wiki/HowToBuild
AC_ARG_ENABLE([test-asan],
[AS_HELP_STRING([--enable-test-asan], [Enable Address Sanitizer for tests of generated code])],
[enable_test_asan=$enableval], [enable_test_asan=no])
AS_IF([test "x$enable_asan" != xno], [
AX_CHECK_COMPILE_FLAG([-fsanitize=address],
[SKELETONS_CFLAGS="${SKELETONS_CFLAGS} -fsanitize=address"
TESTSUITE_CFLAGS="${TESTSUITE_CFLAGS} -fsanitize=address"],
[enable_test_asan=no], [])
AS_IF([test "x$enable_asan" = xno], [
AC_MSG_FAILURE(
[--enable-test-asan is given, but not supported on this platform.
Check out https://code.google.com/p/address-sanitizer/wiki/HowToBuild])])
dnl Keep error messages nice. Also consider:
dnl export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer
dnl export ASAN_OPTIONS=symbolize=1
AX_CHECK_COMPILE_FLAG([-fno-omit-frame-pointer],
[SKELETONS_CFLAGS="${SKELETONS_CFLAGS} -fno-omit-frame-pointer"
TESTSUITE_CFLAGS="${TESTSUITE_CFLAGS} -fno-omit-frame-pointer"],
[], [])
])
AC_SUBST(ADD_CFLAGS)
AC_SUBST(TESTSUITE_CFLAGS)
AC_SUBST(SKELETONS_CFLAGS)
dnl Checks for header files.
...
...
skeletons/tests/Makefile.am
View file @
a7d64001
...
...
@@ -19,6 +19,7 @@ check_PROGRAMS = \
#code coverage data for the tests executables
CFLAGS
=
$(
filter-out
$(CODE_COVERAGE_CFLAGS)
, @CFLAGS@
)
AM_CPPFLAGS
=
-I
$(top_srcdir)
/skeletons
$(TESTSUITE_CFLAGS)
AM_CFLAGS
=
-I
$(top_srcdir)
/skeletons
$(TESTSUITE_CFLAGS)
AM_LDFLAGS
=
$(top_builddir)
/skeletons/libasn1cskeletons.la
LDADD
=
-lm
...
...
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