Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: create libm.a instead of ld script on x86_64 for gnu static linkage #83

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions images/llvm_runner/ubuntu22-llvm17.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ RUN apt-get update && \
g++-9=9.* \
software-properties-common=0.99.* \
libz3-dev=4.8.* \
file=1:5.* \
nano=6.* \
&& rm -rf /var/lib/apt/lists/*

# Install LLVM 17
Expand Down Expand Up @@ -78,3 +80,12 @@ ENV PATH=/usr/lib/llvm-17/bin:${PATH} \
LD_LIBRARY_PATH=/usr/lib/llvm-17/lib:${LD_LIBRARY_PATH} \
LLVM_VERSION=17 \
CI_RUNNING=true

# Replace default libm.a which is a linker script on x86_64 to an actual lib implementation
# to allow Rust to link against it without issues
ARG TARGETPLATFORM
RUN if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then \
rm -f /lib/x86_64-linux-gnu/libm.a && \
ar -cqT /lib/x86_64-linux-gnu/libm.a /lib/x86_64-linux-gnu/libm-2.35.a /lib/x86_64-linux-gnu/libmvec.a && \
bash -c 'ar -M <<< $(echo -e "create /lib/x86_64-linux-gnu/libm.a\naddlib /lib/x86_64-linux-gnu/libm.a\nsave\nend")'; \
fi