Commit cb7e3c19 authored by Kirill Smelkov's avatar Kirill Smelkov

tox: Explicitly use -fno-omit-frame-pointer for ASAN/TSAN builds

Some compiler versions and distributions default to that out of the box,
while some others default to -fomit-frame-pointer. Since for sanitizers
it is important to have the frame-pointers to be able to retrieve
program tracebacks even without DWARF and faster(*), let's explicitly make
sure that what we build with comes with frame-pointers enabled.

(*) see e.g. https://github.com/google/sanitizers/wiki/AddressSanitizer#using-addresssanitizer
    for details.

/reviewed-by @jerome
/reviewed-on !24
parent fd2a6b68
......@@ -42,16 +42,16 @@ basepython =
setenv =
# distutils take CFLAGS for both C and C++.
# distutils use CFLAGS also at link stage -> we don't need to set LDFLAGS separately.
tsan: CFLAGS=-g -fsanitize=thread
asan: CFLAGS=-g -fsanitize=address
tsan: CFLAGS=-g -fsanitize=thread -fno-omit-frame-pointer
asan: CFLAGS=-g -fsanitize=address -fno-omit-frame-pointer
# XXX however distutils' try_link, which is used by numpy.distutils use only CC
# as linker without CFLAGS and _without_ LDFLAGS, which fails if *.o were
# compiled with -fsanitize=X and linked without that option. Work it around
# with also adjusting CC.
# XXX better arrange to pass CFLAGS to pygolang only, e.g. by adding --race or
# --sanitize=thread to `setup.py build_ext`.
tsan: CC=cc -fsanitize=thread
asan: CC=cc -fsanitize=address
tsan: CC=cc -fsanitize=thread -fno-omit-frame-pointer
asan: CC=cc -fsanitize=address -fno-omit-frame-pointer
# always compile pygolang from source and don't reuse binary pygolang wheels as
# we compile each case with different CFLAGS.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment