blob: 5be8599f64652d1ea06edd857b47e77342d14ca0 [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
29cc_benchmark {
30 name: "bionic-spawn-benchmarks",
31 srcs: ["spawn_benchmarks.cpp"],
Tom Cherry2f95d192020-01-09 10:06:12 -080032 static_libs: [
33 "libbase",
34 "liblog",
35 ],
Ryan Prichard2c236bc2019-09-26 12:47:47 -070036
37 // Install these binaries in the same directory as the main benchmark binary.
38 data: [
39 ":bench_noop",
40 ":bench_noop_nostl",
41 ":bench_noop_static",
42 ],
43
44 host_supported: true,
45 target: {
Tom Cherry2f95d192020-01-09 10:06:12 -080046 darwin: {
47 enabled: false,
48 },
49 windows: {
50 enabled: false,
51 },
52 linux_glibc_x86: {
53 enabled: false,
54 },
Ryan Prichard2c236bc2019-09-26 12:47:47 -070055 },
56}
57
58cc_defaults {
59 name: "noop_binary_defaults",
60
61 compile_multilib: "both",
62 multilib: {
Tom Cherry2f95d192020-01-09 10:06:12 -080063 lib32: {
64 suffix: "32",
65 },
66 lib64: {
67 suffix: "64",
68 },
Ryan Prichard2c236bc2019-09-26 12:47:47 -070069 },
70
71 host_supported: true,
72 target: {
Tom Cherry2f95d192020-01-09 10:06:12 -080073 darwin: {
74 enabled: false,
75 },
76 windows: {
77 enabled: false,
78 },
79 linux_glibc_x86: {
80 enabled: false,
81 },
Ryan Prichard2c236bc2019-09-26 12:47:47 -070082 },
83}
84
85cc_binary {
86 defaults: ["noop_binary_defaults"],
87 name: "bench_noop",
88 srcs: ["noop.cpp"],
89
90 // When this binary is installed to host/linux-x86/bin, its runpath is ${ORIGIN}/../lib64, which
91 // is fine for finding host/linux-x86/lib64/libc++.so. When it's installed to
92 // host/linux-x86/benchmarktest64/bionic-spawn-benchmarks, the runpath needs an extra "..".
93 target: {
94 linux_glibc_x86_64: {
95 ldflags: [
96 "-Wl,--rpath,${ORIGIN}/../../lib64",
97 ],
98 },
Tom Cherry2f95d192020-01-09 10:06:12 -080099 },
Ryan Prichard2c236bc2019-09-26 12:47:47 -0700100}
101
102cc_binary {
103 defaults: ["noop_binary_defaults"],
104 name: "bench_noop_nostl",
105 srcs: ["noop.cpp"],
106 stl: "none",
107}
108
109cc_binary {
110 defaults: ["noop_binary_defaults"],
111 name: "bench_noop_static",
112 srcs: ["noop.cpp"],
113 static_executable: true,
114 stl: "libc++_static",
115}