Skip to content

Commit a694edf

Browse files
Reduce cross-platform build warning noise (#315)
* Reduce CI/build warning noise and harden cross-platform behavior. Rebase warning-cleanup work onto current main, keep vdf_client session parser refactor from #313, and apply targeted warning/robustness fixes across CI workflows, CMake/build scripts, and core/runtime code paths. Co-authored-by: Cursor <cursoragent@cursor.com> * Restore full 2weso CI durations and tighten Python/Cargo target plumbing. Remove temporary shortened 2weso test overrides in vdf-client-hw CI and align build scripts with modern CMake/Cargo target variables to eliminate unused PYTHON_EXECUTABLE warnings and keep MSVC-only CRT overrides scoped correctly. Co-authored-by: Cursor <cursoragent@cursor.com> * Consolidate checked integer casts across C/C++ and Python bindings. Replace ad-hoc narrowing checks and release-elided asserts with a shared checked_cast helper to keep overflow handling consistent across wrapper and test paths. Co-authored-by: Cursor <cursoragent@cursor.com> * Fix unsigned-to-signed checked_cast overflow guard and add regression coverage. The unsigned-to-signed conversion path now checks against the signed destination max, preventing silent wraparound for values above INT32_MAX, and adds a GoogleTest regression to lock this behavior. Co-authored-by: Cursor <cursoragent@cursor.com> * Fix signed-widening behavior in checked_cast and add regression coverage. Avoid truncated bounds checks for same-signed widening casts and add positive/negative int32-to-int64 tests. Co-authored-by: Cursor <cursoragent@cursor.com> * Use checked_cast for primetest and verifier discriminant conversions. Replace manual narrowing checks/casts with checked_cast to keep overflow handling consistent and centralized. Co-authored-by: Cursor <cursoragent@cursor.com> * Use 64-bit recursion and proof lengths in verifier APIs. Align the Python and C bindings with the native verifier interface by accepting full-size proof blob lengths and recursion depth instead of narrowing to int32, removing wrapper-level truncation guards. Co-authored-by: Cursor <cursoragent@cursor.com> * Use logical OR for uint128 comparison operators. Switch boolean composition in <= and >= from bitwise OR to logical OR for clearer intent and short-circuit behavior. Co-authored-by: Cursor <cursoragent@cursor.com> * Update verifier proof-length tests and known-proof fixture. Switch verifier and stress tests to pass proof blob lengths as size_t without narrowing casts, and refresh verifier_test's fixed proof vector to a current-format fixture so the known-proof assertion remains meaningful with the widened verifier API. Co-authored-by: Cursor <cursoragent@cursor.com> * Mirror production verifier path in known-proof test. Update verifier_test to construct and reuse the discriminant before calling CheckProofOfTimeNWesolowski directly, so the test reflects production verifier usage while keeping the current-format known-proof fixture. Co-authored-by: Cursor <cursoragent@cursor.com> * Pass witness_type directly to uint64 depth API. Remove the obsolete int32_t intermediate cast in stress_test so the call matches the updated verifier depth parameter type. Co-authored-by: Cursor <cursoragent@cursor.com> * Inline env_flag use in prover_test fast-mode check. Remove the redundant env_truthy wrapper and call env_flag directly to keep the test setup path simpler without changing behavior. Co-authored-by: Cursor <cursoragent@cursor.com> * Revert "Use logical OR for uint128 comparison operators." This reverts commit 8db997d. --------- Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 53c6b91 commit a694edf

44 files changed

Lines changed: 417 additions & 205 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,39 @@ jobs:
106106
run: |
107107
pip install pipx
108108
109-
- name: Build and test
109+
- name: Build and test (Linux)
110+
if: matrix.os.matrix == 'ubuntu'
110111
env:
111112
CIBW_BUILD: ${{ matrix.python.cibw-build }}
112113
CIBW_MANYLINUX_AARCH64_IMAGE: ${{ matrix.python.manylinux }}
113114
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.python.manylinux }}
115+
CIBW_PRERELEASE_PYTHONS: True
116+
run:
117+
pipx run --spec=${{ matrix.python.cibuildwheel }} cibuildwheel --output-dir dist 2>&1
118+
119+
- name: Build and test (macOS)
120+
if: matrix.os.matrix == 'macos'
121+
env:
122+
CIBW_BUILD: ${{ matrix.python.cibw-build }}
114123
CIBW_ARCHS_MACOS: ${{ matrix.os.cibw-archs-macos[matrix.arch.matrix] }}
115124
CIBW_PRERELEASE_PYTHONS: True
116125
run:
117126
pipx run --spec=${{ matrix.python.cibuildwheel }} cibuildwheel --output-dir dist 2>&1
118127

