File: make.linux.gnu.dbg

package info (click to toggle)
soplex 7.1.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 7,568 kB
  • sloc: cpp: 76,923; sh: 1,125; python: 672; makefile: 668; awk: 243; ansic: 93; php: 15
file content (51 lines) | stat: -rw-r--r-- 1,659 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
CPPFLAGS	+=
CXXFLAGS	+=	-O0 -g -fomit-frame-pointer # -malign-double -ffast-math

# enable sanitizers if GCC >= 5
# the default is to only enable the UndefinedBehaviorSanitizer (SANITIZE=true)
# if user specifies SANITIZE=full, then also other sanitizers are enabled
GCCVERSION := $(shell $(CXX) -dumpversion | cut -f1 -d.)
SANITIZE = $(word $(shell expr \( $(GCCVERSION) \>= 5 \) + 1), false, true)

ifeq ($(SANITIZE),full)

# -fsanitize=address does not work together with -fsanitize=thread
# -fsanitize=leak is included in -fsanitize=address, but works together with -fsanitize=thread

ifeq ($(PARASCIP),true)
# enable ThreadSanitizer (https://github.com/google/sanitizers/wiki/ThreadSanitizerCppManual)
SANITIZERFLAGS = -fsanitize=thread

# enable LeakSanitizer (https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer)
SANITIZERFLAGS += -fsanitize=leak

else
# enable AddressSanitizer (https://github.com/google/sanitizers/wiki/AddressSanitizer)
SANITIZERFLAGS = -fsanitize=address

endif

# enable UndefinedBehaviorSanitizer
SANITIZERFLAGS += -fsanitize=float-cast-overflow -fsanitize=float-divide-by-zero

endif

ifeq ($(SANITIZE),true)

# enable UndefinedBehaviorSanitizer
SANITIZERFLAGS = -fsanitize=float-cast-overflow -fsanitize=float-divide-by-zero

# do not enable LeakSanitizer (https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer)
# it may prevent usage of valgrind while also not replacing it
#SANITIZERFLAGS += -fsanitize=leak

endif

CXXFLAGS += $(SANITIZERFLAGS)
ifeq ($(SHARED),true)
  LIBBUILDFLAGS += $(SANITIZERFLAGS)
endif
LDFLAGS += $(SANITIZERFLAGS)

# deprecated
SANITZERFLAGS = $(SANITIZERFLAGS)