Skip to content

Commit 4f3b012

Browse files
Fix merge conflict.
2 parents 10d8f2f + 7bd5ae5 commit 4f3b012

File tree

5 files changed

+13
-3
lines changed

5 files changed

+13
-3
lines changed

infra/base-images/base-libfuzzer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ENV SANITIZER_FLAGS_address "-fsanitize=address"
2323
ENV SANITIZER_FLAGS_undefined "-fsanitize=bool,signed-integer-overflow,shift,vptr -fno-sanitize-recover=undefined"
2424

2525
# Default build flags for coverage.
26-
ENV COV_FLAGS="-fsanitize-coverage=edge,indirect-calls,8bit-counters"
26+
ENV COVERAGE_FLAGS="-fsanitize-coverage=edge,indirect-calls,8bit-counters"
2727

2828
# Default sanitizer and fuzzing engine to use.
2929
ENV SANITIZER="address"

infra/base-images/base-libfuzzer/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Build configuration is performed through following environment variables:
4040
| ------------- | --------
4141
| `$SANITIZER ("address")` | Specifies sanitizer configuration to use. `address` or `undefined`.
4242
| `$SANITIZER_FLAGS` | Specify compiler sanitizer flags directly. Overrides `$SANITIZER`.
43+
| `$COVERAGE_FLAGS` | Specify compiler flags to use for fuzzer feedback coverage.
4344

4445
# Examples
4546

infra/base-images/base-libfuzzer/compile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ fi
2424

2525
bash compile_${FUZZING_ENGINE}
2626

27-
export CFLAGS="$CFLAGS $SANITIZER_FLAGS $COV_FLAGS"
27+
export CFLAGS="$CFLAGS $SANITIZER_FLAGS $COVERAGE_FLAGS"
2828
export CXXFLAGS="$CFLAGS $CXXFLAGS_EXTRA"
2929

3030
echo "CC=$CC"

infra/helper.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ def build_fuzzers(build_args):
149149
command = [
150150
'docker', 'run', '--rm', '-i',
151151
'-v', '%s:/out' % os.path.join(BUILD_DIR, 'out', args.project_name),
152+
'-v', '%s:/work' % os.path.join(BUILD_DIR, 'work', args.project_name),
152153
'-t', 'ossfuzz/' + args.project_name,
153154
]
154155

@@ -294,6 +295,7 @@ def shell(shell_args):
294295
command = [
295296
'docker', 'run', '--rm', '-i',
296297
'-v', '%s:/out' % os.path.join(BUILD_DIR, 'out', args.project_name),
298+
'-v', '%s:/work' % os.path.join(BUILD_DIR, 'work', args.project_name),
297299
'-t', 'ossfuzz/' + args.project_name,
298300
'/bin/bash'
299301
]

infra/libfuzzer-pipeline.groovy

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ def call(body) {
2626
// Project configuration.
2727
def projectName = project["name"] ?: env.JOB_BASE_NAME
2828
def sanitizers = project["sanitizers"] ?: ["address"]
29+
def coverageFlags = project["coverage_flags"]
30+
31+
// Dockerfile config
2932
def dockerfileConfig = project["dockerfile"] ?: [
3033
"path": "projects/$projectName/Dockerfile",
3134
"git" : "https://github.com/google/oss-fuzz.git",
@@ -83,7 +86,11 @@ def call(body) {
8386
sh "mkdir -p $junit_reports"
8487
stage("$sanitizer sanitizer") {
8588
// Run image to produce fuzzers
86-
sh "docker run --rm --user $uid -v $out:/out -e SANITIZER=\"${sanitizer}\" -t $dockerTag compile"
89+
def env = "-e SANITIZER=\"${sanitizer}\" "
90+
if (coverageFlags != null) {
91+
env += "-e COVERAGE_FLAGS=\"${coverageFlags}\" "
92+
}
93+
sh "docker run --rm --user $uid -v $out:/out $env -t $dockerTag compile"
8794
// Test all fuzzers
8895
sh "docker run --rm --user $uid -v $out:/out -v $junit_reports:/junit_reports -e TEST_SUITE=\"${projectName}.${sanitizer}.\" -t ossfuzz/base-runner test_report"
8996
sh "ls -al $junit_reports/"

0 commit comments

Comments
 (0)