github.com/prysmaticlabs/prysm@v1.4.4/tools/cross-toolchain/configs/clang/bazel_2.1.1/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-FreeBSD unixes. 16 17 package(default_visibility = ["//visibility:public"]) 18 19 load(":cc_toolchain_config.bzl", "cc_toolchain_config") 20 load(":armeabi_cc_toolchain_config.bzl", "armeabi_cc_toolchain_config") 21 load("@rules_cc//cc:defs.bzl", "cc_toolchain", "cc_toolchain_suite") 22 23 licenses(["notice"]) # Apache 2.0 24 25 cc_library( 26 name = "malloc", 27 ) 28 29 filegroup( 30 name = "empty", 31 srcs = [], 32 ) 33 34 filegroup( 35 name = "cc_wrapper", 36 srcs = ["cc_wrapper.sh"], 37 ) 38 39 filegroup( 40 name = "compiler_deps", 41 srcs = glob( 42 ["extra_tools/**"], 43 allow_empty = True, 44 ) + [":builtin_include_directory_paths"], 45 ) 46 47 # This is the entry point for --crosstool_top. Toolchains are found 48 # by lopping off the name of --crosstool_top and searching for 49 # the "${CPU}" entry in the toolchains attribute. 50 cc_toolchain_suite( 51 name = "toolchain", 52 toolchains = { 53 "k8|clang": ":cc-compiler-k8", 54 "k8": ":cc-compiler-k8", 55 "armeabi-v7a|compiler": ":cc-compiler-armeabi-v7a", 56 "armeabi-v7a": ":cc-compiler-armeabi-v7a", 57 }, 58 ) 59 60 cc_toolchain( 61 name = "cc-compiler-k8", 62 all_files = ":compiler_deps", 63 ar_files = ":compiler_deps", 64 as_files = ":compiler_deps", 65 compiler_files = ":compiler_deps", 66 dwp_files = ":empty", 67 linker_files = ":compiler_deps", 68 objcopy_files = ":empty", 69 strip_files = ":empty", 70 supports_param_files = 1, 71 toolchain_config = ":local", 72 toolchain_identifier = "local", 73 ) 74 75 cc_toolchain_config( 76 name = "local", 77 abi_libc_version = "local", 78 abi_version = "local", 79 compile_flags = [ 80 "-U_FORTIFY_SOURCE", 81 "-fstack-protector", 82 "-Wall", 83 "-Wthread-safety", 84 "-Wself-assign", 85 "-fcolor-diagnostics", 86 "-fno-omit-frame-pointer", 87 ], 88 compiler = "clang", 89 coverage_compile_flags = [ 90 "-fprofile-instr-generate", 91 "-fcoverage-mapping", 92 ], 93 coverage_link_flags = ["-fprofile-instr-generate"], 94 cpu = "k8", 95 cxx_builtin_include_directories = [ 96 "/usr/local/include", 97 "/usr/lib/clang/10.0.0/include", 98 "/usr/include/x86_64-linux-gnu", 99 "/usr/include", 100 "/usr/include/c++/8", 101 "/usr/include/x86_64-linux-gnu/c++/8", 102 "/usr/include/c++/8/backward", 103 ], 104 cxx_flags = ["-std=c++0x"], 105 dbg_compile_flags = ["-g"], 106 host_system_name = "local", 107 link_flags = [ 108 "-fuse-ld=/usr/bin/ld.gold", 109 "-Wl,-no-as-needed", 110 "-Wl,-z,relro,-z,now", 111 "-B/usr/bin", 112 "-lm", 113 "-static-libgcc", 114 ], 115 link_libs = ["-l:libstdc++.a"], 116 opt_compile_flags = [ 117 "-g0", 118 "-O2", 119 "-D_FORTIFY_SOURCE=1", 120 "-DNDEBUG", 121 "-ffunction-sections", 122 "-fdata-sections", 123 ], 124 opt_link_flags = ["-Wl,--gc-sections"], 125 supports_start_end_lib = True, 126 target_libc = "local", 127 target_system_name = "local", 128 tool_paths = { 129 "ar": "/usr/bin/ar", 130 "ld": "/usr/bin/ld", 131 "cpp": "/usr/bin/cpp", 132 "gcc": "/usr/bin/clang", 133 "dwp": "/usr/bin/dwp", 134 "gcov": "/usr/bin/llvm-profdata", 135 "nm": "/usr/bin/nm", 136 "objcopy": "/usr/bin/objcopy", 137 "objdump": "/usr/bin/objdump", 138 "strip": "/usr/bin/strip", 139 }, 140 toolchain_identifier = "local", 141 unfiltered_compile_flags = [ 142 "-no-canonical-prefixes", 143 "-Wno-builtin-macro-redefined", 144 "-D__DATE__=\"redacted\"", 145 "-D__TIMESTAMP__=\"redacted\"", 146 "-D__TIME__=\"redacted\"", 147 ], 148 ) 149 150 # Android tooling requires a default toolchain for the armeabi-v7a cpu. 151 cc_toolchain( 152 name = "cc-compiler-armeabi-v7a", 153 all_files = ":empty", 154 ar_files = ":empty", 155 as_files = ":empty", 156 compiler_files = ":empty", 157 dwp_files = ":empty", 158 linker_files = ":empty", 159 objcopy_files = ":empty", 160 strip_files = ":empty", 161 supports_param_files = 1, 162 toolchain_config = ":stub_armeabi-v7a", 163 toolchain_identifier = "stub_armeabi-v7a", 164 ) 165 166 armeabi_cc_toolchain_config(name = "stub_armeabi-v7a")