Chenbo Feng | 4c9e9ec | 2018-10-16 20:31:52 -0700 | [diff] [blame] | 1 | // |
| 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 Badour | dcbf8ca | 2021-02-03 22:55:55 -0800 | [diff] [blame] | 17 | package { |
| 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 Feng | 4c9e9ec | 2018-10-16 20:31:52 -0700 | [diff] [blame] | 25 | cc_library_headers { |
Chenbo Feng | 79a4da2 | 2018-11-08 11:32:31 -0800 | [diff] [blame] | 26 | name: "libbpf_android_headers", |
Chenbo Feng | 4c9e9ec | 2018-10-16 20:31:52 -0700 | [diff] [blame] | 27 | vendor_available: false, |
| 28 | host_supported: false, |
Suren Baghdasaryan | 6597d87 | 2020-10-22 11:24:16 -0700 | [diff] [blame] | 29 | native_bridge_supported: true, |
Chenbo Feng | 4c9e9ec | 2018-10-16 20:31:52 -0700 | [diff] [blame] | 30 | export_include_dirs: ["include"], |
| 31 | target: { |
| 32 | linux_bionic: { |
| 33 | enabled: true, |
| 34 | }, |
| 35 | }, |
Lorenzo Colitti | 8cc4f91 | 2021-01-08 12:55:34 +0900 | [diff] [blame] | 36 | sdk_version: "30", |
Hungming Chen | a46f217 | 2021-01-13 13:56:38 +0800 | [diff] [blame] | 37 | header_libs: ["bpf_syscall_wrappers"], |
| 38 | export_header_lib_headers: ["bpf_syscall_wrappers"], |
Chenbo Feng | 4c9e9ec | 2018-10-16 20:31:52 -0700 | [diff] [blame] | 39 | } |
| 40 | |
| 41 | cc_library { |
Chenbo Feng | 79a4da2 | 2018-11-08 11:32:31 -0800 | [diff] [blame] | 42 | name: "libbpf_android", |
Chenbo Feng | 4c9e9ec | 2018-10-16 20:31:52 -0700 | [diff] [blame] | 43 | vendor_available: false, |
| 44 | host_supported: false, |
Suren Baghdasaryan | 6597d87 | 2020-10-22 11:24:16 -0700 | [diff] [blame] | 45 | native_bridge_supported: true, |
Chenbo Feng | 4c9e9ec | 2018-10-16 20:31:52 -0700 | [diff] [blame] | 46 | target: { |
| 47 | android: { |
| 48 | srcs: [ |
Joel Fernandes | d76a200 | 2018-10-16 13:19:58 -0700 | [diff] [blame] | 49 | "Loader.cpp", |
Chenbo Feng | 4c9e9ec | 2018-10-16 20:31:52 -0700 | [diff] [blame] | 50 | ], |
| 51 | sanitize: { |
| 52 | misc_undefined: ["integer"], |
| 53 | }, |
| 54 | }, |
| 55 | }, |
| 56 | |
| 57 | shared_libs: [ |
| 58 | "libbase", |
| 59 | "libutils", |
| 60 | "liblog", |
Joel Fernandes | d76a200 | 2018-10-16 13:19:58 -0700 | [diff] [blame] | 61 | "libbpf", |
Chenbo Feng | 4c9e9ec | 2018-10-16 20:31:52 -0700 | [diff] [blame] | 62 | ], |
| 63 | header_libs: [ |
Ken Chen | b1d4888 | 2021-10-25 21:11:22 +0800 | [diff] [blame] | 64 | "bpf_map_utils", |
| 65 | "libbpf_android_headers", |
Chenbo Feng | 4c9e9ec | 2018-10-16 20:31:52 -0700 | [diff] [blame] | 66 | ], |
Ken Chen | b1d4888 | 2021-10-25 21:11:22 +0800 | [diff] [blame] | 67 | export_header_lib_headers: [ |
| 68 | "libbpf_android_headers", |
| 69 | "bpf_map_utils", |
| 70 | ], |
Steven Moreland | 4891e61 | 2020-01-10 15:35:52 -0800 | [diff] [blame] | 71 | export_shared_lib_headers: ["libbpf"], |
Chenbo Feng | 4c9e9ec | 2018-10-16 20:31:52 -0700 | [diff] [blame] | 72 | local_include_dirs: ["include"], |
| 73 | |
| 74 | defaults: ["bpf_defaults"], |
| 75 | cflags: [ |
| 76 | "-Werror", |
| 77 | "-Wall", |
| 78 | "-Wextra", |
| 79 | ], |
| 80 | } |
| 81 | |
| 82 | cc_test { |
Joel Fernandes | 4845288 | 2018-12-17 13:47:54 -0800 | [diff] [blame] | 83 | name: "libbpf_load_test", |
Ken Chen | b1d4888 | 2021-10-25 21:11:22 +0800 | [diff] [blame] | 84 | header_libs: ["bpf_map_utils"], |
Joel Fernandes | 4845288 | 2018-12-17 13:47:54 -0800 | [diff] [blame] | 85 | srcs: [ |
| 86 | "BpfLoadTest.cpp", |
| 87 | ], |
| 88 | defaults: ["bpf_defaults"], |
| 89 | cflags: [ |
| 90 | "-Wall", |
| 91 | "-Werror", |
| 92 | "-Wno-error=unused-variable", |
| 93 | ], |
| 94 | static_libs: ["libgmock"], |
| 95 | shared_libs: [ |
| 96 | "libbpf_android", |
| 97 | "libbpf", |
| 98 | "libbase", |
| 99 | "liblog", |
Joel Fernandes | 4845288 | 2018-12-17 13:47:54 -0800 | [diff] [blame] | 100 | "libutils", |
| 101 | ], |
| 102 | |
| 103 | required: [ |
| 104 | "bpf_load_tp_prog.o", |
| 105 | ], |
Steven Moreland | cdeb920 | 2020-01-14 11:36:43 -0800 | [diff] [blame] | 106 | require_root: true, |
Joel Fernandes | 4845288 | 2018-12-17 13:47:54 -0800 | [diff] [blame] | 107 | } |