blob: 099e9e859e8ad1d61d772c90d388bf0ffc016dee [file] [log] [blame]
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -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 {
18 // http://go/android-license-faq
19 // A large-scale-change added 'default_applicable_licenses' to import
20 // the below license kinds from "system_bpf_license":
21 // SPDX-license-identifier-Apache-2.0
22 default_applicable_licenses: ["system_bpf_license"],
23}
24
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070025cc_library_headers {
Chenbo Feng79a4da22018-11-08 11:32:31 -080026 name: "libbpf_android_headers",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070027 vendor_available: false,
28 host_supported: false,
Suren Baghdasaryan6597d872020-10-22 11:24:16 -070029 native_bridge_supported: true,
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070030 export_include_dirs: ["include"],
31 target: {
32 linux_bionic: {
33 enabled: true,
34 },
35 },
Lorenzo Colitti8cc4f912021-01-08 12:55:34 +090036 sdk_version: "30",
Hungming Chena46f2172021-01-13 13:56:38 +080037 header_libs: ["bpf_syscall_wrappers"],
38 export_header_lib_headers: ["bpf_syscall_wrappers"],
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070039}
40
41cc_library {
Chenbo Feng79a4da22018-11-08 11:32:31 -080042 name: "libbpf_android",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070043 vendor_available: false,
44 host_supported: false,
Suren Baghdasaryan6597d872020-10-22 11:24:16 -070045 native_bridge_supported: true,
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070046 target: {
47 android: {
48 srcs: [
Joel Fernandesd76a2002018-10-16 13:19:58 -070049 "Loader.cpp",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070050 ],
51 sanitize: {
52 misc_undefined: ["integer"],
53 },
54 },
55 },
56
57 shared_libs: [
58 "libbase",
59 "libutils",
60 "liblog",
Connor O'Brien474eb0b2021-11-22 17:45:40 -080061 "libbpf_bcc",
Connor O'Brien52863b62022-01-11 18:38:15 -080062 "libbpf_minimal",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070063 ],
64 header_libs: [
Ken Chenfb045622021-12-21 15:36:25 +080065 "bpf_headers",
Ken Chenb1d48882021-10-25 21:11:22 +080066 "libbpf_android_headers",
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070067 ],
Ken Chenb1d48882021-10-25 21:11:22 +080068 export_header_lib_headers: [
69 "libbpf_android_headers",
Ken Chenfb045622021-12-21 15:36:25 +080070 "bpf_headers",
Ken Chenb1d48882021-10-25 21:11:22 +080071 ],
Connor O'Brien474eb0b2021-11-22 17:45:40 -080072 export_shared_lib_headers: ["libbpf_bcc"],
Chenbo Feng4c9e9ec2018-10-16 20:31:52 -070073 local_include_dirs: ["include"],
74
75 defaults: ["bpf_defaults"],
76 cflags: [
77 "-Werror",
78 "-Wall",
79 "-Wextra",
80 ],
81}
82
83cc_test {
Joel Fernandes48452882018-12-17 13:47:54 -080084 name: "libbpf_load_test",
Connor O'Brien74a02dd2022-01-27 23:46:49 -080085 test_suites: ["general-tests"],
Ken Chenfb045622021-12-21 15:36:25 +080086 header_libs: ["bpf_headers"],
Joel Fernandes48452882018-12-17 13:47:54 -080087 srcs: [
88 "BpfLoadTest.cpp",
89 ],
90 defaults: ["bpf_defaults"],
91 cflags: [
92 "-Wall",
93 "-Werror",
94 "-Wno-error=unused-variable",
95 ],
96 static_libs: ["libgmock"],
97 shared_libs: [
98 "libbpf_android",
Connor O'Brien474eb0b2021-11-22 17:45:40 -080099 "libbpf_bcc",
Connor O'Brien52863b62022-01-11 18:38:15 -0800100 "libbpf_minimal",
Joel Fernandes48452882018-12-17 13:47:54 -0800101 "libbase",
102 "liblog",
Joel Fernandes48452882018-12-17 13:47:54 -0800103 "libutils",
104 ],
105
Connor O'Brien50913142022-01-27 22:47:11 -0800106 data: [
107 ":bpf_load_tp_prog.o",
108 ":bpf_load_tp_prog_btf.o",
Joel Fernandes48452882018-12-17 13:47:54 -0800109 ],
Steven Morelandcdeb9202020-01-14 11:36:43 -0800110 require_root: true,
Joel Fernandes48452882018-12-17 13:47:54 -0800111}