128+
- name: Build and test (Windows)
129+
if: matrix.os.matrix == 'windows'
130+
env:
131+
# pipx warns when its home path contains spaces (common on Windows runners).
132+
# Use a fixed no-space location to avoid pipx path compatibility issues.
133+
PIPX_HOME: 'C:\pipx'
134+
PIPX_BIN_DIR: 'C:\pipx\bin'
135+
# setuptools emits this benign warning in some Windows wheel builds.
136+
PYTHONWARNINGS: 'ignore:.*Py_DEBUG.*ABI tag may be incorrect:RuntimeWarning'
137+
CIBW_BUILD: ${{ matrix.python.cibw-build }}
138+
CIBW_PRERELEASE_PYTHONS: True
139+
run:
140+
pipx run --spec=${{ matrix.python.cibuildwheel }} cibuildwheel --output-dir dist 2>&1
141+
119142
- name: Upload artifacts
120143
uses: actions/upload-artifact@v5
121144
with:

rust_bindings/build.rs

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ fn main() {
2323
.to_path_buf();
2424
}
2525

26-
let dst = Config::new(src_dir.as_path())
26+
let mut config = Config::new(src_dir.as_path());
27+
config
2728
.build_target("chiavdfc_static")
2829
.define("BUILD_CHIAVDFC", "ON")
2930
.env("BUILD_VDF_CLIENT", "N")
@@ -35,8 +36,20 @@ fn main() {
3536
} else {
3637
"OFF"
3738
},
38-
)
39-
.build();
39+
);
40+
41+
let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap_or_default();
42+
let target_env = std::env::var("CARGO_CFG_TARGET_ENV").unwrap_or_default();
43+
44+
if target_os == "windows" && target_env == "msvc" {
45+
// Rust MSVC links against msvcrt in both debug/release test builds.
46+
// Keep CMake-produced static libs on the same CRT to avoid *_dbg unresolved symbols.
47+
config
48+
.define("CMAKE_POLICY_DEFAULT_CMP0091", "NEW")
49+
.define("CMAKE_MSVC_RUNTIME_LIBRARY", "MultiThreadedDLL");
50+
}
51+
52+
let dst = config.build();
4053

4154
println!("cargo:rustc-link-lib=static=chiavdfc");
4255

@@ -49,7 +62,7 @@ fn main() {
4962
.unwrap()
5063
);
5164

