Skip to content

Commit 069f0bb

Browse files
committed
Build libzstd from source because the EPEL package is built without fPIC.
1 parent 2284ceb commit 069f0bb

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-2
lines changed

src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile

+4-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ RUN sed -i /etc/yum.repos.d/*.repo -e 's!^mirrorlist!#mirrorlist!' \
1212
RUN sed -i 's/enabled=1/enabled=0/' /etc/yum/pluginconf.d/fastestmirror.conf
1313

1414
RUN yum upgrade -y && \
15-
yum install -y epel-release && \
1615
yum install -y \
1716
automake \
1817
bzip2 \
@@ -25,7 +24,6 @@ RUN yum upgrade -y && \
2524
libedit-devel \
2625
libstdc++-devel.i686 \
2726
libstdc++-devel.x86_64 \
28-
libzstd-static.x86_64 \
2927
make \
3028
ncurses-devel \
3129
openssl-devel \
@@ -58,6 +56,10 @@ RUN ./build-gcc.sh && yum remove -y gcc gcc-c++
5856
COPY scripts/cmake.sh /tmp/
5957
RUN ./cmake.sh
6058

59+
# rustc's LLVM needs zstd.
60+
COPY scripts/zstd.sh /tmp/
61+
RUN ./zstd.sh
62+
6163
# Now build LLVM+Clang, afterwards configuring further compilations to use the
6264
# clang/clang++ compilers.
6365
COPY host-x86_64/dist-x86_64-linux/build-clang.sh /tmp/

src/ci/docker/scripts/zstd.sh

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
set -ex
3+
4+
hide_output() {
5+
set +x
6+
on_err="
7+
echo ERROR: An error was encountered with the build.
8+
cat /tmp/zstd_build.log
9+
exit 1
10+
"
11+
trap "$on_err" ERR
12+
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
13+
PING_LOOP_PID=$!
14+
"$@" &> /tmp/zstd_build.log
15+
trap - ERR
16+
kill $PING_LOOP_PID
17+
rm /tmp/zstd_build.log
18+
set -x
19+
}
20+
21+
ZSTD=1.5.6
22+
curl -L https://github.com/facebook/zstd/releases/download/v$ZSTD/zstd-$ZSTD.tar.gz | tar xzf -
23+
24+
cd zstd-$ZSTD
25+
CFLAGS=-fPIC hide_output make -j$(nproc) VERBOSE=1
26+
hide_output make install
27+
28+
cd ..
29+
rm -rf zstd-$ZSTD

0 commit comments

Comments
 (0)