Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support MemorySanitizer build #1988

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -135,18 +135,16 @@ ifeq ($(COVERAGE), 1)
endif

ifeq ($(ASAN), 1)
ASAN_CFLAGS := -O0 -g -fsanitize=$(DEFAULT_SANITIZERS)
UFTRACE_CFLAGS += $(ASAN_CFLAGS)
DEMANGLER_CFLAGS += $(ASAN_CFLAGS)
SYMBOLS_CFLAGS += $(ASAN_CFLAGS)
DBGINFO_CFLAGS += $(ASAN_CFLAGS)
TRACEEVENT_CFLAGS += $(ASAN_CFLAGS)
TEST_CFLAGS += $(ASAN_CFLAGS)
SAN=$(DEFAULT_SANITIZERS)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could be SAN=all.

else ifeq ($(MSAN), 1)
SAN=memory
endif

ifneq ($(SAN),)
ifeq ($(SAN), all)
SAN_CFLAGS := -O0 -g -fsanitize=$(DEFAULT_SANITIZERS)
else ifeq ($(MSAN), 1)
SAN_CFLAGS := -O0 -g -fsanitize=$(SAN) -fsanitize-memory-track-origins
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems it should be used when memory sanitizer is requested (even with others). What about this?

else ifneq ($(findstring memory, $(SAN)), )
  SAN_CFLAGS := -O0 -g -fsanitize=$(SAN) -fsanitize-memory-track-origins

else
SAN_CFLAGS := -O0 -g -fsanitize=$(SAN)
endif
Expand Down
Loading