lm3s6965evb_qemu: Fix clang build

Silences an unsupported warning in the lm3s6965evb_qemu clang build, and
then restores the build step to the tryjob so the clang ARM build is run
in CI/CQ again.

Fixes: pwbug/321
Change-Id: I858cff9d4aabf2bfa16d79a9e37dbda15c9763ed
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/94582
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Pigweed-Auto-Submit: Armando Montanez <amontanez@google.com>
diff --git a/pw_presubmit/py/pw_presubmit/pigweed_presubmit.py b/pw_presubmit/py/pw_presubmit/pigweed_presubmit.py
index 135d3d5..5a3f5a0 100755
--- a/pw_presubmit/py/pw_presubmit/pigweed_presubmit.py
+++ b/pw_presubmit/py/pw_presubmit/pigweed_presubmit.py
@@ -113,8 +113,7 @@
     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 230221c..56481dd 100644
--- a/targets/lm3s6965evb_qemu/BUILD.gn
+++ b/targets/lm3s6965evb_qemu/BUILD.gn
@@ -23,6 +23,12 @@
   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 3a271b7..b96d11f 100644
--- a/targets/lm3s6965evb_qemu/target_toolchains.gni
+++ b/targets/lm3s6965evb_qemu/target_toolchains.gni
@@ -80,6 +80,14 @@
   "$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 = {