aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2017-03-31 00:30:59 -0700
committerStephen Hines <srhines@google.com>2017-04-03 16:01:51 -0700
commitb3543b1ddad5863dc782f842697885685d5567ec (patch)
tree55eebfbef4511db7677c71caf3ed3f56f3cbb302
parentda30577b6a9434ca570984d50a48fe96018995c2 (diff)
downloadprebuilts_clang_host_linux-x86-oreo-dev.tar.gz
prebuilts_clang_host_linux-x86-oreo-dev.tar.bz2
prebuilts_clang_host_linux-x86-oreo-dev.zip
Support a prebuilt libFuzzer.a for use in Android target builds.android-vts-8.0_r2android-vts-8.0_r1oreo-dev
Bug: http://b/35432050 This change adds prebuilt rules for libFuzzer.a for each Android target architecture. libFuzzer.a needs to be a prebuilt, because it must match the host Clang compiler that is used to compile other code with it. We previously were always "lucky" that our host Clang remained mostly compatible with the on-device LLVM sources (which usually trail behind the host compiler by a few weeks). For expediency, we use a fixed version number for the host Clang prebuilt to match the libFuzzer.a prebuilts. This requires that we update yet another version number when we upgrade our toolchain, but it is faster than generating a new set of rules in Soong for creating "fuzz_test" executables. Test: Builds vts fuzzer tests successfully. (cherry picked from commit b705d67f188995750344296e80d67776e0252cc2) Change-Id: Ic5bcfa95643a7e008fefef288813e0e0b5b8b8a0
-rw-r--r--Android.bp46
1 files changed, 46 insertions, 0 deletions
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 00000000..d9f1783c
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,46 @@
+//
+// Copyright (C) 2017 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+
+clang_version = "3859424"
+clang_libfuzzer_dir = "clang-" + clang_version + "/lib64/clang/4.0/lib/linux/"
+
+cc_prebuilt_library_static {
+ name: "libFuzzer",
+ export_include_dirs: ["clang-" + clang_version + "/prebuilt_include/llvm/lib/Fuzzer/"],
+ target: {
+ android_arm: {
+ srcs: [clang_libfuzzer_dir + "arm/libFuzzer.a"],
+ },
+ android_arm64: {
+ srcs: [clang_libfuzzer_dir + "aarch64/libFuzzer.a"],
+ },
+ android_mips: {
+ srcs: [clang_libfuzzer_dir + "mips/libFuzzer.a"],
+ },
+ android_mips64: {
+ srcs: [clang_libfuzzer_dir + "mips64/libFuzzer.a"],
+ },
+ android_x86: {
+ srcs: [clang_libfuzzer_dir + "i386/libFuzzer.a"],
+ },
+ android_x86_64: {
+ srcs: [clang_libfuzzer_dir + "x86_64/libFuzzer.a"],
+ },
+ },
+ sanitize: {
+ never: true,
+ },
+}