From 4b3f2b56f77628532939379e20a28b86c82bb3fe Mon Sep 17 00:00:00 2001 From: DavidKorczynski Date: Tue, 28 Dec 2021 22:13:22 +0000 Subject: [PATCH] radare2: fix build (#7077) * radare2: fix build * radare2: add missing license headers --- projects/radare2/Dockerfile | 18 +++++++++++++++++- projects/radare2/build.sh | 21 ++++++++++++++++++++- projects/radare2/default.options | 1 - 3 files changed, 37 insertions(+), 3 deletions(-) diff --git a/projects/radare2/Dockerfile b/projects/radare2/Dockerfile index 5b2f403b1..aef9eb10d 100644 --- a/projects/radare2/Dockerfile +++ b/projects/radare2/Dockerfile @@ -1,8 +1,24 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + FROM gcr.io/oss-fuzz-base/base-builder RUN apt-get update +RUN apt-get install -y pkg-config wget RUN git clone https://github.com/radareorg/radare2 radare2 RUN git clone https://github.com/radareorg/radare2-fuzz radare2-fuzz WORKDIR radare2 COPY build.sh $SRC/ COPY *.options $SRC/ - diff --git a/projects/radare2/build.sh b/projects/radare2/build.sh index 94f72f106..034531fc0 100755 --- a/projects/radare2/build.sh +++ b/projects/radare2/build.sh @@ -1,14 +1,33 @@ #!/bin/bash -eu +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ export USERCC=$CC export HOST_CC=$CC +export NOLTO=1 -sys/static.sh +sed 's/gcc-ar/llvm-ar/g' -i sys/static.sh +sys/static.sh || true cp -r r2-static $OUT/ cp -r ../radare2-fuzz/targets . export RADARE2_STATIC_BUILD=$OUT/r2-static +export CXXFLAGS="${CXXFLAGS} -I ${RADARE2_STATIC_BUILD}/usr/include/libr/sdb" + cd targets make diff --git a/projects/radare2/default.options b/projects/radare2/default.options index 08e7afb7e..f9d09656c 100644 --- a/projects/radare2/default.options +++ b/projects/radare2/default.options @@ -1,3 +1,2 @@ [libfuzzer] -close_fd_mask=3 detect_leaks=0