Skip to content

Commit cb7e3c1

Browse files
committed
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 https://lab.nexedi.com/nexedi/pygolang/-/merge_requests/24
1 parent fd2a6b6 commit cb7e3c1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tox.ini

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,16 @@ basepython =
4242
setenv =
4343
# distutils take CFLAGS for both C and C++.
4444
# distutils use CFLAGS also at link stage -> we don't need to set LDFLAGS separately.
45-
tsan: CFLAGS=-g -fsanitize=thread
46-
asan: CFLAGS=-g -fsanitize=address
45+
tsan: CFLAGS=-g -fsanitize=thread -fno-omit-frame-pointer
46+
asan: CFLAGS=-g -fsanitize=address -fno-omit-frame-pointer
4747
# XXX however distutils' try_link, which is used by numpy.distutils use only CC
4848
# as linker without CFLAGS and _without_ LDFLAGS, which fails if *.o were
4949
# compiled with -fsanitize=X and linked without that option. Work it around
5050
# with also adjusting CC.
5151
# XXX better arrange to pass CFLAGS to pygolang only, e.g. by adding --race or
5252
# --sanitize=thread to `setup.py build_ext`.
53-
tsan: CC=cc -fsanitize=thread
54-
asan: CC=cc -fsanitize=address
53+
tsan: CC=cc -fsanitize=thread -fno-omit-frame-pointer
54+
asan: CC=cc -fsanitize=address -fno-omit-frame-pointer
5555

5656
# always compile pygolang from source and don't reuse binary pygolang wheels as
5757
# we compile each case with different CFLAGS.

0 commit comments

Comments
 (0)