Skip to content

Commit a9e28e7

Browse files
author
Brian J. Cardiff
authored
Check with ldd the compiler is statically linked (#37)
* Use different location for crystal-musl binary
1 parent ab68379 commit a9e28e7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

linux/Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,13 @@ RUN git clone https://github.com/crystal-lang/crystal \
9090
&& git checkout ${crystal_sha1} \
9191
\
9292
&& make deps \
93-
&& mkdir .build \
94-
&& cc '/crystal-musl.o' -o '.build/crystal' -rdynamic src/llvm/ext/llvm_ext.o `llvm-config --libs --system-libs --ldflags` -lstdc++ -lpcre -lm -lgc -lpthread src/ext/libcrystal.a -levent -lrt \
93+
&& mkdir -p .build/crystal-musl \
94+
&& cc '/crystal-musl.o' -o '.build/crystal-musl/crystal' -rdynamic src/llvm/ext/llvm_ext.o `llvm-config --libs --system-libs --ldflags` -lstdc++ -lpcre -lm -lgc -lpthread src/ext/libcrystal.a -levent -lrt \
95+
&& export PATH=.build/crystal-musl/:$PATH \
9596
\
96-
&& touch src/compiler/crystal.cr \
9797
&& make crystal stats=true static=true ${release:+release=true} \
98-
CRYSTAL_CONFIG_TARGET=${gnu_target}
98+
CRYSTAL_CONFIG_TARGET=${gnu_target} \
99+
&& ([ "$(ldd .build/crystal | wc -l)" -eq "1" ] || { echo './build/crystal is not statically linked'; ldd .build/crystal; exit 1; })
99100

100101
# Build shards
101102
ARG shards_version

0 commit comments

Comments
 (0)