github.com/prysmaticlabs/prysm@v1.4.4/tools/cross-toolchain/configs/clang/bazel_3.7.0/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  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      module_map = ":module.modulemap",
    69      objcopy_files = ":empty",
    70      strip_files = ":empty",
    71      supports_param_files = 1,
    72      toolchain_config = ":local",
    73      toolchain_identifier = "local",
    74  )
    75  
    76  cc_toolchain_config(
    77      name = "local",
    78      abi_libc_version = "local",
    79      abi_version = "local",
    80      compile_flags = [
    81          "-U_FORTIFY_SOURCE",
    82          "-fstack-protector",
    83          "-Wall",
    84          "-Wthread-safety",
    85          "-Wself-assign",
    86          "-fcolor-diagnostics",
    87          "-fno-omit-frame-pointer",
    88      ],
    89      compiler = "clang",
    90      coverage_compile_flags = [
    91          "-fprofile-instr-generate",
    92          "-fcoverage-mapping",
    93      ],
    94      coverage_link_flags = ["-fprofile-instr-generate"],
    95      cpu = "k8",
    96      cxx_builtin_include_directories = [
    97          "/usr/local/include",
    98          "/usr/lib/clang/10.0.0/include",
    99          "/usr/include/x86_64-linux-gnu",
   100          "/usr/include",
   101          "/usr/lib/clang/10.0.0/share",
   102          "/usr/include/c++/8",
   103          "/usr/include/x86_64-linux-gnu/c++/8",
   104          "/usr/include/c++/8/backward",
   105      ],
   106      cxx_flags = ["-std=c++0x"],
   107      dbg_compile_flags = ["-g"],
   108      host_system_name = "local",
   109      link_flags = [
   110          "-fuse-ld=/usr/bin/ld.gold",
   111          "-Wl,-no-as-needed",
   112          "-Wl,-z,relro,-z,now",
   113          "-B/usr/bin",
   114          "-lm",
   115          "-static-libgcc",
   116      ],
   117      link_libs = ["-l:libstdc++.a"],
   118      opt_compile_flags = [
   119          "-g0",
   120          "-O2",
   121          "-D_FORTIFY_SOURCE=1",
   122          "-DNDEBUG",
   123          "-ffunction-sections",
   124          "-fdata-sections",
   125      ],
   126      opt_link_flags = ["-Wl,--gc-sections"],
   127      supports_start_end_lib = True,
   128      target_libc = "local",
   129      target_system_name = "local",
   130      tool_paths = {
   131          "ar": "/usr/bin/ar",
   132          "ld": "/usr/bin/ld",
   133          "cpp": "/usr/bin/cpp",
   134          "gcc": "/usr/bin/clang",
   135          "dwp": "/usr/bin/dwp",
   136          "gcov": "/usr/bin/llvm-profdata",
   137          "nm": "/usr/bin/nm",
   138          "objcopy": "/usr/bin/objcopy",
   139          "objdump": "/usr/bin/objdump",
   140          "strip": "/usr/bin/strip",
   141      },
   142      toolchain_identifier = "local",
   143      unfiltered_compile_flags = [
   144          "-no-canonical-prefixes",
   145          "-Wno-builtin-macro-redefined",
   146          "-D__DATE__=\"redacted\"",
   147          "-D__TIMESTAMP__=\"redacted\"",
   148          "-D__TIME__=\"redacted\"",
   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")