Project Orbit: Fix Dockerfile (#5029)

* Project Orbit: Fix Dockerfile

This change is necessary to reflect the recent branch renaming on
github.com/google/orbit from master to main.

* Project Orbit: Fix build.sh

The build is fixed by manually setting flags for building llvm.

* Addressed review comments
This commit is contained in:
antonrohr 2021-01-27 22:26:36 +01:00 committed by GitHub
parent 191d8a640c
commit 5e2ea3e06b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 8 deletions

View File

@ -14,15 +14,14 @@
# #
################################################################################ ################################################################################
#&& curl -SL https://github.com/google/orbit/archive/master.tar.gz \
FROM gcr.io/oss-fuzz-base/base-builder FROM gcr.io/oss-fuzz-base/base-builder
RUN apt-get update && apt-get install -y m4 libglu1-mesa-dev mesa-common-dev \ RUN apt-get update && apt-get install -y m4 libglu1-mesa-dev mesa-common-dev \
libxmu-dev libxi-dev pkg-config libxxf86vm-dev patchelf libxmu-dev libxi-dev pkg-config libxxf86vm-dev patchelf
ADD https://github.com/google/orbit/archive/master.tar.gz $SRC/ ADD https://github.com/google/orbit/archive/main.tar.gz $SRC/
RUN mkdir -p $SRC/orbit && tar -xzf $SRC/master.tar.gz \ RUN mkdir -p $SRC/orbit && tar -xzf $SRC/main.tar.gz \
-C $SRC/orbit/ --strip-components 1; rm -f $SRC/master.tar.gz -C $SRC/orbit/ --strip-components 1; rm -f $SRC/main.tar.gz
WORKDIR $SRC WORKDIR $SRC/orbit
COPY build.sh $SRC/ COPY build.sh $SRC/
# That's a hack. The service needs to have a more recent kernel than what the # That's a hack. The service needs to have a more recent kernel than what the

View File

@ -31,8 +31,16 @@ echo "CXXFLAGS=\$BASE_CXXFLAGS" >> ~/.conan/profiles/default
echo "LDFLAGS=\$BASE_LDFLAGS" >> ~/.conan/profiles/default echo "LDFLAGS=\$BASE_LDFLAGS" >> ~/.conan/profiles/default
echo "OrbitProfiler:CFLAGS=\$BASE_CFLAGS $CFLAGS" >> ~/.conan/profiles/default echo "OrbitProfiler:CFLAGS=\$BASE_CFLAGS $CFLAGS" >> ~/.conan/profiles/default
echo "OrbitProfiler:CXXFLAGS=\$BASE_CFLAGS $CXXFLAGS" >> ~/.conan/profiles/default echo "OrbitProfiler:CXXFLAGS=\$BASE_CFLAGS $CXXFLAGS" >> ~/.conan/profiles/default
echo "llvm:CFLAGS=\$BASE_CFLAGS $CFLAGS" >> ~/.conan/profiles/default
echo "llvm:CXXFLAGS=\$BASE_CXXFLAGS $CXXFLAGS" >> ~/.conan/profiles/default # The following two lines is what should theoretically be correct. The workaround + explanation follows
# echo "llvm:CFLAGS=\$BASE_CFLAGS $CFLAGS" >> ~/.conan/profiles/default
# echo "llvm:CXXFLAGS=\$BASE_CXXFLAGS $CXXFLAGS" >> ~/.conan/profiles/default
# The $CFLAGS and $CXXFLAGS contains "-fsanitize=address -fsanitize-address-use-after-scope -fsanitize=fuzzer-no-link"
# when this script is called. Since llvm currently cannot be build with address sanitizers,
# the flags are set manually here.
echo "llvm:CFLAGS=\$BASE_CFLAGS -O1 -fno-omit-frame-pointer -gline-tables-only -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION" >> ~/.conan/profiles/default
echo "llvm:CXXFLAGS=\$BASE_CXXFLAGS -O1 -fno-omit-frame-pointer -gline-tables-only -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -stdlib=libc++" >> ~/.conan/profiles/default
$SRC/orbit/build.sh default $SRC/orbit/build.sh default
@ -49,6 +57,6 @@ function copy_fuzzer {
done done
} }
find $SRC/build_default/bin -name \*Fuzzer | while read fuzzer; do find $SRC/orbit/build_default/bin -name \*Fuzzer | while read fuzzer; do
copy_fuzzer "$fuzzer" copy_fuzzer "$fuzzer"
done done