Chenbo Feng | 75b410b | 2018-10-10 15:01:19 -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 | |
| 17 | // |
| 18 | // bpfLoad binary |
| 19 | // |
| 20 | cc_binary { |
| 21 | name: "bpfloader", |
| 22 | |
Chenbo Feng | 4c9e9ec | 2018-10-16 20:31:52 -0700 | [diff] [blame] | 23 | defaults: ["bpf_defaults"], |
Chenbo Feng | 75b410b | 2018-10-10 15:01:19 -0700 | [diff] [blame] | 24 | cflags: [ |
| 25 | "-Wall", |
| 26 | "-Werror", |
| 27 | "-Wthread-safety", |
| 28 | ], |
| 29 | sanitize: { |
| 30 | integer_overflow: true, |
| 31 | }, |
| 32 | clang: true, |
| 33 | shared_libs: [ |
| 34 | "libcutils", |
Chenbo Feng | 79a4da2 | 2018-11-08 11:32:31 -0800 | [diff] [blame] | 35 | "libbpf_android", |
Chenbo Feng | 75b410b | 2018-10-10 15:01:19 -0700 | [diff] [blame] | 36 | "libbase", |
| 37 | "liblog", |
Chenbo Feng | 4c9e9ec | 2018-10-16 20:31:52 -0700 | [diff] [blame] | 38 | "libnetdbpf", |
Chenbo Feng | 75b410b | 2018-10-10 15:01:19 -0700 | [diff] [blame] | 39 | "libnetdutils", |
Joel Fernandes | d76a200 | 2018-10-16 13:19:58 -0700 | [diff] [blame] | 40 | "libbpf", |
Chenbo Feng | 75b410b | 2018-10-10 15:01:19 -0700 | [diff] [blame] | 41 | ], |
| 42 | srcs: [ |
| 43 | "BpfLoader.cpp", |
| 44 | ], |
| 45 | |
| 46 | required: [ |
| 47 | "bpf_kern.o", |
Joel Fernandes | d76a200 | 2018-10-16 13:19:58 -0700 | [diff] [blame] | 48 | // Uncomment once security related patches ready |
| 49 | // "time_in_state.o", |
Chenbo Feng | 75b410b | 2018-10-10 15:01:19 -0700 | [diff] [blame] | 50 | ], |
| 51 | |
| 52 | } |
| 53 | |
| 54 | bpf { |
| 55 | name: "bpf_kern.o", |
| 56 | srcs: ["bpf_kern.c"], |
| 57 | cflags: [ |
| 58 | "-Wall", |
| 59 | "-Werror", |
| 60 | ], |
Chenbo Feng | 4c9e9ec | 2018-10-16 20:31:52 -0700 | [diff] [blame] | 61 | include_dirs: ["system/netd/libnetdbpf/include"], |
Chenbo Feng | 75b410b | 2018-10-10 15:01:19 -0700 | [diff] [blame] | 62 | } |