Fix __muloti4 linker error on Clang 13

Add `-rtlib=compiler-rt` linker flags for the Clang 13 CI build.

Clang 13 generates calls to __muloti4 (a 128-bit overflow-checked multiplication intrinsic) for signed 64-bit multiplication with overflow detection. This symbol is provided by LLVM's compiler-rt but is missing from GNU's libgcc, which is the default runtime library on Ubuntu.

Related issues:

- https://github.com/llvm/llvm-project/issues/14841
- https://github.com/abseil/abseil-cpp/issues/841
- https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=244169

PiperOrigin-RevId: 860529686
Change-Id: If58dc0328aa1dd87aef8ea02da555f57ad96b02c
This commit is contained in:
Yuval Tassa
2026-01-24 08:15:22 -08:00
committed by Copybara-Service
parent e9c61694e1
commit e48da1e38c
+2
View File
@@ -114,6 +114,8 @@ jobs:
-G Ninja
-DCMAKE_C_COMPILER:STRING=clang-13
-DCMAKE_CXX_COMPILER:STRING=clang++-13
-DCMAKE_EXE_LINKER_FLAGS:STRING=-rtlib=compiler-rt
-DCMAKE_SHARED_LINKER_FLAGS:STRING=-rtlib=compiler-rt
-DMUJOCO_HARDEN:BOOL=ON
tmpdir: "/tmp"
- os: macos-15