mirror of https://github.com/google/oss-fuzz.git
[java-example] Build native library in subdirectory (#5959)
Top-level executables are taken to be fuzz targets by the coverage script.
This commit is contained in:
parent
89d8215b93
commit
1a77d6c33f
|
@ -17,8 +17,9 @@
|
||||||
|
|
||||||
# Build native library.
|
# Build native library.
|
||||||
JVM_INCLUDES="-I$JAVA_HOME/include -I$JAVA_HOME/include/linux"
|
JVM_INCLUDES="-I$JAVA_HOME/include -I$JAVA_HOME/include/linux"
|
||||||
|
mkdir $OUT/native
|
||||||
$CXX $CXXFLAGS $JVM_INCLUDES -fPIC -shared \
|
$CXX $CXXFLAGS $JVM_INCLUDES -fPIC -shared \
|
||||||
ExampleFuzzerNative.cpp -o $OUT/libnative.so
|
ExampleFuzzerNative.cpp -o $OUT/native/libnative.so
|
||||||
|
|
||||||
BUILD_CLASSPATH=$JAZZER_API_PATH
|
BUILD_CLASSPATH=$JAZZER_API_PATH
|
||||||
|
|
||||||
|
@ -41,7 +42,7 @@ for fuzzer in $(find $SRC -name '*Fuzzer.java' -or -name '*FuzzerNative.java');
|
||||||
echo "#!/bin/sh
|
echo "#!/bin/sh
|
||||||
# LLVMFuzzerTestOneInput for fuzzer detection.
|
# LLVMFuzzerTestOneInput for fuzzer detection.
|
||||||
this_dir=\$(dirname \"\$0\")
|
this_dir=\$(dirname \"\$0\")
|
||||||
LD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\$this_dir \
|
LD_LIBRARY_PATH=\"$JVM_LD_LIBRARY_PATH\":\$this_dir/native \
|
||||||
ASAN_OPTIONS=\$ASAN_OPTIONS:symbolize=1:external_symbolizer_path=\$this_dir/llvm-symbolizer:detect_leaks=0 \
|
ASAN_OPTIONS=\$ASAN_OPTIONS:symbolize=1:external_symbolizer_path=\$this_dir/llvm-symbolizer:detect_leaks=0 \
|
||||||
\$this_dir/$driver --agent_path=\$this_dir/jazzer_agent_deploy.jar \
|
\$this_dir/$driver --agent_path=\$this_dir/jazzer_agent_deploy.jar \
|
||||||
--cp=$RUNTIME_CLASSPATH \
|
--cp=$RUNTIME_CLASSPATH \
|
||||||
|
|
Loading…
Reference in New Issue