1# This file is expanded from a template by cuda_configure.bzl 2# Update cuda_configure.bzl#verify_build_defines when adding new variables. 3 4load(":cc_toolchain_config.bzl", "cc_toolchain_config") 5 6licenses(["restricted"]) 7 8package(default_visibility = ["//visibility:public"]) 9 10toolchain( 11 name = "toolchain-linux-x86_64", 12 exec_compatible_with = [ 13 "@bazel_tools//platforms:linux", 14 "@bazel_tools//platforms:x86_64", 15 ], 16 target_compatible_with = [ 17 "@bazel_tools//platforms:linux", 18 "@bazel_tools//platforms:x86_64", 19 ], 20 toolchain = ":cc-compiler-local", 21 toolchain_type = "@bazel_tools//tools/cpp:toolchain_type", 22) 23 24cc_toolchain_suite( 25 name = "toolchain", 26 toolchains = { 27 "local|compiler": ":cc-compiler-local", 28 "arm": ":cc-compiler-local", 29 "aarch64": ":cc-compiler-local", 30 "k8": ":cc-compiler-local", 31 "piii": ":cc-compiler-local", 32 "ppc": ":cc-compiler-local", 33 }, 34) 35 36cc_toolchain( 37 name = "cc-compiler-local", 38 all_files = ":crosstool_wrapper_driver_is_not_gcc", 39 compiler_files = ":crosstool_wrapper_driver_is_not_gcc", 40 ar_files = ":crosstool_wrapper_driver_is_not_gcc", 41 as_files = ":crosstool_wrapper_driver_is_not_gcc", 42 dwp_files = ":empty", 43 linker_files = ":crosstool_wrapper_driver_is_not_gcc", 44 objcopy_files = ":empty", 45 strip_files = ":empty", 46 # To support linker flags that need to go to the start of command line 47 # we need the toolchain to support parameter files. Parameter files are 48 # last on the command line and contain all shared libraries to link, so all 49 # regular options will be left of them. 50 supports_param_files = 1, 51 toolchain_identifier = "local_linux", 52 toolchain_config = ":cc-compiler-local-config", 53) 54 55cc_toolchain_config( 56 name = "cc-compiler-local-config", 57 cpu = "local", 58 compiler = "compiler", 59 toolchain_identifier = "local_linux", 60 host_system_name = "local", 61 target_system_name = "local", 62 target_libc = "local", 63 abi_version = "local", 64 abi_libc_version = "local", 65 cxx_builtin_include_directories = [%{cxx_builtin_include_directories}], 66 host_compiler_path = "%{host_compiler_path}", 67 host_compiler_prefix = "%{host_compiler_prefix}", 68 compile_flags = [ 69 "-U_FORTIFY_SOURCE", 70 "-fstack-protector", 71 "-Wall", 72 "-Wunused-but-set-parameter", 73 "-Wno-free-nonheap-object", 74 "-fno-omit-frame-pointer", 75 ], 76 opt_compile_flags = [ 77 "-g0", 78 "-O2", 79 "-D_FORTIFY_SOURCE=1", 80 "-DNDEBUG", 81 "-ffunction-sections", 82 "-fdata-sections", 83 ], 84 dbg_compile_flags = ["-g"], 85 cxx_flags = ["-std=c++11"], 86 link_flags = [ 87 "-fuse-ld=gold", 88 "-Wl,-no-as-needed", 89 "-Wl,-z,relro,-z,now", 90 "-pass-exit-codes", 91 "-lstdc++", 92 "-lm", 93 ], 94 link_libs = [], 95 opt_link_flags = [], 96 unfiltered_compile_flags = [ 97 "-fno-canonical-system-headers", 98 "-Wno-builtin-macro-redefined", 99 "-D__DATE__=\"redacted\"", 100 "-D__TIMESTAMP__=\"redacted\"", 101 "-D__TIME__=\"redacted\"", 102 ] + [%{unfiltered_compile_flags}], 103 linker_bin_path = "%{linker_bin_path}", 104 coverage_compile_flags = ["--coverage"], 105 coverage_link_flags = ["--coverage"], 106 supports_start_end_lib = True, 107) 108 109filegroup( 110 name = "empty", 111 srcs = [], 112) 113 114filegroup( 115 name = "crosstool_wrapper_driver_is_not_gcc", 116 srcs = ["clang/bin/crosstool_wrapper_driver_is_not_gcc"], 117) 118 119