Files
sousa-gecko/taskcluster/scripts/misc/libdispatch-unused-but-set-global.patch
Ryan VanderMeulen 5b74429796 Bug 2071151 - Cherry-pick the upstream clang 23 fixes and fix cctools-port and winchecksec. r=firefox-build-system-reviewers,ahochheiden
llvmorg-24-init-8185-gbe215a25f001.patch and llvmorg-24-init-8187-gbc6c76a4d4f8.patch are the upstream
extract_symbols.py fixes for the clang::interp exports and the Registry<T> accessors, so
filter-symbols_clang_23.patch shrinks back to the Mozilla-specific size reductions. That also keeps it
applying to clang-trunk, which already has both fixes. llvmorg-24-init-7807-g651d01e873c6.patch cherry-picks
the upstream fix for a TypePrinter infinite recursion on FullyQualifiedName template parameters, which the
mozsearch plugin hits on UniquePtr<T[N]>.

libdispatch trips the new -Wunused-but-set-global (backport of the upstream fix the tpoechtrager fork lacks),
cctools-port's configure needs to copy LLVM 23's new llvm-c/Visibility.h and llvm-config.h next to lto.h, and
pe-parse's unused to_string template fails the /W4 /WX build whenever clang has -Wunused-template in -Wall
(23.1.0 did, 23.1.1 backed it out pending a libc++ cleanup), so keep it off explicitly.

Differential Revision: https://phabricator.services.mozilla.com/D325225
2026-09-11 07:15:48 +00:00

39 lines
1.4 KiB
Diff

Backport of swiftlang/swift-corelibs-libdispatch commit d545f73a3986 ("Fix unused-but-set-global
error"), which is not yet in the tpoechtrager/apple-libdispatch fork we build. Clang 23 rejects the
Linux build with -Werror,-Wunused-but-set-global because this global is only read under
#ifndef __linux__. Fork PR: https://github.com/tpoechtrager/apple-libdispatch/pull/2
diff --git a/src/queue.c b/src/queue.c
--- a/src/queue.c
+++ b/src/queue.c
@@ -6546,7 +6546,9 @@ _dispatch_pthread_root_queue_dispose(dispatch_queue_global_t dq,
#pragma mark -
#pragma mark dispatch_runloop_queue
+#ifndef __linux__
DISPATCH_STATIC_GLOBAL(bool _dispatch_program_is_probably_callback_driven);
+#endif
#if DISPATCH_COCOA_COMPAT
DISPATCH_STATIC_GLOBAL(dispatch_once_t _dispatch_main_q_handle_pred);
@@ -6680,7 +6682,9 @@ _dispatch_runloop_queue_handle_init(void *ctxt)
#endif
_dispatch_runloop_queue_set_handle(dq, handle);
+#ifndef __linux__
_dispatch_program_is_probably_callback_driven = true;
+#endif
}
static void
@@ -7148,7 +7152,9 @@ dispatch_main(void)
if (pthread_main_np()) {
#endif
_dispatch_object_debug(&_dispatch_main_q, "%s", __func__);
+#ifndef __linux__
_dispatch_program_is_probably_callback_driven = true;
+#endif
_dispatch_ktrace0(ARIADNE_ENTER_DISPATCH_MAIN_CODE);
#ifdef __linux__
// On Linux, if the main thread calls pthread_exit, the process becomes a zombie.