• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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// *** THIS PACKAGE HAS SPECIAL LICENSING CONDITIONS.  PLEASE
19//     CONSULT THE OWNERS AND opensource-licensing@google.com BEFORE
20//     DEPENDING ON IT IN YOUR PROJECT. ***
21package {
22    default_applicable_licenses: ["external_ltp_license"],
23    default_team: "trendy_team_android_kernel",
24}
25
26// Added automatically by a large-scale-change that took the approach of
27// 'apply every license found to every target'. While this makes sure we respect
28// every license restriction, it may not be entirely correct.
29//
30// e.g. GPL in an MIT project might only apply to the contrib/ directory.
31//
32// Please consider splitting the single license below into multiple licenses,
33// taking care not to lose any license_kind information, and overriding the
34// default license using the 'licenses: [...]' property on targets as needed.
35//
36// For unused files, consider creating a 'fileGroup' with "//visibility:private"
37// to attach the license to, and including a comment whether the files may be
38// used in the current project.
39//
40// large-scale-change included anything that looked like it might be a license
41// text as a license_text. e.g. LICENSE, NOTICE, COPYING etc.
42//
43// Please consider removing redundant or irrelevant files from 'license_text:'.
44// See: http://go/android-license-faq
45license {
46    name: "external_ltp_license",
47    visibility: [":__subpackages__"],
48    license_kinds: [
49        "SPDX-license-identifier-APSL-1.1",
50        "SPDX-license-identifier-Apache-2.0",
51        "SPDX-license-identifier-BSD",
52        "SPDX-license-identifier-BSD-2-Clause",
53        "SPDX-license-identifier-BSD-3-Clause",
54        "SPDX-license-identifier-GFDL", // by exception only
55        "SPDX-license-identifier-GPL",
56        "SPDX-license-identifier-GPL-2.0",
57        "SPDX-license-identifier-GPL-3.0",
58        "SPDX-license-identifier-ISC",
59        "SPDX-license-identifier-LGPL",
60    ],
61    license_text: [
62        "COPYING",
63        "NOTICE",
64    ],
65}
66
67build = ["gen.bp"]
68
69// The gen.bp file will be embedded in the gen_ltp_config tool,
70// which reads its data using pkgutil.get_data(). As far as I can
71// tell, there's no way to read a file in the root of the python
72// zip, so we have to use a genrule here to move gen.bp to an
73// arbitrary subfolder first.
74genrule {
75    name: "ltp_gen_bp_file",
76    srcs: ["gen.bp"],
77    out: ["android/tools/gen.bp"],
78    cmd: "cp $(in) $(out)",
79}
80
81filegroup {
82    name: "ltp_runtests",
83    srcs: ["runtest/*"],
84}
85
86filegroup {
87    name: "ltp_disabled_tests",
88    srcs: ["android/tools/disabled_tests.txt"],
89}
90
91genrule {
92    name: "ltp_syscalls_h",
93    tool_files: [
94        "include/lapi/syscalls/order",
95        "include/lapi/syscalls/regen.sh",
96        "include/lapi/syscalls/*.in",
97    ],
98    cmd: "$(location include/lapi/syscalls/regen.sh) $(genDir)/lapi/syscalls.h",
99    out: ["lapi/syscalls.h"],
100}
101
102genrule {
103    name: "ltp_version_h",
104    srcs: [
105        "VERSION",
106    ],
107    cmd: "echo \"#define LTP_VERSION \\\"$$(cat $(in))\\\"\" > $(out)",
108    out: ["ltp-version.h"],
109}
110
111cc_defaults {
112    name: "ltp_defaults",
113
114    cflags: [
115        // Hacks for bionic compatibility
116        "-include bionic-compat.h",
117        "-fcommon", //ld.lld: error: duplicate symbol use_the_ltp_clone_functions__do_not_use_clone
118        // Too many files import sched.h so we enable -fcommon locally
119        // ltp may get away with this with glibc because of the __USE_GNU guard in glibc's <sched.h>
120        "-Wall",
121        "-Werror",
122        // These warnings should be checked and fixed upstream
123        "-Wno-absolute-value",
124        "-Wno-uninitialized",
125        "-Wno-user-defined-warnings",
126        // Silence noisy warnings
127        "-Wno-constant-conversion",
128        "-Wno-deprecated",
129        "-Wno-duplicate-decl-specifier",
130        "-Wno-empty-body",
131        "-Wno-format",
132        "-Wno-gnu-designator",
133        "-Wno-implicit-function-declaration",
134        "-Wno-incompatible-pointer-types-discards-qualifiers",
135        "-Wno-knr-promoted-parameter",
136        "-Wno-macro-redefined",
137        "-Wno-missing-braces",
138        "-Wno-missing-field-initializers",
139        "-Wno-parentheses-equality",
140        "-Wno-pointer-arith",
141        "-Wno-pointer-sign",
142        "-Wno-sign-compare",
143        "-Wno-tautological-compare",
144        "-Wno-unneeded-internal-declaration",
145        "-Wno-unreachable-code-loop-increment",
146        "-Wno-unused-function",
147        "-Wno-unused-parameter",
148        "-Wno-unused-variable",
149    ],
150
151    local_include_dirs: [
152        "android/include",
153        "include",
154    ],
155
156    target: {
157        // bionic has broken signal handling for signum > 32 on 32-bit ARM and x86
158        // (for ABI reasons this can't be fixed)
159        android_arm: {
160            cflags: ["-DNUMSIGS=32"],
161        },
162        android_x86: {
163            cflags: ["-DNUMSIGS=32"],
164        },
165    },
166
167    generated_headers: [
168        "ltp_syscalls_h",
169        "ltp_version_h",
170    ],
171
172    static_libs: ["libcap"],
173
174    // TODO: recover libaio when the external project created
175    shared_libs: [
176        "libselinux",
177        "libasyncio",
178    ],
179}
180
181cc_defaults {
182    name: "ltp_test_defaults",
183    defaults: ["ltp_defaults"],
184    gtest: false,
185    cflags: ["-Wno-gnu-variable-sized-type-not-at-end"],
186    no_named_install_directory: true,
187    relative_install_path: "ltp/testcases/bin",
188}
189