mirror of https://github.com/google/oss-fuzz.git
[infra] moved env variables into Dockerfiles
This commit is contained in:
parent
3b9b8fe433
commit
a4b1f6c2a5
|
@ -1,4 +1,4 @@
|
|||
#!/bin/bash -ex
|
||||
#!/bin/bash -eu
|
||||
. /env
|
||||
|
||||
cd /src/expat/expat
|
||||
|
|
|
@ -38,21 +38,26 @@ WORKDIR /work/llvm
|
|||
RUN cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DLIBCXX_ENABLE_SHARED=OFF -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON /src/llvm
|
||||
RUN ninja
|
||||
RUN ninja install
|
||||
RUN rm -rf /work/llvm
|
||||
|
||||
# Copy libfuzzer sources
|
||||
RUN mkdir /src/libfuzzer
|
||||
RUN cp -r /src/llvm/lib/Fuzzer/* /src/libfuzzer/
|
||||
|
||||
# Cleanup
|
||||
RUN rm -rf /work/llvm
|
||||
RUN rm -rf /src/llvm
|
||||
|
||||
# RUN ln -s /work/llvm/bin/lld /work/llvm/bin/ld
|
||||
|
||||
RUN apt-get remove --purge -y $LLVM_DEP_PACKAGES
|
||||
RUN apt-get autoremove -y
|
||||
|
||||
# Setup the environment.
|
||||
ENV CC "clang"
|
||||
ENV CXX "clang++"
|
||||
ENV CCC "clang++"
|
||||
|
||||
ENV CFLAGS "-g"
|
||||
ENV CXXFLAGS_EXTRA "-stdlib=libc++"
|
||||
ENV CXXFLAGS "$CFLAGS $CXXFLAGS_EXTRA"
|
||||
|
||||
ENV LDFLAGS "-Wl,-Bstatic -lc++ -lc++abi -Wl,-Bdynamic"
|
||||
|
||||
COPY env /
|
||||
|
|
|
@ -27,10 +27,8 @@ $CXX -g -std=c++11 -stdlib=libc++ $sanitizer_flags -c /src/libfuzzer/*.cpp -I/sr
|
|||
echo "Done."
|
||||
popd > /dev/null
|
||||
|
||||
export CFLAGS="-g $sanitizer_flags $cov_flags"
|
||||
export LDFLAGS="-Wl,-Bstatic -lc++ -lc++abi -Wl,-Bdynamic"
|
||||
export LIBCXX_FLAGS="-stdlib=libc++"
|
||||
export CXXFLAGS="$CFLAGS $LIBCXX_FLAGS "
|
||||
export CXXFLAGS="$CFLAGS $LIBCXX_FLAGS"
|
||||
|
||||
echo "CC=$CC"
|
||||
echo "CXX=$CXX"
|
||||
|
|
|
@ -28,5 +28,8 @@ ENV cov_flags="-fsanitize-coverage=edge,indirect-calls,8bit-counters"
|
|||
|
||||
ENV ASAN_OPTIONS="symbolize=1"
|
||||
|
||||
ENV CFLAGS "$CFLAGS $sanitizer_flags $cov_flags"
|
||||
ENV CXXFLAGS "$CFLAGS $CXXFLAGS_EXTRA"
|
||||
|
||||
RUN mkdir /out
|
||||
VOLUME /out
|
||||
|
|
Loading…
Reference in New Issue