blob: 087ae270e8ac3a7cf44b29014de14b289ea1f8cd [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 ],
75 static_libs: ["libgmock"],
76 shared_libs: [
77 "libbpf_android",
78 "libbpf_bcc",
79 "libbase",
80 "liblog",
81 "libutils",
82 ],
83
84 data: [
85 ":bpfLoadTpProg.o",
86 ],
87 require_root: true,
88}
89
Chenbo Feng75b410b2018-10-10 15:01:19 -070090cc_binary {
91 name: "bpfloader",
92
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070093 defaults: ["bpf_defaults"],
Chenbo Feng75b410b2018-10-10 15:01:19 -070094 cflags: [
95 "-Wall",
96 "-Werror",
97 "-Wthread-safety",
98 ],
99 sanitize: {
100 integer_overflow: true,
101 },
Alix8849bb12022-04-18 03:57:58 +0000102
Ken Chenfb045622021-12-21 15:36:25 +0800103 header_libs: ["bpf_headers"],
Chenbo Feng75b410b2018-10-10 15:01:19 -0700104 shared_libs: [
Chenbo Feng75b410b2018-10-10 15:01:19 -0700105 "libbase",
Maciej Żenczykowski0d1d07c2023-10-08 23:21:46 -0700106 "libbpf_android",
Chenbo Feng75b410b2018-10-10 15:01:19 -0700107 "liblog",
Chenbo Feng75b410b2018-10-10 15:01:19 -0700108 ],
109 srcs: [
110 "BpfLoader.cpp",
111 ],
112
113 required: [
Maciej Żenczykowskic76a0dc2023-10-09 16:19:13 -0700114 "timeInState.o",
Chenbo Feng75b410b2018-10-10 15:01:19 -0700115 ],
116
Ryan Zuklie65748202022-12-07 18:22:21 -0800117 product_variables: {
118 debuggable: {
119 required: [
120 "bpfRingbufProg.o",
121 ],
122 },
123 }
Chenbo Feng75b410b2018-10-10 15:01:19 -0700124}