File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 2424
2525extern " C" const char *__progname;
2626
27- // This function may not be present when building at desk, and isn't really
28- // needed there, so just skip it in that case.
29- #if SWIFT_BNI_OS_BUILD
27+ #if SWIFT_USE_OS_TRACE_LAZY_INIT
3028extern " C" bool _os_trace_lazy_init_completed_4swift (void );
3129#endif
3230
@@ -47,7 +45,7 @@ static inline bool shouldEnableTracing() {
4745}
4846
4947static inline bool tracingReady () {
50- #if SWIFT_BNI_OS_BUILD
48+ #if SWIFT_USE_OS_TRACE_LAZY_INIT
5149 if (!_os_trace_lazy_init_completed_4swift ())
5250 return false ;
5351#endif
Original file line number Diff line number Diff line change @@ -474,6 +474,10 @@ function(_add_target_variant_c_compile_flags)
474474 list (APPEND result "-DSWIFT_STDLIB_OVERRIDABLE_RETAIN_RELEASE" )
475475 endif ()
476476
477+ if (SWIFT_USE_OS_TRACE_LAZY_INIT)
478+ list (APPEND result "-DSWIFT_USE_OS_TRACE_LAZY_INIT" )
479+ endif ()
480+
477481 list (APPEND result ${SWIFT_STDLIB_EXTRA_C_COMPILE_FLAGS} )
478482
479483 set ("${CFLAGS_RESULT_VAR_NAME} " "${result} " PARENT_SCOPE)
Original file line number Diff line number Diff line change @@ -210,6 +210,10 @@ option(SWIFT_STDLIB_SINGLE_THREADED_CONCURRENCY
210210 "Build the standard libraries assuming that they will be used in an environment with only a single thread."
211211 FALSE )
212212
213+ option (SWIFT_USE_OS_TRACE_LAZY_INIT
214+ "Use the os_trace call to check if lazy init has been completed before making os_signpost calls."
215+ FALSE )
216+
213217# Use dispatch as the system scheduler by default.
214218# For convenience, we set this to false when concurrency is disabled.
215219set (SWIFT_CONCURRENCY_USES_DISPATCH FALSE )
You can’t perform that action at this time.
0 commit comments