github.com/distbuild/reclient@v0.0.0-20240401075343-3de72e395564/configs/linux_android1404/cc/BUILD (about) 1 # Copyright 2016 The Bazel Authors. All rights reserved. 2 # 3 # Licensed under the Apache License, Version 2.0 (the "License"); 4 # you may not use this file except in compliance with the License. 5 # You may obtain a copy of the License at 6 # 7 # http://www.apache.org/licenses/LICENSE-2.0 8 # 9 # Unless required by applicable law or agreed to in writing, software 10 # distributed under the License is distributed on an "AS IS" BASIS, 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 # See the License for the specific language governing permissions and 13 # limitations under the License. 14 15 # This becomes the BUILD file for @local_config_cc// under non-BSD unixes. 16 17 load(":cc_toolchain_config.bzl", "cc_toolchain_config") 18 load(":armeabi_cc_toolchain_config.bzl", "armeabi_cc_toolchain_config") 19 load("@rules_cc//cc:defs.bzl", "cc_toolchain", "cc_toolchain_suite") 20 21 clang_version = "r498229b" 22 23 clang_short_version = "17" 24 25 filegroup( 26 name = "empty", 27 srcs = [], 28 ) 29 30 filegroup( 31 name = "compiler_deps", 32 srcs = glob( 33 ["extra_tools/**"], 34 allow_empty = True, 35 ), 36 ) 37 38 cc_toolchain_suite( 39 name = "toolchain-1404", 40 tags = ["manual"], 41 toolchains = { 42 "k8|clang": ":cc-compiler-k8-1404", 43 "k8": ":cc-compiler-k8-1404", 44 "armeabi-v7a|compiler": ":cc-compiler-armeabi-v7a", 45 "armeabi-v7a": ":cc-compiler-armeabi-v7a", 46 }, 47 ) 48 49 cc_toolchain( 50 name = "cc-compiler-k8-1404", 51 all_files = ":compiler_deps", 52 ar_files = ":compiler_deps", 53 as_files = ":compiler_deps", 54 compiler_files = ":compiler_deps", 55 dwp_files = ":empty", 56 linker_files = ":compiler_deps", 57 module_map = None, 58 objcopy_files = ":empty", 59 strip_files = ":empty", 60 supports_param_files = 1, 61 toolchain_config = ":linux_gnu_x86-1404", 62 toolchain_identifier = "linux_gnu_x86-1404", 63 ) 64 65 cc_toolchain_config( 66 name = "linux_gnu_x86-1404", 67 abi_libc_version = "glibc_2.19", 68 abi_version = "clang", 69 compile_flags = [ 70 "-fstack-protector", 71 "-Wall", 72 "-Wthread-safety", 73 "-Wself-assign", 74 "-fcolor-diagnostics", 75 "-fno-omit-frame-pointer", 76 ], 77 compiler = "clang", 78 coverage_compile_flags = ["--coverage"], 79 coverage_link_flags = ["--coverage"], 80 cpu = "k8", 81 cxx_builtin_include_directories = [ 82 "android_prebuilts/x86_64-linux-glibc2.17-4.8/sysroot/usr/include/x86_64-linux-gnu", 83 "android_prebuilts/x86_64-linux-glibc2.17-4.8/sysroot/usr/include", 84 "android_prebuilts/clang-" + clang_version + "/lib/clang/" + clang_short_version + "/include", 85 "android_prebuilts/clang-" + clang_version + "/include/c++/v1", 86 "android_prebuilts/clang-" + clang_version + "/include/x86_64-unknown-linux-gnu/c++/v1", 87 ], 88 cxx_flags = ["-std=c++0x"], 89 dbg_compile_flags = ["-g"], 90 host_system_name = "i686-unknown-linux-gnu", 91 link_flags = [ 92 "-Wl,-no-as-needed", 93 "-Wl,-z,relro,-z,now", 94 "-B/usr/local/bin", 95 "-B/usr/bin", 96 "-Bconfigs/linux_android1404/cc/android_prebuilts/x86_64-linux-glibc2.17-4.8/lib/gcc/x86_64-linux/4.8.3", 97 "-Lconfigs/linux_android1404/cc/android_prebuilts/x86_64-linux-glibc2.17-4.8/lib/gcc/x86_64-linux/4.8.3", 98 "--sysroot=configs/linux_android1404/cc/android_prebuilts/x86_64-linux-glibc2.17-4.8/sysroot", 99 "-Bconfigs/linux_android1404/cc/android_prebuilts/x86_64-linux-glibc2.17-4.8/x86_64-linux/lib64", 100 "-Lconfigs/linux_android1404/cc/android_prebuilts/x86_64-linux-glibc2.17-4.8/x86_64-linux/lib64", 101 "-Wl,-Bstatic", 102 "-Wl,-Lconfigs/linux_android1404/cc/android_prebuilts/clang-" + clang_version + "/lib/x86_64-unknown-linux-gnu", 103 "-stdlib=libc++", 104 "-lc++", 105 "-Wl,-Bdynamic", 106 ], 107 link_libs = [ 108 "-lm", 109 ], 110 opt_compile_flags = [ 111 "-g0", 112 "-O2", 113 "-D_FORTIFY_SOURCE=1", 114 "-DNDEBUG", 115 "-ffunction-sections", 116 "-fdata-sections", 117 ], 118 opt_link_flags = ["-Wl,--gc-sections"], 119 supports_start_end_lib = False, 120 target_libc = "glibc_2.19", 121 target_system_name = "x86_64-unknown-linux-gnu", 122 tool_paths = { 123 "ar": "/usr/bin/ar", 124 "ld": "/usr/bin/ld", 125 "llvm-cov": "/usr/local/bin/llvm-cov", 126 "llvm-profdata": "/usr/local/bin/llvm-profdata", 127 "cpp": "/usr/bin/cpp", 128 "gcc": "android_prebuilts/clang-" + clang_version + "/bin/clang", 129 "dwp": "/usr/bin/dwp", 130 "gcov": "/dev/null", 131 "nm": "/usr/bin/nm", 132 "objcopy": "/usr/bin/objcopy", 133 "objdump": "/usr/bin/objdump", 134 "strip": "/usr/bin/strip", 135 }, 136 toolchain_identifier = "linux_gnu_x86-1404", 137 unfiltered_compile_flags = [ 138 "-no-canonical-prefixes", 139 "-Wno-builtin-macro-redefined", 140 "-D__DATE__=\"redacted\"", 141 "-D__TIMESTAMP__=\"redacted\"", 142 "-D__TIME__=\"redacted\"", 143 "-Wno-deprecated-builtins", 144 "-Wno-unused-but-set-variable", 145 "-Wno-unused-command-line-argument", 146 "-Wno-gnu-offsetof-extensions", 147 "-stdlib=libc++", 148 "--sysroot=configs/linux_android1404/cc/android_prebuilts/x86_64-linux-glibc2.17-4.8/sysroot", 149 ], 150 ) 151 152 # Android tooling requires a default toolchain for the armeabi-v7a cpu. 153 cc_toolchain( 154 name = "cc-compiler-armeabi-v7a", 155 all_files = ":empty", 156 ar_files = ":empty", 157 as_files = ":empty", 158 compiler_files = ":empty", 159 dwp_files = ":empty", 160 linker_files = ":empty", 161 objcopy_files = ":empty", 162 strip_files = ":empty", 163 supports_param_files = 1, 164 toolchain_config = ":stub_armeabi-v7a", 165 toolchain_identifier = "stub_armeabi-v7a", 166 ) 167 168 armeabi_cc_toolchain_config(name = "stub_armeabi-v7a")