blob: 89b4e11a2607d2ce973a9e042e5ab990aaa4895a [file] [log] [blame]
Christopher Ferriscbfcc162019-09-24 12:28:10 -07001//
2// Copyright (C) 2019 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
Peter Collingbourne1c182602019-11-19 16:07:42 -080017cc_defaults {
18 name: "libscudo_defaults",
Christopher Ferriscbfcc162019-09-24 12:28:10 -070019 native_coverage: false,
20 recovery_available: true,
21 host_supported: true,
22 native_bridge_supported: true,
23
24 rtti: false,
25 stl: "none",
26
27 cflags: [
28 "-O3",
29 "-fno-rtti",
Christopher Ferris7435ef72019-09-25 17:43:02 -070030 // This option speeds up alloc/free code paths by about 5% to 7%.
31 "-fno-stack-protector",
Peter Collingbourne1c182602019-11-19 16:07:42 -080032 "-fno-emulated-tls",
Christopher Ferriscbfcc162019-09-24 12:28:10 -070033
34 "-Wall",
35 "-Wextra",
36 "-Wunused",
37 "-Wno-unused-result",
38
39 "-Werror=pointer-to-int-cast",
40 "-Werror=int-to-pointer-cast",
41 "-Werror=type-limits",
42 "-Werror",
Christopher Ferriscbfcc162019-09-24 12:28:10 -070043 ],
44 cppflags: [
45 "-nostdinc++",
46 "-fno-exceptions",
47 ],
48
49 system_shared_libs: [],
50
51 srcs: [
52 "standalone/checksum.cpp",
53 "standalone/common.cpp",
54 "standalone/flags.cpp",
55 "standalone/flags_parser.cpp",
56 "standalone/linux.cpp",
57 "standalone/report.cpp",
Christopher Ferriscbfcc162019-09-24 12:28:10 -070058 "standalone/string_utils.cpp",
59 "standalone/wrappers_c_bionic.cpp"
60 ],
61 arch: {
62 arm: {
63 cflags: ["-mcrc"],
64 srcs: ["standalone/crc32_hw.cpp"],
65 },
66 arm64: {
67 cflags: ["-mcrc"],
68 srcs: ["standalone/crc32_hw.cpp"],
69 },
70 x86_64: {
71 cflags: ["-msse4.2"],
72 srcs: ["standalone/crc32_hw.cpp"],
73 },
74 x86: {
75 cflags: ["-msse4.2"],
76 srcs: ["standalone/crc32_hw.cpp"],
77 },
78 },
79
80 target: {
81 linux_glibc: {
82 enabled: true,
83 },
84 },
85
Christopher Ferris3e5aef02019-09-25 20:15:25 -070086 header_libs: [
87 "bionic_libc_platform_headers",
Christopher Ferriscbfcc162019-09-24 12:28:10 -070088 ],
89}
Peter Collingbourne1c182602019-11-19 16:07:42 -080090
91cc_library_static {
92 name: "libscudo",
93 defaults: ["libscudo_defaults"],
94 cflags: ["-D_BIONIC=1"],
95}
96
97cc_library_static {
98 name: "libscudo_for_testing",
99 defaults: ["libscudo_defaults"],
100}
101
102cc_test {
103 name: "scudo_unit_tests",
Christopher Ferrisdadba4c2019-11-21 14:34:40 -0800104 host_supported: true,
Peter Collingbourne1c182602019-11-19 16:07:42 -0800105 srcs: [
106 "standalone/tests/atomic_test.cpp",
107 "standalone/tests/bytemap_test.cpp",
108 "standalone/tests/checksum_test.cpp",
109 "standalone/tests/chunk_test.cpp",
110 "standalone/tests/combined_test.cpp",
111 "standalone/tests/flags_test.cpp",
112 "standalone/tests/list_test.cpp",
113 "standalone/tests/map_test.cpp",
114 "standalone/tests/mutex_test.cpp",
115 "standalone/tests/primary_test.cpp",
116 "standalone/tests/quarantine_test.cpp",
117 "standalone/tests/release_test.cpp",
118 "standalone/tests/report_test.cpp",
119 "standalone/tests/scudo_unit_test_main.cpp",
120 "standalone/tests/secondary_test.cpp",
121 "standalone/tests/size_class_map_test.cpp",
122 "standalone/tests/stats_test.cpp",
123 "standalone/tests/strings_test.cpp",
124 "standalone/tests/tsd_test.cpp",
125 "standalone/tests/vector_test.cpp",
126 ],
127 static_libs: ["libscudo_for_testing"],
128 include_dirs: [
129 "external",
130 "external/scudo/standalone",
131 ],
132 cflags: [
133 "-Wno-unused-parameter",
134 "-fno-emulated-tls",
135 ],
Christopher Ferrisdadba4c2019-11-21 14:34:40 -0800136 test_suites: ["general-tests"],
Peter Collingbourne1c182602019-11-19 16:07:42 -0800137}