Fix GCC build.

TEST=ci
Bug: https://github.com/dart-lang/sdk/issues/63406
Change-Id: I3bb3963fcc182777c5d2c0e062ae4bbf3c5aae75
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/504800
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
Ryan Macnak
2026-05-20 08:21:30 -07:00
committed by dart-scoped@luci-project-accounts.iam.gserviceaccount.com
parent 5f2c7f7ef0
commit b2911c0bf1
7 changed files with 43 additions and 21 deletions
+7 -2
View File
@@ -130,8 +130,8 @@ config("compiler") {
cflags += [ "-fsanitize=address" ]
if (is_win) {
# Windows directly calls link.exe instead of the compiler driver when
# linking. Hence, pass the runtime libraries instead of -fsanitize=address
# or -fsanitize=fuzzer.
# linking. Hence, pass the runtime libraries instead of
# -fsanitize=address or -fsanitize=fuzzer.
_clang_lib_dir =
"//buildtools/win-x64/clang/lib/clang/23/lib/x86_64-pc-windows-msvc"
libs = [ "$_clang_lib_dir/clang_rt.asan_dynamic.lib" ]
@@ -688,6 +688,11 @@ if (is_win) {
default_warning_flags += [
"-Wno-ignored-qualifiers", # Warnings in BoringSSL headers
]
if (is_tsan && current_cpu == "riscv64") {
default_warning_flags += [
"-Wno-tsan", # Use of std::atomic_thread_fence in the STL.
]
}
}
if (is_mac || is_ios) {
+5 -2
View File
@@ -4867,7 +4867,7 @@ static void AddVMMappings(JSONArray* rss_children) {
continue; // Malformed input.
}
strncpy(path, path_start, sizeof(path));
strncpy(path, path_start, sizeof(path) - 1);
path[sizeof(path) - 1] = '\0';
int len = strlen(path);
if ((len > 0) && path[len - 1] == '\n') {
@@ -4897,7 +4897,10 @@ static void AddVMMappings(JSONArray* rss_children) {
}
if (!updated) {
VMMapping mapping;
strncpy(mapping.path, path, sizeof(mapping.path));
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic ignored "-Wstringop-truncation"
#endif
strncpy(mapping.path, path, sizeof(mapping.path) - 1);
mapping.path[sizeof(mapping.path) - 1] = '\0';
mapping.size = size;
mappings.Add(mapping);
+3
View File
@@ -3425,6 +3425,9 @@ DART_FORCE_INLINE void Simulator::InstructionDecodeImpl(Instr* instr) {
} else if (instr->InstructionBits() == static_cast<int32_t>(kDMB_ISH)) {
// Format(instr, "dmb ish");
memory_.FlushAll();
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic ignored "-Wtsan"
#endif
std::atomic_thread_fence(std::memory_order_seq_cst);
} else if (instr->InstructionBits() == static_cast<int32_t>(kDMB_ISHST)) {
// Format(instr, "dmb ishst");
+3
View File
@@ -1995,6 +1995,9 @@ void Simulator::DecodeSystem(Instr* instr) {
if (instr->InstructionBits() == kDMB_ISH) {
// Format(instr, "dmb ish");
memory_.FlushAll();
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic ignored "-Wtsan"
#endif
std::atomic_thread_fence(std::memory_order_seq_cst);
return;
}
+6 -4
View File
@@ -445,10 +445,12 @@ if (!using_sanitizer && current_os == "linux" &&
}
} else if (current_cpu == "riscv64") {
# Fuchsia Clang is missing the riscv64 MSAN runtime.
sanitizers += [
"asan",
"tsan",
]
sanitizers += [ "asan" ]
# gcc tsan is broken on Ubuntu Noble.
if (is_clang) {
sanitizers += [ "tsan" ]
}
}
foreach(sanitizer, sanitizers) {
+7 -9
View File
@@ -10,34 +10,32 @@ config("binaryen_flags") {
# Clang or GCC
cflags += [
"-Wno-deprecated-declarations",
"-Wno-unused-but-set-parameter",
"-Wno-unused-function",
"-Wno-unused-variable",
"-Wno-pessimizing-move",
"-Wno-sign-compare",
"-Wno-range-loop-construct",
"-Wno-sign-compare",
"-Wno-unused-function",
]
if (is_clang) {
# Clang
cflags += [
"-Wno-deprecated-this-capture",
"-Wno-header-hygiene",
"-Wno-unused-private-field",
"-Wno-inconsistent-missing-override",
"-Wno-unknown-warning-option",
"-Wno-deprecated-this-capture",
"-Wno-unused-private-field",
]
} else {
# GCC
cflags += [
"-Wno-redundant-move",
"-Wno-uninitialized",
"-Wno-dangling-pointer",
"-Wno-deprecated",
"-Wno-init-list-lifetime",
# Bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86465#c16 triggered by
# https://github.com/WebAssembly/binaryen/blob/cdb7aeab40b4c522de20b242019f7e88641445d5/src/wasm/wasm-type.cpp#L530.
"-Wno-maybe-uninitialized",
"-Wno-deprecated",
"-Wno-redundant-move",
]
}
}
+12 -4
View File
@@ -1611,6 +1611,15 @@
"runtime_precompiled"
]
},
{
"name": "build dart debug - split to avoid timeout",
"script": "tools/build.py",
"arguments": [
"--mode=debug",
"--no-clang",
"create_sdk"
]
},
{
"name": "build dart release",
"script": "tools/build.py",
@@ -1622,13 +1631,12 @@
]
},
{
"name": "build dart product",
"name": "build dart release - split to avoid timeout",
"script": "tools/build.py",
"arguments": [
"--mode=product",
"--mode=release",
"--no-clang",
"runtime",
"runtime_precompiled"
"create_sdk"
]
}
]