mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-26 01:00:36 +08:00
build(setup): install the clang sanitizer runtime in ubuntu.sh
ubuntu.sh installs clang with --no-install-recommends. Since Ubuntu 24.04 the sanitizer runtimes (libclang_rt.asan and friends) are a separate package that clang only recommends, so a host or px4-dev image set up by this script cannot link anything built with -fsanitize. The fuzz tests build that way. With clang, fuzzing mode turns on ASan, the abseil configure checks fail to link, and CMake reports a misleading "Could NOT find Threads". clang-tidy.yml installs the runtime by hand for this reason, and the nightly fuzzing job needs the same workaround to move off its old image. Install libclang-rt-dev, the unversioned package that follows the default clang, on both amd64 and arm64. Skip it on 22.04, where clang 14 still carries the runtimes and the package does not exist. Assisted-by: Claude:claude-fable-5-2 Signed-off-by: Ramon Roche <mrpollo@gmail.com>
This commit is contained in:
1 parent
650ec04975
commit
f01b375512
1 file changed
+11
@@ -171,6 +171,17 @@ if [[ $INSTALL_NUTTX == "true" ]]; then
|
||||
vim-common \
|
||||
;
|
||||
|
||||
# Since Ubuntu 24.04 the clang sanitizer runtimes (ASan, UBSan) are a
|
||||
# separate package that clang only recommends, so --no-install-recommends
|
||||
# leaves them out and any -fsanitize build fails to link. The fuzz tests
|
||||
# need them. On 22.04 they still ship with clang and the package does
|
||||
# not exist.
|
||||
if [[ "${UBUNTU_RELEASE}" != "22.04" ]]; then
|
||||
sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \
|
||||
libclang-rt-dev \
|
||||
;
|
||||
fi
|
||||
|
||||
if [[ "${INSTALL_ARCH}" == "x86_64" ]]; then
|
||||
sudo DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \
|
||||
g++-multilib \
|
||||
|
||||
Reference in new issue
Block a user