unit-test: add workaround for clang-20 errors
We are seeing pervasive issues with clang-20 with boost async_wait
calls mixed with std::bind_front:
```
/usr/local/include/sdbusplus/asio/connection.hpp:411:15: error: no matching member function for call to 'async_wait'
411 | timer.async_wait(std::bind_front(&connection::on_timer_event, this));
```
This issue is noted upstream[1] and is currently unsolved, but we
discovered we can solve this by passing `-fno-builtin-std-forward_like`
as a clang compiler option. Add this to the unit-test scripts when
the `CXX` is clang.
[1]: https://github.com/llvm/llvm-project/issues/101614
Tested: Ran locally against dbus-sensors and observed the compile
issues are resolved.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I3e5a68320df10fd835613da452c0fcefa95e6a22
diff --git a/scripts/unit-test.py b/scripts/unit-test.py
index 8f28ee0..1b3d1f5 100755
--- a/scripts/unit-test.py
+++ b/scripts/unit-test.py
@@ -1062,7 +1062,10 @@
# Run clang-tidy only if the project has a configuration
if os.path.isfile(".clang-tidy"):
os.environ["CC"] = "clang"
- os.environ["CXX"] = "clang++"
+ # Clang-20 currently has some issue with libstdcpp's
+ # std::forward_like which results in a bunch of compile errors.
+ # Adding -fno-builtin-std-forward_like causes them to go away.
+ os.environ["CXX"] = "clang++ -fno-builtin-std-forward_like"
with TemporaryDirectory(prefix="build", dir=".") as build_dir:
check_call_cmd("meson", "setup", build_dir)
if not os.path.isfile(".openbmc-no-clang"):