diff --git a/projects/proxygen/Dockerfile b/projects/proxygen/Dockerfile index 82e3521d4..26a7e32a2 100644 --- a/projects/proxygen/Dockerfile +++ b/projects/proxygen/Dockerfile @@ -134,7 +134,10 @@ RUN apt-get install -y \ libsodium-dev \ libdouble-conversion-dev +# Install patchelf so we can fix path to libunwind +RUN apt-get install patchelf + # Fetch source and copy over files RUN git clone --depth 1 https://github.com/facebook/proxygen.git proxygen WORKDIR proxygen -COPY build.sh $SRC/ +COPY build.sh $SRC/ \ No newline at end of file diff --git a/projects/proxygen/build.sh b/projects/proxygen/build.sh index 491755126..cec0359a6 100755 --- a/projects/proxygen/build.sh +++ b/projects/proxygen/build.sh @@ -16,8 +16,19 @@ ################################################################################ cd proxygen + +# Link to, and copy over, libunwind # We need to link to libunwind to ensure exception handling works # See https://clang.llvm.org/docs/Toolchain.html#unwind-library export LDFLAGS="-lunwind" +mkdir -p $OUT/lib +cp /usr/lib/x86_64-linux-gnu/libunwind.so.8 $OUT/lib/ + +# Build everything ./build.sh -m --no-install-dependencies --build-for-fuzzing -find ./_build/proxygen/fuzzers -type f -executable -exec cp {} $OUT/ \; + +# Patch rpath so fuzzers can find libunwind +find ./_build/proxygen/fuzzers -type f -executable -exec patchelf --set-rpath "$OUT/lib" {} \; + +# Copy fuzzers over to the destination +find ./_build/proxygen/fuzzers -type f -executable -exec cp {} $OUT/ \; \ No newline at end of file diff --git a/projects/proxygen/project.yaml b/projects/proxygen/project.yaml index 8385d0363..715009800 100644 --- a/projects/proxygen/project.yaml +++ b/projects/proxygen/project.yaml @@ -8,6 +8,7 @@ vendor_ccs: - "oss-fuzz@fb.com" fuzzing_engines: - libfuzzer + - afl sanitizers: - address - undefined