| 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 |  | 
|  | 29 | cc_benchmark { | 
|  | 30 | name: "bionic-spawn-benchmarks", | 
|  | 31 | srcs: ["spawn_benchmarks.cpp"], | 
|  | 32 | static_libs: ["libbase"], | 
|  | 33 |  | 
|  | 34 | // Install these binaries in the same directory as the main benchmark binary. | 
|  | 35 | data: [ | 
|  | 36 | ":bench_noop", | 
|  | 37 | ":bench_noop_nostl", | 
|  | 38 | ":bench_noop_static", | 
|  | 39 | ], | 
|  | 40 |  | 
|  | 41 | host_supported: true, | 
|  | 42 | target: { | 
|  | 43 | darwin: { enabled: false }, | 
|  | 44 | windows: { enabled: false }, | 
|  | 45 | linux_glibc_x86: { enabled: false }, | 
|  | 46 | }, | 
|  | 47 | } | 
|  | 48 |  | 
|  | 49 | cc_defaults { | 
|  | 50 | name: "noop_binary_defaults", | 
|  | 51 |  | 
|  | 52 | compile_multilib: "both", | 
|  | 53 | multilib: { | 
|  | 54 | lib32: { suffix: "32" }, | 
|  | 55 | lib64: { suffix: "64" }, | 
|  | 56 | }, | 
|  | 57 |  | 
|  | 58 | host_supported: true, | 
|  | 59 | target: { | 
|  | 60 | darwin: { enabled: false }, | 
|  | 61 | windows: { enabled: false }, | 
|  | 62 | linux_glibc_x86: { enabled: false }, | 
|  | 63 | }, | 
|  | 64 | } | 
|  | 65 |  | 
|  | 66 | cc_binary { | 
|  | 67 | defaults: ["noop_binary_defaults"], | 
|  | 68 | name: "bench_noop", | 
|  | 69 | srcs: ["noop.cpp"], | 
|  | 70 |  | 
|  | 71 | // When this binary is installed to host/linux-x86/bin, its runpath is ${ORIGIN}/../lib64, which | 
|  | 72 | // is fine for finding host/linux-x86/lib64/libc++.so. When it's installed to | 
|  | 73 | // host/linux-x86/benchmarktest64/bionic-spawn-benchmarks, the runpath needs an extra "..". | 
|  | 74 | target: { | 
|  | 75 | linux_glibc_x86_64: { | 
|  | 76 | ldflags: [ | 
|  | 77 | "-Wl,--rpath,${ORIGIN}/../../lib64", | 
|  | 78 | ], | 
|  | 79 | }, | 
|  | 80 | } | 
|  | 81 | } | 
|  | 82 |  | 
|  | 83 | cc_binary { | 
|  | 84 | defaults: ["noop_binary_defaults"], | 
|  | 85 | name: "bench_noop_nostl", | 
|  | 86 | srcs: ["noop.cpp"], | 
|  | 87 | stl: "none", | 
|  | 88 | } | 
|  | 89 |  | 
|  | 90 | cc_binary { | 
|  | 91 | defaults: ["noop_binary_defaults"], | 
|  | 92 | name: "bench_noop_static", | 
|  | 93 | srcs: ["noop.cpp"], | 
|  | 94 | static_executable: true, | 
|  | 95 | stl: "libc++_static", | 
|  | 96 | } |