Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions projects/nodejs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,3 @@ RUN apt-get install -y flex bison build-essential
RUN git clone --recursive --depth 1 https://github.com/nodejs/node
WORKDIR $SRC
COPY build.sh $SRC/

COPY fuzz_url.cc $SRC/
26 changes: 3 additions & 23 deletions projects/nodejs/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,8 @@ cd $SRC/node
# Build node
export LDFLAGS="$CXXFLAGS"
export LD="$CXX"
./configure --without-intl --without-node-code-cache --without-dtrace --without-snapshot --without-ssl
./configure --experimental-quic --with-ossfuzz
make -j$(nproc)

# Gather static libraries
cd $SRC/node/out
rm -rf ./library_files && mkdir library_files
find . -name "*.a" -exec cp {} ./library_files/ \;

# Build the fuzzers
CMDS="-D__STDC_FORMAT_MACROS -D__POSIX__ -DNODE_HAVE_I18N_SUPPORT=1 \
-DNODE_ARCH=\"x64\" -DNODE_PLATFORM=\"linux\" -DNODE_WANT_INTERNALS=1"
INCLUDES="-I../src -I../deps/v8/include -I../deps/uv/include"

# Compilation
$CXX -o fuzz_url.o $SRC/fuzz_url.cc $CXXFLAGS $CMDS $INCLUDES \
-pthread -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++1y -MMD -c

# Linking
$CXX -o $OUT/fuzz_url $LIB_FUZZING_ENGINE $CXXFLAGS \
-rdynamic -Wl,-z,noexecstack,-z,relro,-z,now \
-pthread -Wl,--start-group \
./Release/obj.target/cctest/src/node_snapshot_stub.o \
./Release/obj.target/cctest/src/node_code_cache_stub.o \
fuzz_url.o ./library_files/*.a \
-latomic -lm -ldl -Wl,--end-group
# Copy all fuzzers to OUT folder
cp out/Release/fuzz_* ${OUT}/
2 changes: 2 additions & 0 deletions projects/nodejs/project.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
homepage: "https://nodejs.org"
primary_contact: "[email protected]"
language: c++
fuzzing_engines:
- libfuzzer
sanitizers:
- address
auto_ccs:
Expand Down