File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,15 @@ extern (C) void thread_joinAll();
7070extern (C ) UnitTestResult runModuleUnitTests();
7171extern (C ) void _d_initMonoTime() @nogc nothrow ;
7272
73+ version (SupportSanitizers)
74+ {
75+ import ldc.attributes;
76+
77+ @weak extern (C ) void __rtsan_disable() @nogc nothrow {}
78+ @weak extern (C ) void __rtsan_enable() @nogc nothrow {}
79+ @weak extern (C ) void __rtsan_notify_blocking_call(const char * name) @nogc nothrow {}
80+ }
81+
7382version (CRuntime_Microsoft )
7483{
7584 extern (C ) void init_msvc();
@@ -103,6 +112,12 @@ private shared size_t _initCount;
103112 */
104113extern (C ) int rt_init()
105114{
115+ version (SupportSanitizers)
116+ {
117+ __rtsan_notify_blocking_call(" rt_init" );
118+ __rtsan_disable();
119+ scope (exit) __rtsan_enable();
120+ }
106121 /* @@BUG 11380 @@ Need to synchronize rt_init/rt_term calls for
107122 version (Shared) druntime, because multiple C threads might
108123 initialize different D libraries without knowing about the
You can’t perform that action at this time.
0 commit comments