aboutsummaryrefslogtreecommitdiffhomepage
path: root/projects
diff options
context:
space:
mode:
authorGravatar AdamKorcz <44787359+AdamKorcz@users.noreply.github.com>2020-12-08 04:14:28 +0000
committerGravatar GitHub <noreply@github.com>2020-12-07 20:14:28 -0800
commitca4fe7678b8d95ca690d0f50553a408a9d319554 (patch)
tree20e79155184fcfb23a112617e5b015f6418bd2c5 /projects
parenta23d9bc6fb84a5607f8aff8e3261e999b50c62d6 (diff)
[clib] Initial integration (#4735)
* [teleport] Initial integration * Minor update to run tests again * [clib] Initial integration * Updates to build file * Switched off AFL * Minor correction
Diffstat (limited to 'projects')
-rw-r--r--projects/clib/Dockerfile21
-rw-r--r--projects/clib/build.sh36
-rw-r--r--projects/clib/project.yaml13
3 files changed, 70 insertions, 0 deletions
diff --git a/projects/clib/Dockerfile b/projects/clib/Dockerfile
new file mode 100644
index 00000000..92e14901
--- /dev/null
+++ b/projects/clib/Dockerfile
@@ -0,0 +1,21 @@
+# Copyright 2020 Google Inc.
+#
+# 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 cmake ninja libcurl4-gnutls-dev -qq
+RUN git clone https://github.com/clibs/clib
+WORKDIR $SRC/
+COPY build.sh $SRC/
diff --git a/projects/clib/build.sh b/projects/clib/build.sh
new file mode 100644
index 00000000..c48ba9d7
--- /dev/null
+++ b/projects/clib/build.sh
@@ -0,0 +1,36 @@
+#!/bin/bash -eu
+# Copyright 2020 Google Inc.
+#
+# 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.
+#
+################################################################################
+
+cd clib
+make -j$(nproc)
+
+sed 's/int main(int argc/int main2(int argc/g' -i ./src/clib-search.c
+sed 's/int main(int argc/int main2(int argc/g' -i ./src/clib-configure.c
+
+find . -name "*.o" -exec ar rcs fuzz_lib.a {} \;
+
+$CC $CFLAGS -Wno-unused-function -U__STRICT_ANSI__ \
+ -DHAVE_PTHREADS=1 -pthread -o fuzz_manifest.o \
+ -c test/fuzzing/fuzz_manifest.c -I./asprintf -I./deps/ \
+ -I./deps/asprintf
+
+$CC $CFLAGS $LIB_FUZZING_ENGINE fuzz_manifest.o \
+ -o $OUT/fuzz_manifest src/common/clib-package.c \
+ src/common/clib-cache.c src/clib-configure.c \
+ -I./deps/asprintf -I./deps -I./asprintf \
+ fuzz_lib.a -L/usr/lib/x86_64-linux-gnu -lcurl
+
diff --git a/projects/clib/project.yaml b/projects/clib/project.yaml
new file mode 100644
index 00000000..6cf18699
--- /dev/null
+++ b/projects/clib/project.yaml
@@ -0,0 +1,13 @@
+homepage: "https://github.com/clibs/clib"
+language: c
+primary_contact: "joseph.werle@gmail.com"
+auto_ccs:
+ - "Adam@adalogics.com"
+ - "isty001@gmail.com"
+fuzzing_engines:
+ - libfuzzer
+ - honggfuzz
+sanitizers:
+ - address
+ - undefined
+ - memory