Dan Willemsen | eb4fafa | 2016-12-15 22:55:34 -0800 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2016 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 | // Include the generated rules |
| 18 | build = ["gen.bp"] |
| 19 | |
| 20 | genrule { |
| 21 | name: "ltp_linux_syscall_numbers", |
| 22 | tool_files: ["testcases/kernel/include/regen.sh"], |
| 23 | cmd: "$(location) $(genDir)/linux_syscall_numbers.h", |
| 24 | srcs: ["testcases/kernel/include/*.in"], |
| 25 | out: ["linux_syscall_numbers.h"], |
| 26 | } |
| 27 | |
| 28 | cc_defaults { |
| 29 | name: "ltp_defaults", |
| 30 | |
| 31 | cflags: [ |
| 32 | // Hacks for bionic compatibility |
| 33 | "-include bionic-compat.h", |
| 34 | |
Chih-Hung Hsieh | 36ef68a | 2017-09-28 15:13:58 -0700 | [diff] [blame] | 35 | "-Wall", |
| 36 | "-Werror", |
| 37 | // Keep some warnings to check later |
| 38 | "-Wno-error=absolute-value", |
| 39 | "-Wno-error=undefined-internal", |
| 40 | "-Wno-error=uninitialized", |
| 41 | "-Wno-error=user-defined-warnings", |
Dan Willemsen | eb4fafa | 2016-12-15 22:55:34 -0800 | [diff] [blame] | 42 | // Silence noisy warnings |
Chih-Hung Hsieh | 36ef68a | 2017-09-28 15:13:58 -0700 | [diff] [blame] | 43 | "-Wno-constant-conversion", |
Dan Willemsen | eb4fafa | 2016-12-15 22:55:34 -0800 | [diff] [blame] | 44 | "-Wno-deprecated", |
Chih-Hung Hsieh | 36ef68a | 2017-09-28 15:13:58 -0700 | [diff] [blame] | 45 | "-Wno-duplicate-decl-specifier", |
| 46 | "-Wno-empty-body", |
Dan Willemsen | eb4fafa | 2016-12-15 22:55:34 -0800 | [diff] [blame] | 47 | "-Wno-format", |
| 48 | "-Wno-gnu-designator", |
Chih-Hung Hsieh | 36ef68a | 2017-09-28 15:13:58 -0700 | [diff] [blame] | 49 | "-Wno-knr-promoted-parameter", |
Dan Willemsen | eb4fafa | 2016-12-15 22:55:34 -0800 | [diff] [blame] | 50 | "-Wno-macro-redefined", |
| 51 | "-Wno-missing-field-initializers", |
| 52 | "-Wno-parentheses-equality", |
| 53 | "-Wno-pointer-arith", |
Chih-Hung Hsieh | 36ef68a | 2017-09-28 15:13:58 -0700 | [diff] [blame] | 54 | "-Wno-pointer-sign", |
Dan Willemsen | eb4fafa | 2016-12-15 22:55:34 -0800 | [diff] [blame] | 55 | "-Wno-sign-compare", |
Chih-Hung Hsieh | 36ef68a | 2017-09-28 15:13:58 -0700 | [diff] [blame] | 56 | "-Wno-tautological-compare", |
| 57 | "-Wno-unneeded-internal-declaration", |
| 58 | "-Wno-unused-function", |
Dan Willemsen | eb4fafa | 2016-12-15 22:55:34 -0800 | [diff] [blame] | 59 | "-Wno-unused-parameter", |
Chih-Hung Hsieh | 36ef68a | 2017-09-28 15:13:58 -0700 | [diff] [blame] | 60 | "-Wno-unused-variable", |
Dan Willemsen | eb4fafa | 2016-12-15 22:55:34 -0800 | [diff] [blame] | 61 | ], |
| 62 | |
| 63 | local_include_dirs: [ |
| 64 | "android/include", |
| 65 | "include", |
| 66 | ], |
| 67 | |
Dan Willemsen | eb4fafa | 2016-12-15 22:55:34 -0800 | [diff] [blame] | 68 | target: { |
| 69 | // bionic has broken signal handling for signum > 32 on 32-bit ARM and x86 |
| 70 | // (for ABI reasons this can't be fixed) |
| 71 | android_arm: { |
| 72 | cflags: ["-DNUMSIGS=32"], |
| 73 | }, |
| 74 | android_x86: { |
| 75 | cflags: ["-DNUMSIGS=32"], |
| 76 | }, |
| 77 | }, |
| 78 | |
| 79 | generated_headers: ["ltp_linux_syscall_numbers"], |
| 80 | |
| 81 | static_libs: ["libcap"], |
| 82 | |
| 83 | // TODO: recover libaio when the external project created |
| 84 | shared_libs: ["libselinux"], |
| 85 | } |
| 86 | |
| 87 | cc_defaults { |
| 88 | name: "ltp_test_defaults", |
| 89 | defaults: ["ltp_defaults"], |
| 90 | gtest: false, |
| 91 | no_named_install_directory: true, |
| 92 | relative_install_path: "ltp/testcases/bin", |
| 93 | } |