52-
if cfg!(target_os = "windows") {
65+
if target_os == "windows" {
5366
println!("cargo:rustc-link-lib=static=mpir");
5467
println!(
5568
"cargo:rustc-link-search=native={}",
@@ -60,7 +73,7 @@ fn main() {
6073
.to_str()
6174
.unwrap()
6275
);
63-
} else if cfg!(target_os = "macos") {
76+
} else if target_os == "macos" {
6477
println!("cargo:rustc-link-lib=static=gmp");
6578
let homebrew_path = if fs::metadata("/opt/homebrew").is_ok() {
6679
"/opt/homebrew/lib"

setup.py

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,14 @@
11
import os
22
import platform
3-
import shutil
43
import subprocess
54
import sys
65
from pathlib import Path
76

87
from setuptools import Command, Extension, setup
98
from setuptools.command.build import build
109
from setuptools.command.build_ext import build_ext
11-
from setuptools.command.install import install
1210

1311
BUILD_HOOKS = []
14-
INSTALL_HOOKS = []
15-
16-
17-
def add_install_hook(hook):
18-
INSTALL_HOOKS.append(hook)
1912

2013

2114
def add_build_hook(hook):
@@ -28,29 +21,20 @@ def __init__(self, dist):
2821
Command.__init__(self, dist)
2922

3023
def initialize_options(self, *args):
31-
self.install_dir = None
3224
self.build_dir = None
3325

3426
def finalize_options(self):
3527
self.set_undefined_options("build", ("build_scripts", "build_dir"))
36-
self.set_undefined_options(
37-
"install",
38-
("install_platlib", "install_dir"),
39-
)
4028

4129
def run(self):
4230
for _ in self.hooks:
43-
_(install_dir=self.install_dir, build_dir=self.build_dir)
31+
_(build_dir=self.build_dir)
4432

4533

4634
class build_hook(HookCommand):
4735
hooks = BUILD_HOOKS
4836

4937

50-
class install_hook(HookCommand):
51-
hooks = INSTALL_HOOKS
52-
53-
5438
############################################
5539

5640

@@ -60,17 +44,6 @@ def __init__(self, name, sourcedir=""):
6044
self.sourcedir = os.path.abspath(sourcedir)
6145

6246

63-
def copy_vdf_client(build_dir, install_dir):
64-
shutil.copy("src/vdf_client", install_dir)
65-
shutil.copy("src/prover_test", install_dir)
66-
shutil.copy("src/1weso_test", install_dir)
67-
shutil.copy("src/2weso_test", install_dir)
68-
69-
70-
def copy_vdf_bench(build_dir, install_dir):
71-
shutil.copy("src/vdf_bench", install_dir)
72-
73-
7447
def invoke_make(**kwargs):
7548
subprocess.check_output("make -C src -f Makefile.vdf-client", shell=True)
7649

@@ -82,12 +55,6 @@ def invoke_make(**kwargs):
8255
if BUILD_VDF_CLIENT or BUILD_VDF_BENCH:
8356
add_build_hook(invoke_make)
8457

85-
if BUILD_VDF_CLIENT:
86-
add_install_hook(copy_vdf_client)
87-
88-
if BUILD_VDF_BENCH:
89-
add_install_hook(copy_vdf_bench)
90-
9158

9259
class CMakeBuild(build_ext):
9360
def run(self):
@@ -107,7 +74,7 @@ def build_extension(self, ext):
10774
extdir = os.path.abspath(os.path.dirname(self.get_ext_fullpath(ext.name)))
10875
cmake_args = [
10976
"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=" + str(extdir),
110-
"-DPYTHON_EXECUTABLE=" + sys.executable,
77+
"-DPython_EXECUTABLE=" + sys.executable,
11178
]
11279

11380
cfg = "Debug" if self.debug else "Release"
@@ -133,7 +100,6 @@ def build_extension(self, ext):
133100

134101

135102
build.sub_commands.append(("build_hook", lambda x: True)) # type: ignore
136-
install.sub_commands.append(("install_hook", lambda x: True))
137103

138104
# Wheel metadata generation on Windows can run with a non-UTF8 default encoding.
139105
# Read `README.md` explicitly as UTF-8 so `long_description` is robust across runners.
@@ -151,8 +117,6 @@ def build_extension(self, ext):
151117
long_description_content_type="text/markdown",
152118
url="https://github.com/Chia-Network/chiavdf",
153119
ext_modules=[CMakeExtension("chiavdf", "src")],
154-
cmdclass=dict(
155-
build_ext=CMakeBuild, install_hook=install_hook, build_hook=build_hook
156-
),
120+
cmdclass=dict(build_ext=CMakeBuild, build_hook=build_hook),
157121
zip_safe=False,
158122
)

src/1weso_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ int main(int argc, char const* argv[]) try
3636
int d_bits = 1024;
3737
integer D = CreateDiscriminant(challenge_hash, d_bits);
3838

39-
if (getenv( "warn_on_corruption_in_production" )!=nullptr) {
39+
if (env_flag("warn_on_corruption_in_production")) {
4040
warn_on_corruption_in_production=true;
4141
}
4242
set_rounding_mode();

src/2weso_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ int main(int argc, char const* argv[]) try
4444
std::vector<uint8_t> challenge_hash({0, 0, 1, 2, 3, 3, 4, 4});
4545
integer D = CreateDiscriminant(challenge_hash, 1024);
4646

47-
if (getenv( "warn_on_corruption_in_production" )!=nullptr) {
47+
if (env_flag("warn_on_corruption_in_production")) {
4848
warn_on_corruption_in_production=true;
4949
}
5050
set_rounding_mode();

src/CMakeLists.txt

Lines changed: 60 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CMAKE_MINIMUM_REQUIRED(VERSION 3.14 FATAL_ERROR)
1+
CMAKE_MINIMUM_REQUIRED(VERSION 3.18 FATAL_ERROR)
22
option(BUILD_CHIAVDFC "Build the chiavdfc shared library" OFF)
33
option(BUILD_PYTHON "Build the python bindings for chiavdf" ON)
44
option(BUILD_VDF_CLIENT "Build the vdf_client binary" OFF)
@@ -8,6 +8,7 @@ option(BUILD_HW_TOOLS "Build hardware timelord tools" OFF)
88
option(ENABLE_GNU_ASM "Enable GNU-style asm pipeline on x86/x64" ON)
99
option(GENERATE_ASM_TRACKING_DATA "Emit asm tracking instrumentation data from compile_asm" OFF)
1010
option(HARDENING "Enable hardening" OFF)
11+
option(REQUIRE_MPIRXX "Require mpirxx/gmpxx C++ wrapper library on Windows" OFF)
1112

1213
set(CMAKE_CXX_STANDARD 17)
1314
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -44,6 +45,15 @@ set(CMAKE_MODULE_PATH
4445

4546
if(MSVC)
4647
add_compile_options(/EHsc)
48+
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
49+
# Keep Windows clang-cl output focused on actionable issues.
50+
# Keep this list minimal and avoid broad suppressions globally.
51+
add_compile_options(
52+
"/clang:-Qunused-arguments"
53+
"/clang:-Wno-unused-command-line-argument"
54+
"/clang:-Wno-unused-private-field"
55+
)
56+
endif()
4757
if(NOT CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
4858
# MSVC does not provide the GNU intrinsics headers used by compile_asm.
4959
set(ENABLE_GNU_ASM OFF CACHE BOOL "Enable GNU-style asm pipeline on x86/x64" FORCE)
@@ -60,7 +70,7 @@ if(APPLE)
6070
endif()
6171

6272
if(WIN32)
63-
add_compile_definitions(CHIA_WINDOWS NOMINMAX WIN32_LEAN_AND_MEAN)
73+
add_compile_definitions(CHIA_WINDOWS NOMINMAX WIN32_LEAN_AND_MEAN _WIN32_WINNT=0x0601)
6474
set(MPIR_LIBRARY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../mpir_gc_x64")
6575
set(MPIR_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../mpir_gc_x64")
6676
include_directories(
@@ -87,7 +97,11 @@ if(WIN32)
8797
set(GMPXX_LIBRARIES ${MPIRXX_LIBRARY})
8898
link_libraries(${MPIRXX_LIBRARY})
8999
else()
90-
message(WARNING "MPIRXX library not found; gmpxx iostream operators may be missing")
100+
set(GMPXX_LIBRARIES "")
101+
if(REQUIRE_MPIRXX)
102+
message(FATAL_ERROR "MPIRXX library not found but REQUIRE_MPIRXX=ON")
103+
endif()
104+
message(STATUS "MPIRXX library not found; continuing without gmpxx iostream operators")
91105
endif()
92106

93107
list(APPEND CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../mpir_gc_x64")
@@ -195,12 +209,33 @@ if(ENABLE_GNU_ASM AND (CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|AMD64|i[3-6]86)$
195209
endif()
196210
197211
if(BUILD_PYTHON)
198-
FetchContent_Declare(
199-
pybind11-src
200-
GIT_REPOSITORY https://github.com/pybind/pybind11.git
201-
GIT_TAG v2.13.6
202-
)
203-
FetchContent_MakeAvailable(pybind11-src)
212+
# Prefer the pybind11 package from the active Python build environment.
213+
# This avoids unnecessary FetchContent downloads and upstream CMake warning noise.
214+
set(PYBIND11_FINDPYTHON ON)
215+
find_package(Python REQUIRED COMPONENTS Interpreter Development.Module)
216+
217+
if(DEFINED Python_EXECUTABLE)
218+
execute_process(
219+
COMMAND "${Python_EXECUTABLE}" -m pybind11 --cmakedir
220+
OUTPUT_VARIABLE PYBIND11_CMAKE_DIR
221+
OUTPUT_STRIP_TRAILING_WHITESPACE
222+
ERROR_QUIET
223+
RESULT_VARIABLE PYBIND11_CMAKEDIR_RESULT
224+
)
225+
if(PYBIND11_CMAKEDIR_RESULT EQUAL 0 AND EXISTS "${PYBIND11_CMAKE_DIR}")
226+
list(PREPEND CMAKE_PREFIX_PATH "${PYBIND11_CMAKE_DIR}")
227+
endif()
228+
endif()
229+
230+
find_package(pybind11 CONFIG QUIET)
231+
if(NOT pybind11_FOUND)
232+
FetchContent_Declare(
233+
pybind11-src
234+
GIT_REPOSITORY https://github.com/pybind/pybind11.git
235+
GIT_TAG v2.13.6
236+
)
237+
FetchContent_MakeAvailable(pybind11-src)
238+
endif()
204239
205240
pybind11_add_module(chiavdf
206241
${CMAKE_CURRENT_SOURCE_DIR}/python_bindings/fastvdf.cpp
@@ -255,6 +290,11 @@ function(vdf_add_windows_clang_opts target_name)
255290
"$<$<COMPILE_LANGUAGE:C,CXX>:/O2>"
256291
"$<$<COMPILE_LANGUAGE:C,CXX>:/fp:fast>"
257292
"$<$<COMPILE_LANGUAGE:C,CXX>:/clang:-fno-math-errno>"
293+
"$<$<COMPILE_LANGUAGE:C,CXX>:/clang:-Wno-unused-command-line-argument>"
294+
# Finite-math mode can trigger this in transitive/system headers on clang-cl.
295+
# Keep this suppression target-scoped to fast-math targets only.
296+
"$<$<COMPILE_LANGUAGE:C,CXX>:/clang:-Wno-nan-infinity-disabled>"
297+
"$<$<COMPILE_LANGUAGE:CXX>:/clang:-Wno-deprecated-literal-operator>"
258298
)
259299
else()
260300
target_compile_options(
@@ -341,6 +381,13 @@ if(BUILD_VDF_TESTS)
341381
vdf_add_windows_clang_opts(vdf_client_session_test)
342382
gtest_discover_tests(vdf_client_session_test TEST_PREFIX "regression.")
343383
384+
add_executable(checked_cast_test
385+
${CMAKE_CURRENT_SOURCE_DIR}/checked_cast_test.cpp
386+
)
387+
target_link_libraries(checked_cast_test PRIVATE GTest::gtest_main Threads::Threads)
388+
vdf_add_windows_clang_opts(checked_cast_test)
389+
gtest_discover_tests(checked_cast_test TEST_PREFIX "regression.")
390+
344391
endif()
345392
346393
if(BUILD_HW_TOOLS)
@@ -392,6 +439,7 @@ if(BUILD_HW_TOOLS)
392439
target_compile_definitions(hw_test PRIVATE ${VDF_COMMON_DEFINITIONS})
393440
target_include_directories(hw_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/hw ${CMAKE_CURRENT_SOURCE_DIR}/hw/libft4222)
394441
target_link_libraries(hw_test PRIVATE ${GMP_LIBRARIES} ${GMPXX_LIBRARIES} Threads::Threads ${HW_LIBS})
442+
vdf_add_windows_clang_opts(hw_test)
395443
if(APPLE)
396444
target_link_options(hw_test PRIVATE "-Wl,-rpath,@executable_path/hw/libft4222")
397445
endif()
@@ -404,6 +452,7 @@ if(BUILD_HW_TOOLS)
404452
target_compile_definitions(hw_vdf_client PRIVATE ${VDF_COMMON_DEFINITIONS})
405453
target_include_directories(hw_vdf_client PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/hw ${CMAKE_CURRENT_SOURCE_DIR}/hw/libft4222)
406454
target_link_libraries(hw_vdf_client PRIVATE ${GMP_LIBRARIES} ${GMPXX_LIBRARIES} Threads::Threads ${HW_LIBS} ${HW_SOCKET_LIBS})
455+
vdf_add_windows_clang_opts(hw_vdf_client)
407456
if(APPLE)
408457
target_link_options(hw_vdf_client PRIVATE "-Wl,-rpath,@executable_path/hw/libft4222")
409458
endif()
@@ -415,6 +464,7 @@ if(BUILD_HW_TOOLS)
415464
target_compile_definitions(emu_hw_test PRIVATE ${VDF_COMMON_DEFINITIONS})
416465
target_include_directories(emu_hw_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/hw ${CMAKE_CURRENT_SOURCE_DIR}/hw/libft4222)
417466
target_link_libraries(emu_hw_test PRIVATE ${GMP_LIBRARIES} ${GMPXX_LIBRARIES} Threads::Threads)
467+
vdf_add_windows_clang_opts(emu_hw_test)
418468
419469
add_executable(emu_hw_vdf_client
420470
${CMAKE_CURRENT_SOURCE_DIR}/hw/hw_vdf_client.cpp
@@ -423,6 +473,7 @@ if(BUILD_HW_TOOLS)
423473
target_compile_definitions(emu_hw_vdf_client PRIVATE ${VDF_COMMON_DEFINITIONS})
424474
target_include_directories(emu_hw_vdf_client PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/hw ${CMAKE_CURRENT_SOURCE_DIR}/hw/libft4222)
425475
target_link_libraries(emu_hw_vdf_client PRIVATE ${GMP_LIBRARIES} ${GMPXX_LIBRARIES} Threads::Threads ${HW_SOCKET_LIBS})
476+
vdf_add_windows_clang_opts(emu_hw_vdf_client)
426477
endif()
427478
428479
add_executable(verifier_test

src/Makefile.vdf-client

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@ endif
1414
ifeq ($(OS),Windows_NT)
1515
NOPIE =
1616
endif
17-
# macOS arm64 ignores -no_pie and warns; omit to avoid deprecation warnings
17+
# macOS linker warns that -no_pie is deprecated; omit across Darwin targets.
1818
ifeq ($(UNAME),Darwin)
19-
ifneq ($(filter $(ARCH),arm64),)
2019
NOPIE =
2120
endif
22-
endif
2321

2422
CFLAGS += $(LTO_FLAGS) $(NOPIE)
2523
LDFLAGS += $(LTO_FLAGS) $(NOPIE) -g
@@ -57,6 +55,10 @@ endif
5755
ifneq ($(TSAN),)
5856
LDFLAGS += -fsanitize=thread
5957
CXXFLAGS += -g -fsanitize=thread
58+
ifneq (,$(findstring clang, $(shell $(CXX) --version)))
59+
else
60+
CXXFLAGS += -Wno-tsan
61+
endif
6062
endif
6163

6264
.PHONY: all clean

0 commit comments

Comments
 (0)