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

native: add address sanitizer make target #3327

Merged
merged 1 commit into from
Jul 9, 2015
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions boards/native/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ all-debug: export CFLAGS += -g
all-cachegrind: export CFLAGS += -g
all-gprof: export CFLAGS += -pg
all-gprof: export LINKFLAGS += -pg
all-asan: export CFLAGS += -fsanitize=address -fno-omit-frame-pointer -g
all-asan: export CFLAGS += -DNATIVE_IN_CALLOC
all-asan: export LINKFLAGS += -fsanitize=address -fno-omit-frame-pointer -g

export INCLUDES += $(NATIVEINCLUDES)

Expand Down Expand Up @@ -121,6 +124,8 @@ all-debug: all

all-gprof: all

all-asan: all

all-valgrind: all

all-cachegrind: all
Expand Down
4 changes: 4 additions & 0 deletions cpu/native/syscalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,11 @@ void free(void *ptr)
_native_syscall_leave();
}

#ifdef NATIVE_IN_CALLOC
int _native_in_calloc = 1;
#else
int _native_in_calloc = 0;
#endif
void *calloc(size_t nmemb, size_t size)
{
/* dynamically load calloc when it's needed - this is necessary to
Expand Down