Ryan Prichard | 2c236bc | 2019-09-26 12:47:47 -0700 | [diff] [blame] | 1 | // |
| 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 | |
Bob Badour | 48d4303 | 2021-02-12 17:51:24 -0800 | [diff] [blame] | 29 | package { |
| 30 | // See: http://go/android-license-faq |
| 31 | // A large-scale-change added 'default_applicable_licenses' to import |
| 32 | // all of the 'license_kinds' from "bionic_license" |
| 33 | // to get the below license kinds: |
| 34 | // SPDX-license-identifier-BSD |
| 35 | default_applicable_licenses: ["bionic_license"], |
| 36 | } |
| 37 | |
Ryan Prichard | 41f1970 | 2019-12-23 13:21:42 -0800 | [diff] [blame] | 38 | cc_defaults { |
| 39 | name: "bionic_spawn_benchmark_targets", |
Ryan Prichard | 2c236bc | 2019-09-26 12:47:47 -0700 | [diff] [blame] | 40 | host_supported: true, |
| 41 | target: { |
Tom Cherry | 2f95d19 | 2020-01-09 10:06:12 -0800 | [diff] [blame] | 42 | darwin: { |
| 43 | enabled: false, |
| 44 | }, |
| 45 | windows: { |
| 46 | enabled: false, |
| 47 | }, |
| 48 | linux_glibc_x86: { |
| 49 | enabled: false, |
| 50 | }, |
Ryan Prichard | 2c236bc | 2019-09-26 12:47:47 -0700 | [diff] [blame] | 51 | }, |
| 52 | } |
| 53 | |
Ryan Prichard | 41f1970 | 2019-12-23 13:21:42 -0800 | [diff] [blame] | 54 | cc_library_static { |
| 55 | name: "libbionic_spawn_benchmark", |
| 56 | defaults: ["bionic_spawn_benchmark_targets"], |
| 57 | |
| 58 | srcs: ["spawn_benchmark.cpp"], |
| 59 | export_include_dirs: ["include"], |
| 60 | static_libs: [ |
| 61 | "libbase", |
| 62 | "libgoogle-benchmark", |
| 63 | "liblog", |
| 64 | ], |
| 65 | } |
| 66 | |
| 67 | cc_benchmark { |
| 68 | name: "bionic-spawn-benchmarks", |
| 69 | defaults: ["bionic_spawn_benchmark_targets"], |
| 70 | |
| 71 | srcs: ["spawn_benchmarks.cpp"], |
| 72 | static_libs: [ |
| 73 | "libbase", |
| 74 | "libbionic_spawn_benchmark", |
| 75 | "liblog", |
| 76 | ], |
| 77 | |
| 78 | // Install these binaries in the same directory as the main benchmark binary. |
| 79 | data: [ |
Ryan Prichard | a3d41ee | 2020-10-07 16:32:27 -0700 | [diff] [blame] | 80 | ":bench_cxa_atexit", |
Ryan Prichard | 41f1970 | 2019-12-23 13:21:42 -0800 | [diff] [blame] | 81 | ":bench_noop", |
| 82 | ":bench_noop_nostl", |
| 83 | ":bench_noop_static", |
| 84 | ], |
| 85 | } |
| 86 | |
Ryan Prichard | 2c236bc | 2019-09-26 12:47:47 -0700 | [diff] [blame] | 87 | cc_defaults { |
Ryan Prichard | a3d41ee | 2020-10-07 16:32:27 -0700 | [diff] [blame] | 88 | name: "bionic_spawn_benchmark_binary", |
Ryan Prichard | 41f1970 | 2019-12-23 13:21:42 -0800 | [diff] [blame] | 89 | defaults: ["bionic_spawn_benchmark_targets"], |
Ryan Prichard | 2c236bc | 2019-09-26 12:47:47 -0700 | [diff] [blame] | 90 | |
| 91 | compile_multilib: "both", |
| 92 | multilib: { |
Tom Cherry | 2f95d19 | 2020-01-09 10:06:12 -0800 | [diff] [blame] | 93 | lib32: { |
| 94 | suffix: "32", |
| 95 | }, |
| 96 | lib64: { |
| 97 | suffix: "64", |
| 98 | }, |
Ryan Prichard | 2c236bc | 2019-09-26 12:47:47 -0700 | [diff] [blame] | 99 | }, |
Ryan Prichard | 2c236bc | 2019-09-26 12:47:47 -0700 | [diff] [blame] | 100 | |
| 101 | // When this binary is installed to host/linux-x86/bin, its runpath is ${ORIGIN}/../lib64, which |
| 102 | // is fine for finding host/linux-x86/lib64/libc++.so. When it's installed to |
Ryan Prichard | a3d41ee | 2020-10-07 16:32:27 -0700 | [diff] [blame] | 103 | // host/linux-x86/benchmarktest64/bionic-spawn-benchmarks, the runpath needs an extra "..". This |
| 104 | // argument has no effect when a static executable is produced. |
Ryan Prichard | 2c236bc | 2019-09-26 12:47:47 -0700 | [diff] [blame] | 105 | target: { |
| 106 | linux_glibc_x86_64: { |
| 107 | ldflags: [ |
| 108 | "-Wl,--rpath,${ORIGIN}/../../lib64", |
| 109 | ], |
| 110 | }, |
Tom Cherry | 2f95d19 | 2020-01-09 10:06:12 -0800 | [diff] [blame] | 111 | }, |
Ryan Prichard | 2c236bc | 2019-09-26 12:47:47 -0700 | [diff] [blame] | 112 | } |
| 113 | |
| 114 | cc_binary { |
Ryan Prichard | a3d41ee | 2020-10-07 16:32:27 -0700 | [diff] [blame] | 115 | defaults: ["bionic_spawn_benchmark_binary"], |
| 116 | name: "bench_cxa_atexit", |
| 117 | srcs: ["bench_cxa_atexit.cpp"], |
| 118 | } |
| 119 | |
| 120 | cc_binary { |
| 121 | defaults: ["bionic_spawn_benchmark_binary"], |
| 122 | name: "bench_noop", |
| 123 | srcs: ["noop.cpp"], |
| 124 | } |
| 125 | |
| 126 | cc_binary { |
| 127 | defaults: ["bionic_spawn_benchmark_binary"], |
Ryan Prichard | 2c236bc | 2019-09-26 12:47:47 -0700 | [diff] [blame] | 128 | name: "bench_noop_nostl", |
| 129 | srcs: ["noop.cpp"], |
| 130 | stl: "none", |
| 131 | } |
| 132 | |
| 133 | cc_binary { |
Ryan Prichard | a3d41ee | 2020-10-07 16:32:27 -0700 | [diff] [blame] | 134 | defaults: ["bionic_spawn_benchmark_binary"], |
Ryan Prichard | 2c236bc | 2019-09-26 12:47:47 -0700 | [diff] [blame] | 135 | name: "bench_noop_static", |
| 136 | srcs: ["noop.cpp"], |
| 137 | static_executable: true, |
| 138 | stl: "libc++_static", |
| 139 | } |