blob: 2276d2e01e37e25f7386540e70cff88afa1f473f [file] [log] [blame]
Ryan Prichard2c236bc2019-09-26 12:47:47 -07001//
2// Copyright (C) 2019 The Android Open Source Project
3// All rights reserved.
4//
5// Redistribution and use in source and binary forms, with or without
6// modification, are permitted provided that the following conditions
7// are met:
8// * Redistributions of source code must retain the above copyright
9// notice, this list of conditions and the following disclaimer.
10// * Redistributions in binary form must reproduce the above copyright
11// notice, this list of conditions and the following disclaimer in
12// the documentation and/or other materials provided with the
13// distribution.
14//
15// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
18// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
19// COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
20// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
22// OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23// AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26// SUCH DAMAGE.
27//
28
Ryan Prichard41f19702019-12-23 13:21:42 -080029cc_defaults {
30 name: "bionic_spawn_benchmark_targets",
Ryan Prichard2c236bc2019-09-26 12:47:47 -070031 host_supported: true,
32 target: {
Tom Cherry2f95d192020-01-09 10:06:12 -080033 darwin: {
34 enabled: false,
35 },
36 windows: {
37 enabled: false,
38 },
39 linux_glibc_x86: {
40 enabled: false,
41 },
Ryan Prichard2c236bc2019-09-26 12:47:47 -070042 },
43}
44
Ryan Prichard41f19702019-12-23 13:21:42 -080045cc_library_static {
46 name: "libbionic_spawn_benchmark",
47 defaults: ["bionic_spawn_benchmark_targets"],
48
49 srcs: ["spawn_benchmark.cpp"],
50 export_include_dirs: ["include"],
51 static_libs: [
52 "libbase",
53 "libgoogle-benchmark",
54 "liblog",
55 ],
56}
57
58cc_benchmark {
59 name: "bionic-spawn-benchmarks",
60 defaults: ["bionic_spawn_benchmark_targets"],
61
62 srcs: ["spawn_benchmarks.cpp"],
63 static_libs: [
64 "libbase",
65 "libbionic_spawn_benchmark",
66 "liblog",
67 ],
68
69 // Install these binaries in the same directory as the main benchmark binary.
70 data: [
71 ":bench_noop",
72 ":bench_noop_nostl",
73 ":bench_noop_static",
74 ],
75}
76
Ryan Prichard2c236bc2019-09-26 12:47:47 -070077cc_defaults {
78 name: "noop_binary_defaults",
Ryan Prichard41f19702019-12-23 13:21:42 -080079 defaults: ["bionic_spawn_benchmark_targets"],
Ryan Prichard2c236bc2019-09-26 12:47:47 -070080
81 compile_multilib: "both",
82 multilib: {
Tom Cherry2f95d192020-01-09 10:06:12 -080083 lib32: {
84 suffix: "32",
85 },
86 lib64: {
87 suffix: "64",
88 },
Ryan Prichard2c236bc2019-09-26 12:47:47 -070089 },
Ryan Prichard2c236bc2019-09-26 12:47:47 -070090}
91
92cc_binary {
93 defaults: ["noop_binary_defaults"],
94 name: "bench_noop",
95 srcs: ["noop.cpp"],
96
97 // When this binary is installed to host/linux-x86/bin, its runpath is ${ORIGIN}/../lib64, which
98 // is fine for finding host/linux-x86/lib64/libc++.so. When it's installed to
99 // host/linux-x86/benchmarktest64/bionic-spawn-benchmarks, the runpath needs an extra "..".
100 target: {
101 linux_glibc_x86_64: {
102 ldflags: [
103 "-Wl,--rpath,${ORIGIN}/../../lib64",
104 ],
105 },
Tom Cherry2f95d192020-01-09 10:06:12 -0800106 },
Ryan Prichard2c236bc2019-09-26 12:47:47 -0700107}
108
109cc_binary {
110 defaults: ["noop_binary_defaults"],
111 name: "bench_noop_nostl",
112 srcs: ["noop.cpp"],
113 stl: "none",
114}
115
116cc_binary {
117 defaults: ["noop_binary_defaults"],
118 name: "bench_noop_static",
119 srcs: ["noop.cpp"],
120 static_executable: true,
121 stl: "libc++_static",
122}