packaging: add marm option to asan_force_options 00/175100/4 accepted/tizen/base/20180622.191829 submit/tizen_base/20180621.081209
authorDongkyun Son <dongkyun.s@samsung.com>
Mon, 9 Apr 2018 00:01:57 +0000 (09:01 +0900)
committerDongkyun Son <dongkyun.s@samsung.com>
Fri, 18 May 2018 06:48:46 +0000 (15:48 +0900)
Frame-pointer-based unwinding does not work on Thumb.

Note that binary size will be bigger, but backtraces will be readable.

Change-Id: I60d9bbfaaac8ed5ebe2525d5a8b99eec5139c8e6
Signed-off-by: Dongkyun Son <dongkyun.s@samsung.com>
packaging/gcc-contrib.spec

index 52166a5..01c5ed0 100644 (file)
 %define libdir %{!?cross:%{_libdir}}%{?cross:%{_prefix}/lib%{?aarch64:64}}
 %define libsubdir %{libdir}/gcc/%{target_arch}/%{version}
 
+%ifarch armv7l
+%define asan_force_options -fsanitize-recover=address -fsanitize=address -marm -Wa,-mimplicit-it=arm -fno-omit-frame-pointer -Wp,-U_FORTIFY_SOURCE -Wl,--as-needed -ldl -lpthread
+%define lsan_force_options -fsanitize=leak -marm -Wa,-mimplicit-it=arm -fno-omit-frame-pointer -Wp,-U_FORTIFY_SOURCE -Wl,--as-needed -ldl -lpthread
+%else
 %define asan_force_options -fsanitize-recover=address -fsanitize=address -fno-omit-frame-pointer -Wp,-U_FORTIFY_SOURCE -Wl,--as-needed -ldl -lpthread
+%define lsan_force_options -fsanitize=leak -fno-omit-frame-pointer -Wp,-U_FORTIFY_SOURCE -Wl,--as-needed -ldl -lpthread
+%endif
 %define ubsan_force_options -fsanitize=undefined,bounds-strict,float-divide-by-zero,float-cast-overflow
-%define lsan_force_options -fsanitize=leak -marm -Wa,-mimplicit-it=arm -fno-omit-frame-pointer -Wp,-U_FORTIFY_SOURCE -Wl,--as-needed -ldl -lpthread
 %define isan_force_options -fsanitize=unsigned-integer-overflow
 %define tsan_force_options -fsanitize=thread -fno-omit-frame-pointer -Wp,-U_FORTIFY_SOURCE -Wl,--as-needed -ldl -lpthread
 %define asan_runtime_options halt_on_error=false:start_deactivated=true:print_cmdline=true:quarantine_size_mb=1:detect_leaks=0:handle_segv=0:log_path=/tmp/asan.log:log_exe_name=1