[clang] [compiler-rt] [asan][windows] Eliminate the static asan runtime on windows (PR #81677)

via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 25 11:22:54 PDT 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff ce37a7131ff33bbd04bd1893de78c1bd3a1f0897 7affdb487a88f0c7b31ec20c027ceeaa92f2fe4a -- compiler-rt/lib/asan/asan_malloc_win_thunk.cpp compiler-rt/lib/asan/asan_win_common_runtime_thunk.cpp compiler-rt/lib/asan/asan_win_common_runtime_thunk.h compiler-rt/lib/asan/asan_win_static_runtime_thunk.cpp compiler-rt/lib/sanitizer_common/sanitizer_win_immortalize.h compiler-rt/lib/sanitizer_common/sanitizer_win_interception.cpp compiler-rt/lib/sanitizer_common/sanitizer_win_interception.h compiler-rt/lib/sanitizer_common/sanitizer_win_thunk_interception.cpp compiler-rt/lib/sanitizer_common/sanitizer_win_thunk_interception.h clang/lib/Driver/SanitizerArgs.cpp clang/lib/Driver/ToolChains/MSVC.cpp clang/test/Driver/cl-link.c compiler-rt/lib/asan/asan_flags.cpp compiler-rt/lib/asan/asan_globals_win.cpp compiler-rt/lib/asan/asan_malloc_win.cpp compiler-rt/lib/asan/asan_win_dynamic_runtime_thunk.cpp compiler-rt/lib/interception/interception_win.cpp compiler-rt/lib/sanitizer_common/sanitizer_common_interface.inc compiler-rt/test/asan/TestCases/Darwin/interface_symbols_darwin.cpp compiler-rt/test/asan/TestCases/Linux/interface_symbols_linux.cpp compiler-rt/test/asan/TestCases/Windows/free_hook_realloc.cpp compiler-rt/test/asan/TestCases/Windows/msvc/dll_and_lib.cpp compiler-rt/test/asan/TestCases/Windows/msvc/dll_large_function.cpp compiler-rt/test/asan/TestCases/Windows/unsymbolized.cpp compiler-rt/test/asan/TestCases/debug_double_free.cpp compiler-rt/test/asan/TestCases/debug_report.cpp compiler-rt/test/asan/TestCases/default_options.cpp compiler-rt/test/asan/TestCases/on_error_callback.cpp compiler-rt/test/asan/TestCases/report_error_summary.cpp compiler-rt/lib/sanitizer_common/sanitizer_coverage_win_runtime_thunk.cpp compiler-rt/lib/ubsan/ubsan_win_runtime_thunk.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_win_immortalize.h b/compiler-rt/lib/sanitizer_common/sanitizer_win_immortalize.h
index 43f0675fe8..808cd2f771 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_win_immortalize.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_win_immortalize.h
@@ -30,9 +30,8 @@ typedef union _RTL_RUN_ONCE {
 } INIT_ONCE, *PINIT_ONCE;
 
 extern "C" {
-__declspec(dllimport) int WINAPI
-    InitOnceExecuteOnce(PINIT_ONCE, BOOL(WINAPI*)(PINIT_ONCE, PVOID, PVOID*),
-                        void*, void*);
+__declspec(dllimport) int WINAPI InitOnceExecuteOnce(
+    PINIT_ONCE, BOOL(WINAPI*)(PINIT_ONCE, PVOID, PVOID*), void*, void*);
 }
 #  endif
 
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_win_interception.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_win_interception.cpp
index a88ca413b6..75a1545d00 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_win_interception.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_win_interception.cpp
@@ -106,9 +106,10 @@ extern "C" __declspec(dllexport) bool __cdecl __sanitizer_override_function(
   return function_overridden;
 }
 
-extern "C" __declspec(dllexport) bool __cdecl __sanitizer_override_function_by_addr(
-    const uptr source_function, const uptr target_function,
-    uptr *const old_target_function) {
+extern "C"
+    __declspec(dllexport) bool __cdecl __sanitizer_override_function_by_addr(
+        const uptr source_function, const uptr target_function,
+        uptr *const old_target_function) {
   CHECK(source_function);
   CHECK(target_function);
 
@@ -125,9 +126,10 @@ extern "C" __declspec(dllexport) bool __cdecl __sanitizer_override_function_by_a
   return function_overridden;
 }
 
-extern "C" __declspec(dllexport) bool __cdecl __sanitizer_register_weak_function(
-    const char *export_name, const uptr user_function,
-    uptr *const old_user_function) {
+extern "C"
+    __declspec(dllexport) bool __cdecl __sanitizer_register_weak_function(
+        const char *export_name, const uptr user_function,
+        uptr *const old_user_function) {
   CHECK(export_name);
   CHECK(user_function);
 
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_win_thunk_interception.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_win_thunk_interception.cpp
index edf764f7ac..13db8869ab 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_win_thunk_interception.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_win_thunk_interception.cpp
@@ -61,14 +61,14 @@ void initialize_thunks(const sanitizer_thunk *first,
 #  pragma section(".WEAK$Z", read)  // weak end
 
 extern "C" {
-__declspec(allocate(".INTR$A"))
-    sanitizer_thunk __sanitizer_intercept_thunk_begin;
+__declspec(allocate(
+    ".INTR$A")) sanitizer_thunk __sanitizer_intercept_thunk_begin;
 __declspec(allocate(".INTR$Z")) sanitizer_thunk __sanitizer_intercept_thunk_end;
 
-__declspec(allocate(".WEAK$A"))
-    sanitizer_thunk __sanitizer_register_weak_thunk_begin;
-__declspec(allocate(".WEAK$Z"))
-    sanitizer_thunk __sanitizer_register_weak_thunk_end;
+__declspec(allocate(
+    ".WEAK$A")) sanitizer_thunk __sanitizer_register_weak_thunk_begin;
+__declspec(allocate(
+    ".WEAK$Z")) sanitizer_thunk __sanitizer_register_weak_thunk_end;
 }
 
 extern "C" int __sanitizer_thunk_init() {

``````````

</details>


https://github.com/llvm/llvm-project/pull/81677


More information about the cfe-commits mailing list