From 6ef319f4ead98491d70a6aac292245d2d2f184ff Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 30 Nov 2014 15:52:28 +0200 Subject: [PATCH] tests: AddressSanitizer (ASan) build options Add example build options that can be used to enable ASan for hwsim test cases. Signed-off-by: Jouni Malinen --- tests/hwsim/example-hostapd.config | 10 ++++++++++ tests/hwsim/example-wpa_supplicant.config | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/tests/hwsim/example-hostapd.config b/tests/hwsim/example-hostapd.config index 5acb0ce48..36cf45696 100644 --- a/tests/hwsim/example-hostapd.config +++ b/tests/hwsim/example-hostapd.config @@ -74,3 +74,13 @@ CONFIG_TESTING_OPTIONS=y CONFIG_MODULE_TESTS=y CONFIG_SUITEB=y + +# AddressSanitizer (ASan) can be enabled by uncommenting the following lines. +# This can be used as a more efficient memory error detector than valgrind +# (though, with still some CPU and memory cost, so VM cases will need more +# memory allocated for the guest). +#CFLAGS += -fsanitize=address -O1 -fno-omit-frame-pointer -g +#LIBS += -fsanitize=address -fno-omit-frame-pointer -g +#LIBS_h += -fsanitize=address -fno-omit-frame-pointer -g +#LIBS_n += -fsanitize=address -fno-omit-frame-pointer -g +#LIBS_c += -fsanitize=address -fno-omit-frame-pointer -g diff --git a/tests/hwsim/example-wpa_supplicant.config b/tests/hwsim/example-wpa_supplicant.config index 0dbb80e56..37f074f81 100644 --- a/tests/hwsim/example-wpa_supplicant.config +++ b/tests/hwsim/example-wpa_supplicant.config @@ -119,3 +119,12 @@ CONFIG_TESTING_OPTIONS=y CONFIG_MODULE_TESTS=y CONFIG_SUITEB=y + +# AddressSanitizer (ASan) can be enabled by uncommenting the following lines. +# This can be used as a more efficient memory error detector than valgrind +# (though, with still some CPU and memory cost, so VM cases will need more +# memory allocated for the guest). +#CFLAGS += -fsanitize=address -O1 -fno-omit-frame-pointer -g +#LIBS += -fsanitize=address -fno-omit-frame-pointer -g +#LIBS_c += -fsanitize=address -fno-omit-frame-pointer -g +#LIBS_p += -fsanitize=address -fno-omit-frame-pointer -g