blob: 1e7ece885a2cacdb9ff8b2f41290bf4a223a4f0e [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
62cc_test {
63 name: "libbpf_load_test",
64 test_suites: ["general-tests"],
65 header_libs: ["bpf_headers"],
66 srcs: [
67 "BpfLoadTest.cpp",
68 ],
69 defaults: ["bpf_defaults"],
70 cflags: [
71 "-Wall",
72 "-Werror",
73 "-Wno-error=unused-variable",
74 ],
Maciej Żenczykowskicc922aa2024-03-10 15:18:20 -070075 static_libs: [
Maciej Żenczykowski5c412c62024-03-10 15:47:22 -070076 "libbpf_android",
Maciej Żenczykowskicc922aa2024-03-10 15:18:20 -070077 "libgmock",
78 ],
79 shared_libs: [
Maciej Żenczykowski5c412c62024-03-10 15:47:22 -070080 "libbpf_bcc",
81 "libbase",
82 "liblog",
83 "libutils",
84 ],
85
86 data: [
87 ":bpfLoadTpProg.o",
88 ],
89 require_root: true,
90}
91
Chenbo Feng75b410b2018-10-10 15:01:19 -070092cc_binary {
93 name: "bpfloader",
94
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070095 defaults: ["bpf_defaults"],
Chenbo Feng75b410b2018-10-10 15:01:19 -070096 cflags: [
97 "-Wall",
98 "-Werror",
99 "-Wthread-safety",
100 ],
101 sanitize: {
102 integer_overflow: true,
103 },
Alix8849bb12022-04-18 03:57:58 +0000104
Ken Chenfb045622021-12-21 15:36:25 +0800105 header_libs: ["bpf_headers"],
Chenbo Feng75b410b2018-10-10 15:01:19 -0700106 shared_libs: [
Chenbo Feng75b410b2018-10-10 15:01:19 -0700107 "libbase",
108 "liblog",
Chenbo Feng75b410b2018-10-10 15:01:19 -0700109 ],
Maciej Żenczykowskicc922aa2024-03-10 15:18:20 -0700110 static_libs: ["libbpf_android"],
Chenbo Feng75b410b2018-10-10 15:01:19 -0700111 srcs: [
112 "BpfLoader.cpp",
113 ],
114
115 required: [
Maciej Żenczykowskic76a0dc2023-10-09 16:19:13 -0700116 "timeInState.o",
Chenbo Feng75b410b2018-10-10 15:01:19 -0700117 ],
118
Ryan Zuklie65748202022-12-07 18:22:21 -0800119 product_variables: {
120 debuggable: {
121 required: [
122 "bpfRingbufProg.o",
123 ],
124 },
Maciej Żenczykowskib9712d12024-03-10 17:18:46 -0700125 },
Chenbo Feng75b410b2018-10-10 15:01:19 -0700126}