radare2: fix build (#7077)

* radare2: fix build

* radare2: add missing license headers
This commit is contained in:
DavidKorczynski 2021-12-28 22:13:22 +00:00 committed by GitHub
parent 8cf2a888fa
commit 4b3f2b56f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 37 additions and 3 deletions

View File

@ -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/

View File

@ -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

View File

@ -1,3 +1,2 @@
[libfuzzer]
close_fd_mask=3
detect_leaks=0