blob: ae664dfb3fc3deadc69f8cddc928eb3ec3e6d240 [file] [log] [blame]
Chenbo Feng75b410b2018-10-10 15:01:19 -07001//
2// Copyright (C) 2018 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
Bob Badourdcbf8ca2021-02-03 22:55:55 -080017package {
Maciej Żenczykowski5c412c62024-03-10 15:47:22 -070018 default_team: "trendy_team_fwk_core_networking",
Bob Badourdcbf8ca2021-02-03 22:55:55 -080019 // http://go/android-license-faq
20 // A large-scale-change added 'default_applicable_licenses' to import
21 // the below license kinds from "system_bpf_license":
22 // SPDX-license-identifier-Apache-2.0
23 default_applicable_licenses: ["system_bpf_license"],
24}
25
Maciej Żenczykowski5c412c62024-03-10 15:47:22 -070026cc_library {
27 name: "libbpf_android",
28 vendor_available: false,
29 host_supported: false,
30 target: {
31 android: {
32 srcs: [
33 "Loader.cpp",
34 ],
35 sanitize: {
36 misc_undefined: ["integer"],
37 },
38 },
39 },
40
41 shared_libs: [
42 "libbase",
43 "libutils",
44 "liblog",
45 ],
46 header_libs: [
47 "bpf_headers",
48 ],
49 export_header_lib_headers: [
50 "bpf_headers",
51 ],
52 export_include_dirs: ["include"],
53
54 defaults: ["bpf_defaults"],
55 cflags: [
56 "-Werror",
57 "-Wall",
58 "-Wextra",
59 ],
60}
61
Neill Kaprone3fc91e2024-08-07 19:14:47 +000062rust_bindgen {
63 name: "libbpf_android_bindgen",
64 crate_name: "bpf_android_bindgen",
65 wrapper_src: "include/libbpf_android.h",
66 source_stem: "bindings",
67 bindgen_flags: [
68 "--verbose",
69 ],
70 cflags: [
71 "-Werror",
72 "-Wall",
73 "-Wextra",
74 "-Wno-pragma-once-outside-header",
75 ],
76 shared_libs: [
77 "libbase",
78 "libutils",
79 "liblog",
80 "libbpf_android",
81 ],
82}
83
Maciej Żenczykowski5c412c62024-03-10 15:47:22 -070084cc_test {
85 name: "libbpf_load_test",
86 test_suites: ["general-tests"],
87 header_libs: ["bpf_headers"],
88 srcs: [
89 "BpfLoadTest.cpp",
90 ],
91 defaults: ["bpf_defaults"],
92 cflags: [
93 "-Wall",
94 "-Werror",
95 "-Wno-error=unused-variable",
96 ],
Maciej Żenczykowskicc922aa2024-03-10 15:18:20 -070097 static_libs: [
Maciej Żenczykowski5c412c62024-03-10 15:47:22 -070098 "libbpf_android",
Maciej Żenczykowskicc922aa2024-03-10 15:18:20 -070099 "libgmock",
100 ],
101 shared_libs: [
Maciej Żenczykowski5c412c62024-03-10 15:47:22 -0700102 "libbpf_bcc",
103 "libbase",
104 "liblog",
105 "libutils",
106 ],
107
108 data: [
109 ":bpfLoadTpProg.o",
110 ],
111 require_root: true,
112}
113
Chenbo Feng75b410b2018-10-10 15:01:19 -0700114cc_binary {
115 name: "bpfloader",
116
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -0700117 defaults: ["bpf_defaults"],
Chenbo Feng75b410b2018-10-10 15:01:19 -0700118 cflags: [
119 "-Wall",
120 "-Werror",
121 "-Wthread-safety",
122 ],
123 sanitize: {
124 integer_overflow: true,
125 },
Alix8849bb12022-04-18 03:57:58 +0000126
Ken Chenfb045622021-12-21 15:36:25 +0800127 header_libs: ["bpf_headers"],
Chenbo Feng75b410b2018-10-10 15:01:19 -0700128 shared_libs: [
Chenbo Feng75b410b2018-10-10 15:01:19 -0700129 "libbase",
130 "liblog",
Chenbo Feng75b410b2018-10-10 15:01:19 -0700131 ],
Maciej Żenczykowskicc922aa2024-03-10 15:18:20 -0700132 static_libs: ["libbpf_android"],
Chenbo Feng75b410b2018-10-10 15:01:19 -0700133 srcs: [
134 "BpfLoader.cpp",
135 ],
136
137 required: [
Maciej Żenczykowskic76a0dc2023-10-09 16:19:13 -0700138 "timeInState.o",
Chenbo Feng75b410b2018-10-10 15:01:19 -0700139 ],
140
Ryan Zuklie65748202022-12-07 18:22:21 -0800141 product_variables: {
142 debuggable: {
143 required: [
144 "bpfRingbufProg.o",
145 ],
146 },
Maciej Żenczykowskib9712d12024-03-10 17:18:46 -0700147 },
Chenbo Feng75b410b2018-10-10 15:01:19 -0700148}