Skip to content

Commit

Permalink
Fix centipede linker flags (#1610)
Browse files Browse the repository at this point in the history
Mirrors [the fixes from
OSS-Fuzz](google/oss-fuzz#9427):
1. Use [`-Wl` on the linker
flags](google/oss-fuzz#9427 (comment)).
2. Use
[`LDFLAGS`](google/oss-fuzz#9427 (comment)).
  • Loading branch information
DonggeLiu authored Jan 18, 2023
1 parent 2749078 commit f4decaf
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions fuzzers/centipede/fuzzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,8 @@ def build():
san_cflags = ['-fsanitize-coverage=trace-loads']

link_cflags = [
'-Wno-error=unused-command-line-argument',
'-ldl',
'-lrt',
'-lpthread',
'/lib/weak.o',
'-Wno-unused-command-line-argument',
'-Wl,-ldl,-lrt,-lpthread,/lib/weak.o'
]

# TODO(Dongge): Build targets with sanitizers.
Expand All @@ -41,6 +38,7 @@ def build():
cflags = san_cflags + centipede_cflags + link_cflags
utils.append_flags('CFLAGS', cflags)
utils.append_flags('CXXFLAGS', cflags)
utils.append_flags('LDFLAGS', ['/lib/weak.o'])

os.environ['CC'] = '/clang/bin/clang'
os.environ['CXX'] = '/clang/bin/clang++'
Expand Down

0 comments on commit f4decaf

Please sign in to comment.