sim: Enable the sanitizers in HOSTLDFLAGS as well
This fixes the following error with CONFIG_SIM_SANITIZE=y on macOS. ``` CP: /Users/yamamoto/git/nuttx/nuttx/include/nuttx/config.h CC: nettest_host.c CC: nettest_server.c LD: tcpserver Undefined symbols for architecture x86_64: "___asan_handle_no_return", referenced from: _nettest_server in nettest_server.hobj "___asan_init", referenced from: _asan.module_ctor in nettest_host.hobj _asan.module_ctor in nettest_server.hobj "___asan_option_detect_stack_use_after_return", referenced from: _nettest_server in nettest_server.hobj "___asan_register_image_globals", referenced from: _asan.module_ctor in nettest_server.hobj "___asan_report_load1", referenced from: _nettest_server in nettest_server.hobj "___asan_report_load4", referenced from: _nettest_server in nettest_server.hobj "___asan_report_store1", referenced from: _nettest_server in nettest_server.hobj "___asan_report_store2", referenced from: _nettest_server in nettest_server.hobj "___asan_report_store4", referenced from: _nettest_server in nettest_server.hobj "___asan_stack_malloc_1", referenced from: _nettest_server in nettest_server.hobj "___asan_unregister_image_globals", referenced from: _asan.module_dtor in nettest_server.hobj "___asan_version_mismatch_check_apple_clang_1100", referenced from: _asan.module_ctor in nettest_host.hobj _asan.module_ctor in nettest_server.hobj "___ubsan_handle_add_overflow", referenced from: _nettest_server in nettest_server.hobj "___ubsan_handle_builtin_unreachable", referenced from: _nettest_server in nettest_server.hobj "___ubsan_handle_pointer_overflow", referenced from: _nettest_server in nettest_server.hobj "___ubsan_handle_shift_out_of_bounds", referenced from: _nettest_server in nettest_server.hobj "___ubsan_handle_sub_overflow", referenced from: _nettest_server in nettest_server.hobj "___ubsan_handle_type_mismatch_v1", referenced from: _nettest_server in nettest_server.hobj ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) ```
This commit is contained in:
parent
6797826b84
commit
1821352993
|
@ -195,6 +195,7 @@ endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_SIM_SANITIZE),y)
|
ifeq ($(CONFIG_SIM_SANITIZE),y)
|
||||||
CCLINKFLAGS += -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer
|
CCLINKFLAGS += -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer
|
||||||
|
HOSTLDFLAGS += -fsanitize=address -fsanitize=undefined -fno-omit-frame-pointer
|
||||||
endif
|
endif
|
||||||
|
|
||||||
HOSTCFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
|
HOSTCFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
|
||||||
|
|
Loading…
Reference in New Issue