Skip to content

Commit 8551c5b

Browse files
committed
Drop ld hack in favor of LibAFL improvements
1 parent e90127f commit 8551c5b

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

Dockerfile.LibAFL

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ RUN git clone --depth 1 https://github.com/AFLplusplus/LibAFL /libafl
3535
# Build libFuzzer.a from LibAFL's libfuzzer runtime
3636
WORKDIR /libafl/crates/libafl_libfuzzer_runtime
3737

38-
RUN bash build.sh
38+
RUN bash build.sh --cargo-args "--no-default-features --features no_link_main"
3939

4040
# Stage 2: Build ruzzy with LibAFL's libFuzzer
4141
FROM ruby:$RUBY_VERSION-slim-bookworm
@@ -51,12 +51,9 @@ RUN echo "deb http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-$LLVM_VERSIO
5151
&& echo "deb-src http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-$LLVM_VERSION main" >> /etc/apt/sources.list.d/llvm.list \
5252
&& wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key > /etc/apt/trusted.gpg.d/apt.llvm.org.asc
5353

54-
# Install lld alongside clang. LibAFL's libFuzzer.a contains a .preinit_array
55-
# section that the GNU linker rejects in shared objects. lld handles this correctly.
5654
RUN apt update && apt install -y \
5755
build-essential \
5856
clang-$LLVM_VERSION \
59-
lld-$LLVM_VERSION \
6057
&& rm -rf /var/lib/apt/lists/*
6158

6259
ENV APP_DIR="/app"
@@ -69,10 +66,6 @@ ENV LDSHARED="clang-$LLVM_VERSION -shared"
6966
ENV LDSHAREDXX="clang++-$LLVM_VERSION -shared"
7067
ENV ASAN_SYMBOLIZER_PATH="/usr/bin/llvm-symbolizer-$LLVM_VERSION"
7168

72-
# Use lld for linking. LibAFL's libFuzzer.a contains a .preinit_array section
73-
# that the GNU linker rejects in shared objects. lld handles this correctly.
74-
ENV LD="lld-$LLVM_VERSION"
75-
7669
ENV MAKE="make --environment-overrides V=1"
7770

7871
ENV ASAN_OPTIONS="symbolize=1:allocator_may_return_null=1:detect_leaks=0:use_sigaltstack=0"

0 commit comments

Comments
 (0)