From 48043dfa91c42c2a23032db2fa00be9d12fb3957 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Tue, 24 Mar 2026 19:31:54 +0000 Subject: [PATCH 1/2] Set -Wno-unsed-but-set-variable for compiler-rt and libcxxabi --- tools/system_libs.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/system_libs.py b/tools/system_libs.py index b41ae353d04f1..bfcc3148ac95b 100644 --- a/tools/system_libs.py +++ b/tools/system_libs.py @@ -954,7 +954,12 @@ class libcompiler_rt(MTLibrary, SjLjLibrary): # restriction soon: https://reviews.llvm.org/D71738 force_object_files = True - cflags = ['-fno-builtin', '-DNDEBUG', '-DCOMPILER_RT_HAS_ATOMICS=1'] + cflags = [ + '-fno-builtin', + '-DNDEBUG', + '-DCOMPILER_RT_HAS_ATOMICS=1', + '-Wno-unused-but-set-variable', + ] src_dir = 'system/lib/compiler-rt/lib/builtins' profile_src_dir = 'system/lib/compiler-rt/lib/profile' includes = ['system/lib/libc', 'system/lib/compiler-rt/include'] @@ -1621,6 +1626,7 @@ class libcxxabi(ExceptionLibrary, MTLibrary, DebugLibrary): '-D_LIBCXXABI_BUILDING_LIBRARY', '-DLIBCXXABI_NON_DEMANGLING_TERMINATE', '-std=c++23', + '-Wno-unused-but-set-variable', ] includes = ['system/lib/libcxx/src'] From 0a7ba31bbeefb315f3250d99b777b94a355dde04 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Tue, 24 Mar 2026 20:17:43 +0000 Subject: [PATCH 2/2] add comments with TODOs --- tools/system_libs.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/system_libs.py b/tools/system_libs.py index bfcc3148ac95b..7fc276f526ef1 100644 --- a/tools/system_libs.py +++ b/tools/system_libs.py @@ -958,6 +958,9 @@ class libcompiler_rt(MTLibrary, SjLjLibrary): '-fno-builtin', '-DNDEBUG', '-DCOMPILER_RT_HAS_ATOMICS=1', + # TODO: Remove this if the emutls_key_created variable in emutls.c is + # fixed or if the scope of the warning is modified again (see + # https://github.com/llvm/llvm-project/pull/178342) '-Wno-unused-but-set-variable', ] src_dir = 'system/lib/compiler-rt/lib/builtins' @@ -1078,6 +1081,9 @@ class libc(MuslInternalLibrary, '-Wno-string-plus-int', '-Wno-missing-braces', '-Wno-logical-op-parentheses', + # TODO: remove this if the cause variable in cxa_default_handlers + # is fixed or if the scope of the warning is reduced (see + # https://github.com/llvm/llvm-project/pull/178342) '-Wno-unused-but-set-variable', '-Wno-unused-variable', '-Wno-unused-label',