aboutsummaryrefslogtreecommitdiff
path: root/projects/spirv-tools
diff options
context:
space:
mode:
authorAlastair Donaldson <afdx@google.com>2021-08-28 15:42:09 +0100
committerGitHub <noreply@github.com>2021-08-28 07:42:09 -0700
commitf7b1dfb4f8689fc692dd5d70cf532cc5693ed94d (patch)
tree7f5f31a2aeb6c48644d7f84ace047c90e311ca67 /projects/spirv-tools
parent48d5a3e26dc674543236061d6a1bf03c3fb76230 (diff)
downloadoss-fuzz-f7b1dfb4f8689fc692dd5d70cf532cc5693ed94d.tar.gz
Initial project file for SPIR-V Tools fuzzing (#6330)
* Add SPIR-V Tools fuzzer targets Adds fuzzer targets for the SPIR-V Tools project. * Disable honggfuzz, as it was failing in the CI.
Diffstat (limited to 'projects/spirv-tools')
-rw-r--r--projects/spirv-tools/Dockerfile21
-rwxr-xr-xprojects/spirv-tools/build.sh34
-rw-r--r--projects/spirv-tools/project.yaml16
3 files changed, 71 insertions, 0 deletions
diff --git a/projects/spirv-tools/Dockerfile b/projects/spirv-tools/Dockerfile
new file mode 100644
index 000000000..9ef1e805e
--- /dev/null
+++ b/projects/spirv-tools/Dockerfile
@@ -0,0 +1,21 @@
+# 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 && apt-get install -y make autoconf automake libtool ninja-build
+RUN git clone --depth 1 https://github.com/KhronosGroup/SPIRV-Tools.git spirv-tools
+WORKDIR spirv-tools
+COPY build.sh $SRC/
diff --git a/projects/spirv-tools/build.sh b/projects/spirv-tools/build.sh
new file mode 100755
index 000000000..61cc8216f
--- /dev/null
+++ b/projects/spirv-tools/build.sh
@@ -0,0 +1,34 @@
+#!/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.
+#
+################################################################################
+
+git clone https://github.com/KhronosGroup/SPIRV-Headers external/spirv-headers --depth=1
+git clone https://github.com/protocolbuffers/protobuf external/protobuf --branch v3.13.0.1
+
+mkdir build
+cd build
+
+CMAKE_ARGS="-DSPIRV_BUILD_LIBFUZZER_TARGETS=ON"
+
+# With ubsan, RTTI must be enabled due to certain checks (vptr) requiring it.
+if [ $SANITIZER == "undefined" ];
+then
+ CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_RTTI=ON"
+fi
+cmake -G Ninja .. ${CMAKE_ARGS}
+ninja
+
+cp test/fuzzers/spvtools_*_fuzzer $OUT
diff --git a/projects/spirv-tools/project.yaml b/projects/spirv-tools/project.yaml
new file mode 100644
index 000000000..95c72a48b
--- /dev/null
+++ b/projects/spirv-tools/project.yaml
@@ -0,0 +1,16 @@
+homepage: https://github.com/KhronosGroup/SPIRV-Tools
+language: c++
+primary_contact: rharrison@google.com
+auto_ccs:
+ - "afdx@google.com"
+sanitizers:
+ - address
+ - memory
+ - undefined
+main_repo: 'https://github.com/KhronosGroup/SPIRV-Tools.git'
+architectures:
+ - x86_64
+ - i386
+fuzzing_engines:
+ - libfuzzer
+ - afl