build: Link libatomic statically on Linux aarch64 (#3120)

This commit is contained in:
Ayaz Salikhov
2026-06-29 10:57:54 +01:00
committed by GitHub
parent 6bc8ad1def
commit 9da5f7a995
2 changed files with 12 additions and 6 deletions

View File

@@ -49,6 +49,18 @@ if(
)
endif()
# On aarch64, libatomic is required for atomic operations. It is not needed on x86_64.
# Linking it statically on Linux
if(
CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64"
AND CMAKE_SYSTEM_NAME STREQUAL "Linux"
)
target_link_options(
clio_options
INTERFACE -Wl,--push-state -Wl,-Bstatic -latomic -Wl,--pop-state
)
endif()
# Apply sanitizer instrumentation if requested and define SANITIZERS_ENABLED.
# Must come before the modules and subdirectories below that key off it.
include(Sanitizers)

View File

@@ -1,11 +1,5 @@
FROM ubuntu:22.04
RUN apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
libatomic1 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN groupadd -g 10001 clio \
&& useradd -u 10000 -g 10001 -s /bin/bash clio