From 661ae85eb251faa1d679c23d36d7fb627a26d529 Mon Sep 17 00:00:00 2001 From: Neill Kapron Date: Fri, 13 Sep 2024 16:39:45 +0000 Subject: [PATCH] BPF: rename bpf_defaults to bpf_cc_defaults With the addition of defaults to the bpf soong module (see aosp/3249485 ), the name `bpf_defaults` will be used to define defaults for bpf program compilation. While there are separate soong namespaces for module types and module names, rename the existing bpf_defaults cc_defaults to bpf_cc_defaults for clarity. While we're at it, add -Wextra, and cleanup unnecessary cflags in clauses which use bpf_cc_defaults. Add -Wno-sign-compare to resolve build issues in external test code. Test: TH Change-Id: Id0407f86ad50033a77a8679d465dc9412991d764 Signed-off-by: Neill Kapron --- bpf/headers/Android.bp | 7 +++---- bpf/loader/Android.bp | 7 +------ 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/bpf/headers/Android.bp b/bpf/headers/Android.bp index d55584ac59..aaf8d8de7e 100644 --- a/bpf/headers/Android.bp +++ b/bpf/headers/Android.bp @@ -48,11 +48,10 @@ cc_test { "BpfMapTest.cpp", "BpfRingbufTest.cpp", ], - defaults: ["bpf_defaults"], + defaults: ["bpf_cc_defaults"], cflags: [ - "-Wall", - "-Werror", - "-Wno-error=unused-variable", + "-Wno-unused-variable", + "-Wno-sign-compare", ], header_libs: ["bpf_headers"], static_libs: ["libgmock"], diff --git a/bpf/loader/Android.bp b/bpf/loader/Android.bp index b8c0ce7d77..b08913a2c5 100644 --- a/bpf/loader/Android.bp +++ b/bpf/loader/Android.bp @@ -33,12 +33,7 @@ install_symlink { cc_binary { name: "netbpfload", - defaults: ["bpf_defaults"], - cflags: [ - "-Wall", - "-Werror", - "-Wthread-safety", - ], + defaults: ["bpf_cc_defaults"], sanitize: { integer_overflow: true, },