diff --git a/pw_presubmit/py/pw_presubmit/pigweed_presubmit.py b/pw_presubmit/py/pw_presubmit/pigweed_presubmit.py index 135d3d5a72..5a3f5a0020 100755 --- a/pw_presubmit/py/pw_presubmit/pigweed_presubmit.py +++ b/pw_presubmit/py/pw_presubmit/pigweed_presubmit.py @@ -113,8 +113,7 @@ def gn_full_qemu_check(ctx: PresubmitContext): build.ninja( ctx.output_dir, *_at_all_optimization_levels('qemu_gcc'), - # TODO(pwbug/321) Re-enable clang. - # *_at_all_optimization_levels('qemu_clang'), + *_at_all_optimization_levels('qemu_clang'), ) diff --git a/targets/lm3s6965evb_qemu/BUILD.gn b/targets/lm3s6965evb_qemu/BUILD.gn index 230221c865..56481dd5e1 100644 --- a/targets/lm3s6965evb_qemu/BUILD.gn +++ b/targets/lm3s6965evb_qemu/BUILD.gn @@ -23,6 +23,12 @@ generate_toolchains("target_toolchains") { toolchains = pw_target_toolchain_lm3s6965evb_qemu_list } +# TODO(b/232587313): This config is only used in the clang build for this +# target, see target_toolchains.gni or the associated bug for more details. +config("disable_lock_annotations") { + cflags = [ "-Wno-thread-safety-analysis" ] +} + if (current_toolchain != default_toolchain) { pw_source_set("pre_init") { public_deps = [ diff --git a/targets/lm3s6965evb_qemu/target_toolchains.gni b/targets/lm3s6965evb_qemu/target_toolchains.gni index 3a271b7c65..b96d11f106 100644 --- a/targets/lm3s6965evb_qemu/target_toolchains.gni +++ b/targets/lm3s6965evb_qemu/target_toolchains.gni @@ -80,6 +80,14 @@ _clang_target_default_configs = [ "$dir_pw_build:clang_thread_safety_warnings", "$dir_pw_build:extra_strict_warnings", "$dir_pw_toolchain/arm_clang:enable_float_printf", + + # TODO(b/232587313): Disable lock annotations for this target because the + # clang toolchain currently relies on the standard library headers provided by + # arm-none-eabi-gcc, and thus do not have thread safety lock annotations on + # things like std::lock_guard. Thread safety checks will not work until + # the clang-based ARM toolchain uses a C++ standard library that has these + # annotations set up. + "$dir_pigweed/targets/lm3s6965evb_qemu:disable_lock_annotations", ] pw_target_toolchain_lm3s6965evb_qemu = {