Skip to content

Commit 0acecb4

Browse files
[nodejs] Simplify build process as most work is now upstreamed. (#4327)
* Build of nodejs has now been upstreamed and this commit simplifies the build for nodejs to the new updates. * We only support libfuzzer for now. * Simplified the build script.
1 parent 56525dc commit 0acecb4

3 files changed

Lines changed: 5 additions & 25 deletions

File tree

projects/nodejs/Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,3 @@ RUN apt-get install -y flex bison build-essential
2020
RUN git clone --recursive --depth 1 https://github.com/nodejs/node
2121
WORKDIR $SRC
2222
COPY build.sh $SRC/
23-
24-
COPY fuzz_url.cc $SRC/

projects/nodejs/build.sh

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,8 @@ cd $SRC/node
1919
# Build node
2020
export LDFLAGS="$CXXFLAGS"
2121
export LD="$CXX"
22-
./configure --without-intl --without-node-code-cache --without-dtrace --without-snapshot --without-ssl
22+
./configure --experimental-quic --with-ossfuzz
2323
make -j$(nproc)
2424

25-
# Gather static libraries
26-
cd $SRC/node/out
27-
rm -rf ./library_files && mkdir library_files
28-
find . -name "*.a" -exec cp {} ./library_files/ \;
29-
30-
# Build the fuzzers
31-
CMDS="-D__STDC_FORMAT_MACROS -D__POSIX__ -DNODE_HAVE_I18N_SUPPORT=1 \
32-
-DNODE_ARCH=\"x64\" -DNODE_PLATFORM=\"linux\" -DNODE_WANT_INTERNALS=1"
33-
INCLUDES="-I../src -I../deps/v8/include -I../deps/uv/include"
34-
35-
# Compilation
36-
$CXX -o fuzz_url.o $SRC/fuzz_url.cc $CXXFLAGS $CMDS $INCLUDES \
37-
-pthread -fno-omit-frame-pointer -fno-rtti -fno-exceptions -std=gnu++1y -MMD -c
38-
39-
# Linking
40-
$CXX -o $OUT/fuzz_url $LIB_FUZZING_ENGINE $CXXFLAGS \
41-
-rdynamic -Wl,-z,noexecstack,-z,relro,-z,now \
42-
-pthread -Wl,--start-group \
43-
./Release/obj.target/cctest/src/node_snapshot_stub.o \
44-
./Release/obj.target/cctest/src/node_code_cache_stub.o \
45-
fuzz_url.o ./library_files/*.a \
46-
-latomic -lm -ldl -Wl,--end-group
25+
# Copy all fuzzers to OUT folder
26+
cp out/Release/fuzz_* ${OUT}/

projects/nodejs/project.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
homepage: "https://nodejs.org"
22
primary_contact: "security@nodejs.org"
33
language: c++
4+
fuzzing_engines:
5+
- libfuzzer
46
sanitizers:
57
- address
68
auto_ccs:

0 commit comments

Comments
 (0)