From f4decafd4393246c2d955f86401f1ad54b5c94c4 Mon Sep 17 00:00:00 2001 From: Dongge Liu Date: Wed, 18 Jan 2023 22:37:26 +1100 Subject: [PATCH] Fix centipede linker flags (#1610) Mirrors [the fixes from OSS-Fuzz](https://github.com/google/oss-fuzz/pull/9427): 1. Use [`-Wl` on the linker flags](https://github.com/google/oss-fuzz/pull/9427#issuecomment-1385205488). 2. Use [`LDFLAGS`](https://github.com/google/oss-fuzz/pull/9427#issuecomment-1385375441). --- fuzzers/centipede/fuzzer.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/fuzzers/centipede/fuzzer.py b/fuzzers/centipede/fuzzer.py index 63b9cd7f6..fbcc358c4 100755 --- a/fuzzers/centipede/fuzzer.py +++ b/fuzzers/centipede/fuzzer.py @@ -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. @@ -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++'