diff --git a/projects/duckdb/build.sh b/projects/duckdb/build.sh index 082feffefe8e..acc8b0ab9d1b 100755 --- a/projects/duckdb/build.sh +++ b/projects/duckdb/build.sh @@ -19,7 +19,7 @@ make relassert CRASH_ON_ASSERT=1 DISABLE_SANITIZER=1 EXTENSION_LIBS=$(find ./build/relassert/extension/ -name "*.a") THIRD_PARTY_LIBS=$(find ./build/relassert/third_party/ -name "*.a") $CXX $CXXFLAGS $LIB_FUZZING_ENGINE ./test/ossfuzz/parse_fuzz_test.cpp \ - -o $OUT/parse_fuzz_test -I./ -I./src/include \ + -o $OUT/parse_fuzz_test -I./ -I./src/include -I./third_party/fmt/include \ -Wl,--start-group \ ./build/relassert/src/libduckdb_static.a \ ${EXTENSION_LIBS} ${THIRD_PARTY_LIBS} \ diff --git a/projects/pjsip/Dockerfile b/projects/pjsip/Dockerfile index f13c2e0b1696..41811ce2e521 100644 --- a/projects/pjsip/Dockerfile +++ b/projects/pjsip/Dockerfile @@ -14,7 +14,7 @@ # ################################################################################ FROM gcr.io/oss-fuzz-base/base-builder:ubuntu-24-04 -RUN apt-get update && apt-get install -y autoconf libtool-bin pkg-config libssl-dev zlib1g-dev +RUN apt-get update && apt-get install -y autoconf libtool-bin pkg-config libssl-dev zlib1g-dev libopus-dev libvpx-dev RUN git clone https://github.com/pjsip/pjproject pjsip COPY build.sh $SRC/ WORKDIR $SRC/pjsip/ diff --git a/projects/pjsip/build.sh b/projects/pjsip/build.sh index 9facb78ffc89..ebcbd5183458 100644 --- a/projects/pjsip/build.sh +++ b/projects/pjsip/build.sh @@ -23,6 +23,12 @@ export LDFLAGS="$CFLAGS" --disable-speex-aec --disable-g7221-codec \ --disable-resample --disable-libwebrtc --disable-libyuv +# Force static linking of libvpx and libopus so the fuzzers do not depend on +# .so files that are absent from the OSS-Fuzz runner image. libvpx-dev and +# libopus-dev both ship .a archives in /usr/lib/x86_64-linux-gnu/. +sed -i 's|-lvpx|/usr/lib/x86_64-linux-gnu/libvpx.a|g' build.mak +sed -i 's|-lopus|/usr/lib/x86_64-linux-gnu/libopus.a|g' build.mak + make dep make -j$(nproc) --ignore-errors make fuzz diff --git a/projects/pypy3/Dockerfile b/projects/pypy3/Dockerfile new file mode 100644 index 000000000000..456bb5ec0f94 --- /dev/null +++ b/projects/pypy3/Dockerfile @@ -0,0 +1,29 @@ +# Copyright 2026 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 gcc make libffi-dev pkg-config \ + zlib1g-dev libbz2-dev libsqlite3-dev libncurses5-dev \ + libexpat1-dev libssl-dev libgdbm-dev tk-dev libgc-dev \ + liblzma-dev libncursesw5-dev \ + pypy + +RUN git clone --depth 1 --branch py3.11 https://github.com/pypy/pypy.git pypy +RUN git clone --depth 1 --branch main https://github.com/StanFromIreland/pypy-fuzz.git +WORKDIR pypy +COPY build.sh $SRC/ diff --git a/projects/pypy3/build.sh b/projects/pypy3/build.sh new file mode 100644 index 000000000000..6775d57b547b --- /dev/null +++ b/projects/pypy3/build.sh @@ -0,0 +1,56 @@ +#!/bin/bash -eu +# Copyright 2026 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. +################################################################################ + +case $SANITIZER in + address) SAN=-fsanitize=address ;; + undefined) SAN=-fsanitize=undefined ;; + *) SAN="" ;; +esac + +CFLAGS=$(echo "$CFLAGS" | sed 's/-f[no-]*sanitize[^ ]*//g') + +cd $SRC/pypy/pypy/goal +CC=clang pypy ../../rpython/bin/rpython --opt=2 --shared --source + +BUILD_DIR=$(dirname $(find /tmp/usession-py3.11-* -name 'Makefile' | head -1)) +make lldebug -j$(nproc) -C $BUILD_DIR "CC=clang $SAN" +cp $BUILD_DIR/pypy3*-c $BUILD_DIR/libpypy3*-c.so . +ln -sf libpypy3.11-c.so libpypy3-c.so + +export LD_LIBRARY_PATH=$SRC/pypy/pypy/goal +PYPY=$SRC/pypy/pypy/goal/pypy3.11-c + +# Build fuzz targets +cd $SRC/pypy-fuzz +while read -r name; do + CC=clang CFLAGS="$SAN" LDSHARED="clang -shared $SAN" $PYPY build_cffi_fuzz.py "$name" + clang $SAN $CFLAGS -fsanitize=fuzzer-no-link fuzzer_stub.c ./_pypy_fuzz_${name}.so \ + -L$SRC/pypy/pypy/goal -lpypy3-c -Wl,-rpath,'$ORIGIN' \ + $LIB_FUZZING_ENGINE -rdynamic -ldl -o fuzzer-${name} + + cp fuzzer-${name} _pypy_fuzz_${name}.so fuzz_${name}.py $OUT/ + if [ -d "corp-${name}" ]; then + zip -j "$OUT/fuzzer-${name}_seed_corpus.zip" corp-${name}/* + fi + if [ -f "dictionaries/fuzzer-${name}.dict" ]; then + cp "dictionaries/fuzzer-${name}.dict" "$OUT/" + fi +done < fuzz_targets.txt + +cp $SRC/pypy/pypy/goal/libpypy3.11-c.so $OUT/libpypy3-c.so +cp ubsan_suppressions.txt $OUT/ +cp -R $SRC/pypy/lib-python $OUT/ +cp -R $SRC/pypy/lib_pypy $OUT/ diff --git a/projects/pypy3/project.yaml b/projects/pypy3/project.yaml new file mode 100644 index 000000000000..5c350e67803d --- /dev/null +++ b/projects/pypy3/project.yaml @@ -0,0 +1,9 @@ +homepage: "https://pypy.org/" +language: c +main_repo: "https://github.com/pypy/pypy" +primary_contact: "stanulbrych@gmail.com" +auto_ccs: + - "matti.picus@gmail.com" + - "cfbolz@gmail.com" +sanitizers: + - undefined