clang_cc_toolchain_config.bzl 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725
  1. # Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. # Exceptions. See /LICENSE for license information.
  3. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. """A Starlark cc_toolchain configuration rule"""
  5. load(
  6. "@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
  7. "action_config",
  8. "feature",
  9. "feature_set",
  10. "flag_group",
  11. "flag_set",
  12. "tool",
  13. "tool_path",
  14. "variable_with_value",
  15. "with_feature_set",
  16. )
  17. load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")
  18. load(
  19. ":clang_detected_variables.bzl",
  20. "clang_include_dirs_list",
  21. "clang_resource_dir",
  22. "llvm_bindir",
  23. )
  24. all_compile_actions = [
  25. ACTION_NAMES.c_compile,
  26. ACTION_NAMES.cpp_compile,
  27. ACTION_NAMES.linkstamp_compile,
  28. ACTION_NAMES.assemble,
  29. ACTION_NAMES.preprocess_assemble,
  30. ACTION_NAMES.cpp_header_parsing,
  31. ACTION_NAMES.cpp_module_compile,
  32. ACTION_NAMES.cpp_module_codegen,
  33. ]
  34. all_cpp_compile_actions = [
  35. ACTION_NAMES.cpp_compile,
  36. ACTION_NAMES.linkstamp_compile,
  37. ACTION_NAMES.cpp_header_parsing,
  38. ACTION_NAMES.cpp_module_compile,
  39. ACTION_NAMES.cpp_module_codegen,
  40. ]
  41. preprocessor_compile_actions = [
  42. ACTION_NAMES.c_compile,
  43. ACTION_NAMES.cpp_compile,
  44. ACTION_NAMES.linkstamp_compile,
  45. ACTION_NAMES.preprocess_assemble,
  46. ACTION_NAMES.cpp_header_parsing,
  47. ACTION_NAMES.cpp_module_compile,
  48. ]
  49. codegen_compile_actions = [
  50. ACTION_NAMES.c_compile,
  51. ACTION_NAMES.cpp_compile,
  52. ACTION_NAMES.linkstamp_compile,
  53. ACTION_NAMES.assemble,
  54. ACTION_NAMES.preprocess_assemble,
  55. ACTION_NAMES.cpp_module_codegen,
  56. ]
  57. all_link_actions = [
  58. ACTION_NAMES.cpp_link_executable,
  59. ACTION_NAMES.cpp_link_dynamic_library,
  60. ACTION_NAMES.cpp_link_nodeps_dynamic_library,
  61. ]
  62. def _impl(ctx):
  63. tool_paths = [
  64. tool_path(name = "ar", path = llvm_bindir + "/llvm-ar"),
  65. tool_path(name = "ld", path = llvm_bindir + "/ld.lld"),
  66. tool_path(name = "cpp", path = llvm_bindir + "/clang-cpp"),
  67. tool_path(name = "gcc", path = llvm_bindir + "/clang"),
  68. tool_path(name = "dwp", path = llvm_bindir + "/llvm-dwp"),
  69. tool_path(name = "gcov", path = llvm_bindir + "/llvm-cov"),
  70. tool_path(name = "nm", path = llvm_bindir + "/llvm-nm"),
  71. tool_path(name = "objcopy", path = llvm_bindir + "/llvm-objcopy"),
  72. tool_path(name = "objdump", path = llvm_bindir + "/llvm-objdump"),
  73. tool_path(name = "strip", path = llvm_bindir + "/llvm-strip"),
  74. ]
  75. action_configs = [
  76. action_config(action_name = name, enabled = True, tools = [tool(path = llvm_bindir + "/clang")])
  77. for name in [ACTION_NAMES.c_compile]
  78. ] + [
  79. action_config(action_name = name, enabled = True, tools = [tool(path = llvm_bindir + "/clang++")])
  80. for name in all_cpp_compile_actions
  81. ] + [
  82. action_config(action_name = name, enabled = True, tools = [tool(path = llvm_bindir + "/clang++")])
  83. for name in all_link_actions
  84. ] + [
  85. action_config(action_name = name, enabled = True, tools = [tool(path = llvm_bindir + "/llvm-ar")])
  86. for name in [ACTION_NAMES.cpp_link_static_library]
  87. ] + [
  88. action_config(action_name = name, enabled = True, tools = [tool(path = llvm_bindir + "/llvm-strip")])
  89. for name in [ACTION_NAMES.strip]
  90. ]
  91. default_compile_flags_feature = feature(
  92. name = "default_compile_flags",
  93. enabled = True,
  94. flag_sets = [
  95. flag_set(
  96. actions = all_compile_actions,
  97. flag_groups = ([
  98. flag_group(
  99. flags = [
  100. "-Wall",
  101. "-Wextra",
  102. "-Wthread-safety",
  103. "-Wself-assign",
  104. # Unfortunately, LLVM isn't clean for this warning.
  105. "-Wno-unused-parameter",
  106. # We use partial sets of designated initializers in
  107. # test code.
  108. "-Wno-missing-field-initializers",
  109. "-fcolor-diagnostics",
  110. ],
  111. ),
  112. ]),
  113. ),
  114. flag_set(
  115. actions = [
  116. ACTION_NAMES.assemble,
  117. ACTION_NAMES.preprocess_assemble,
  118. ACTION_NAMES.c_compile,
  119. ACTION_NAMES.cpp_compile,
  120. ACTION_NAMES.cpp_module_compile,
  121. ACTION_NAMES.cpp_header_parsing,
  122. ],
  123. flag_groups = [
  124. flag_group(
  125. flags = ["-MD", "-MF", "%{dependency_file}"],
  126. expand_if_available = "dependency_file",
  127. ),
  128. ],
  129. ),
  130. flag_set(
  131. actions = [
  132. ACTION_NAMES.c_compile,
  133. ACTION_NAMES.cpp_compile,
  134. ACTION_NAMES.cpp_module_codegen,
  135. ACTION_NAMES.cpp_module_compile,
  136. ],
  137. flag_groups = [
  138. flag_group(
  139. flags = ["-frandom-seed=%{output_file}"],
  140. expand_if_available = "output_file",
  141. ),
  142. ],
  143. ),
  144. flag_set(
  145. actions = [
  146. ACTION_NAMES.assemble,
  147. ACTION_NAMES.preprocess_assemble,
  148. ACTION_NAMES.linkstamp_compile,
  149. ACTION_NAMES.c_compile,
  150. ACTION_NAMES.cpp_compile,
  151. ACTION_NAMES.cpp_module_codegen,
  152. ACTION_NAMES.cpp_module_compile,
  153. ],
  154. flag_groups = [
  155. flag_group(flags = ["-fPIC"], expand_if_available = "pic"),
  156. ],
  157. ),
  158. flag_set(
  159. actions = [
  160. ACTION_NAMES.assemble,
  161. ACTION_NAMES.preprocess_assemble,
  162. ACTION_NAMES.c_compile,
  163. ACTION_NAMES.cpp_compile,
  164. ACTION_NAMES.cpp_module_codegen,
  165. ],
  166. flag_groups = [
  167. flag_group(
  168. flags = ["-gsplit-dwarf"],
  169. expand_if_available = "per_object_debug_info_file",
  170. ),
  171. ],
  172. ),
  173. flag_set(
  174. actions = [
  175. ACTION_NAMES.preprocess_assemble,
  176. ACTION_NAMES.linkstamp_compile,
  177. ACTION_NAMES.c_compile,
  178. ACTION_NAMES.cpp_compile,
  179. ACTION_NAMES.cpp_header_parsing,
  180. ACTION_NAMES.cpp_module_compile,
  181. ],
  182. flag_groups = [
  183. flag_group(
  184. flags = ["-D%{preprocessor_defines}"],
  185. iterate_over = "preprocessor_defines",
  186. ),
  187. ],
  188. ),
  189. flag_set(
  190. actions = [
  191. ACTION_NAMES.preprocess_assemble,
  192. ACTION_NAMES.linkstamp_compile,
  193. ACTION_NAMES.c_compile,
  194. ACTION_NAMES.cpp_compile,
  195. ACTION_NAMES.cpp_header_parsing,
  196. ACTION_NAMES.cpp_module_compile,
  197. ],
  198. flag_groups = [
  199. flag_group(
  200. flags = ["-include", "%{includes}"],
  201. iterate_over = "includes",
  202. expand_if_available = "includes",
  203. ),
  204. ],
  205. ),
  206. flag_set(
  207. actions = [
  208. ACTION_NAMES.preprocess_assemble,
  209. ACTION_NAMES.linkstamp_compile,
  210. ACTION_NAMES.c_compile,
  211. ACTION_NAMES.cpp_compile,
  212. ACTION_NAMES.cpp_header_parsing,
  213. ACTION_NAMES.cpp_module_compile,
  214. ],
  215. flag_groups = [
  216. flag_group(
  217. flags = ["-iquote", "%{quote_include_paths}"],
  218. iterate_over = "quote_include_paths",
  219. ),
  220. flag_group(
  221. flags = ["-I%{include_paths}"],
  222. iterate_over = "include_paths",
  223. ),
  224. flag_group(
  225. flags = ["-isystem", "%{system_include_paths}"],
  226. iterate_over = "system_include_paths",
  227. ),
  228. ],
  229. ),
  230. flag_set(
  231. actions = all_compile_actions,
  232. flag_groups = ([
  233. flag_group(
  234. flags = ["-g"],
  235. ),
  236. ]),
  237. with_features = [with_feature_set(features = ["dbg"])],
  238. ),
  239. flag_set(
  240. actions = all_compile_actions,
  241. flag_groups = ([
  242. flag_group(
  243. flags = [
  244. "-g0",
  245. "-O3",
  246. "-DNDEBUG",
  247. "-ffunction-sections",
  248. "-fdata-sections",
  249. # Even when optimizing, preserve frame pointers for profiling.
  250. "-fno-omit-frame-pointer",
  251. "-mno-omit-leaf-frame-pointer",
  252. ],
  253. ),
  254. ]),
  255. with_features = [with_feature_set(features = ["opt"])],
  256. ),
  257. flag_set(
  258. actions = all_cpp_compile_actions,
  259. flag_groups = ([
  260. flag_group(
  261. flags = [
  262. "-std=c++17",
  263. "-stdlib=libc++",
  264. ],
  265. ),
  266. ]),
  267. ),
  268. flag_set(
  269. actions = all_compile_actions,
  270. flag_groups = [
  271. flag_group(
  272. flags = ["%{user_compile_flags}"],
  273. iterate_over = "user_compile_flags",
  274. expand_if_available = "user_compile_flags",
  275. ),
  276. ],
  277. ),
  278. flag_set(
  279. actions = all_compile_actions,
  280. flag_groups = ([
  281. flag_group(
  282. flags = [
  283. "-no-canonical-prefixes",
  284. "-Wno-builtin-macro-redefined",
  285. "-D__DATE__=\"redacted\"",
  286. "-D__TIMESTAMP__=\"redacted\"",
  287. "-D__TIME__=\"redacted\"",
  288. ],
  289. ),
  290. ]),
  291. ),
  292. flag_set(
  293. actions = all_compile_actions,
  294. flag_groups = [
  295. flag_group(
  296. expand_if_available = "source_file",
  297. flags = ["-c", "%{source_file}"],
  298. ),
  299. flag_group(
  300. expand_if_available = "output_assembly_file",
  301. flags = ["-S"],
  302. ),
  303. flag_group(
  304. expand_if_available = "output_preprocess_file",
  305. flags = ["-E"],
  306. ),
  307. flag_group(
  308. expand_if_available = "output_file",
  309. flags = ["-o", "%{output_file}"],
  310. ),
  311. ],
  312. ),
  313. ],
  314. )
  315. default_link_flags_feature = feature(
  316. name = "default_link_flags",
  317. enabled = True,
  318. flag_sets = [
  319. flag_set(
  320. actions = [
  321. ACTION_NAMES.cpp_link_dynamic_library,
  322. ACTION_NAMES.cpp_link_nodeps_dynamic_library,
  323. ],
  324. flag_groups = [flag_group(flags = ["-shared"])],
  325. ),
  326. flag_set(
  327. actions = all_link_actions,
  328. flag_groups = [
  329. flag_group(
  330. flags = ["%{linkstamp_paths}"],
  331. iterate_over = "linkstamp_paths",
  332. expand_if_available = "linkstamp_paths",
  333. ),
  334. ],
  335. ),
  336. flag_set(
  337. actions = all_link_actions,
  338. flag_groups = [
  339. flag_group(
  340. flags = ["-o", "%{output_execpath}"],
  341. expand_if_available = "output_execpath",
  342. ),
  343. ],
  344. ),
  345. flag_set(
  346. actions = [
  347. ACTION_NAMES.cpp_link_executable,
  348. ],
  349. flag_groups = [
  350. flag_group(
  351. flags = ["-pie"],
  352. expand_if_available = "force_pic",
  353. ),
  354. ],
  355. ),
  356. flag_set(
  357. actions = all_link_actions,
  358. flag_groups = ([
  359. flag_group(
  360. flags = [
  361. "-fuse-ld=lld",
  362. "-Wl,-no-as-needed",
  363. # Force the C++ standard library to be statically
  364. # linked. This works even with libc++ despite the
  365. # name, however we have to manually link the ABI
  366. # library and libunwind.
  367. "-static-libstdc++",
  368. # Link with libc++.
  369. "-stdlib=libc++",
  370. # Force static linking with libc++abi as well.
  371. "-l:libc++abi.a",
  372. # Link with Clang's runtime library. This is always
  373. # linked statically.
  374. #"-rtlib=compiler-rt",
  375. ],
  376. ),
  377. ]),
  378. ),
  379. flag_set(
  380. actions = all_link_actions,
  381. flag_groups = [
  382. flag_group(
  383. flags = ["-L%{library_search_directories}"],
  384. iterate_over = "library_search_directories",
  385. expand_if_available = "library_search_directories",
  386. ),
  387. ],
  388. ),
  389. flag_set(
  390. flag_groups = [
  391. flag_group(
  392. iterate_over = "runtime_library_search_directories",
  393. flags = [
  394. "-Wl,-rpath,$ORIGIN/%{runtime_library_search_directories}",
  395. ],
  396. expand_if_available =
  397. "runtime_library_search_directories",
  398. ),
  399. ],
  400. actions = all_link_actions,
  401. ),
  402. flag_set(
  403. actions = all_link_actions,
  404. flag_groups = [
  405. flag_group(
  406. flags = ["-Wl,--gdb-index"],
  407. expand_if_available = "is_using_fission",
  408. ),
  409. ],
  410. ),
  411. flag_set(
  412. actions = all_link_actions,
  413. flag_groups = [
  414. flag_group(
  415. flags = ["-Wl,-S"],
  416. expand_if_available = "strip_debug_symbols",
  417. ),
  418. ],
  419. ),
  420. flag_set(
  421. actions = all_link_actions,
  422. flag_groups = [
  423. flag_group(
  424. iterate_over = "libraries_to_link",
  425. flag_groups = [
  426. flag_group(
  427. flags = ["-Wl,--start-lib"],
  428. expand_if_equal = variable_with_value(
  429. name = "libraries_to_link.type",
  430. value = "object_file_group",
  431. ),
  432. ),
  433. flag_group(
  434. flags = ["-Wl,-whole-archive"],
  435. expand_if_true =
  436. "libraries_to_link.is_whole_archive",
  437. ),
  438. flag_group(
  439. flags = ["%{libraries_to_link.object_files}"],
  440. iterate_over = "libraries_to_link.object_files",
  441. expand_if_equal = variable_with_value(
  442. name = "libraries_to_link.type",
  443. value = "object_file_group",
  444. ),
  445. ),
  446. flag_group(
  447. flags = ["%{libraries_to_link.name}"],
  448. expand_if_equal = variable_with_value(
  449. name = "libraries_to_link.type",
  450. value = "object_file",
  451. ),
  452. ),
  453. flag_group(
  454. flags = ["%{libraries_to_link.name}"],
  455. expand_if_equal = variable_with_value(
  456. name = "libraries_to_link.type",
  457. value = "interface_library",
  458. ),
  459. ),
  460. flag_group(
  461. flags = ["%{libraries_to_link.name}"],
  462. expand_if_equal = variable_with_value(
  463. name = "libraries_to_link.type",
  464. value = "static_library",
  465. ),
  466. ),
  467. flag_group(
  468. flags = ["-l%{libraries_to_link.name}"],
  469. expand_if_equal = variable_with_value(
  470. name = "libraries_to_link.type",
  471. value = "dynamic_library",
  472. ),
  473. ),
  474. flag_group(
  475. flags = ["-l:%{libraries_to_link.name}"],
  476. expand_if_equal = variable_with_value(
  477. name = "libraries_to_link.type",
  478. value = "versioned_dynamic_library",
  479. ),
  480. ),
  481. flag_group(
  482. flags = ["-Wl,-no-whole-archive"],
  483. expand_if_true = "libraries_to_link.is_whole_archive",
  484. ),
  485. flag_group(
  486. flags = ["-Wl,--end-lib"],
  487. expand_if_equal = variable_with_value(
  488. name = "libraries_to_link.type",
  489. value = "object_file_group",
  490. ),
  491. ),
  492. ],
  493. expand_if_available = "libraries_to_link",
  494. ),
  495. ],
  496. ),
  497. flag_set(
  498. actions = all_link_actions,
  499. flag_groups = [
  500. flag_group(
  501. flags = ["%{user_link_flags}"],
  502. iterate_over = "user_link_flags",
  503. expand_if_available = "user_link_flags",
  504. ),
  505. ],
  506. ),
  507. flag_set(
  508. actions = [
  509. ACTION_NAMES.cpp_link_static_library,
  510. ] + all_link_actions,
  511. flag_groups = [
  512. flag_group(
  513. expand_if_available = "linker_param_file",
  514. flags = ["@%{linker_param_file}"],
  515. ),
  516. ],
  517. ),
  518. ],
  519. )
  520. sysroot_feature = feature(
  521. name = "sysroot",
  522. enabled = True,
  523. flag_sets = [
  524. flag_set(
  525. actions = all_compile_actions + all_link_actions,
  526. flag_groups = [
  527. flag_group(
  528. flags = ["--sysroot=%{sysroot}"],
  529. expand_if_available = "sysroot",
  530. ),
  531. ],
  532. ),
  533. ],
  534. )
  535. default_archiver_flags_feature = feature(
  536. name = "default_archiver_flags",
  537. enabled = True,
  538. flag_sets = [
  539. flag_set(
  540. actions = [ACTION_NAMES.cpp_link_static_library],
  541. flag_groups = [
  542. flag_group(flags = ["rcsD"]),
  543. flag_group(
  544. flags = ["%{output_execpath}"],
  545. expand_if_available = "output_execpath",
  546. ),
  547. ],
  548. ),
  549. flag_set(
  550. actions = [ACTION_NAMES.cpp_link_static_library],
  551. flag_groups = [
  552. flag_group(
  553. iterate_over = "libraries_to_link",
  554. flag_groups = [
  555. flag_group(
  556. flags = ["%{libraries_to_link.name}"],
  557. expand_if_equal = variable_with_value(
  558. name = "libraries_to_link.type",
  559. value = "object_file",
  560. ),
  561. ),
  562. flag_group(
  563. flags = ["%{libraries_to_link.object_files}"],
  564. iterate_over = "libraries_to_link.object_files",
  565. expand_if_equal = variable_with_value(
  566. name = "libraries_to_link.type",
  567. value = "object_file_group",
  568. ),
  569. ),
  570. ],
  571. expand_if_available = "libraries_to_link",
  572. ),
  573. ],
  574. ),
  575. ],
  576. )
  577. use_module_maps = feature(
  578. name = "use_module_maps",
  579. requires = [feature_set(features = ["module_maps"])],
  580. flag_sets = [
  581. flag_set(
  582. actions = [
  583. ACTION_NAMES.c_compile,
  584. ACTION_NAMES.cpp_compile,
  585. ACTION_NAMES.cpp_header_parsing,
  586. ACTION_NAMES.cpp_module_compile,
  587. ],
  588. flag_groups = [
  589. # These flag groups are separate so they do not expand to
  590. # the cross product of the variables.
  591. flag_group(flags = ["-fmodule-name=%{module_name}"]),
  592. flag_group(
  593. flags = ["-fmodule-map-file=%{module_map_file}"],
  594. ),
  595. ],
  596. ),
  597. ],
  598. )
  599. # Tell bazel we support module maps in general, so they will be generated
  600. # for all c/c++ rules.
  601. # Note: not all C++ rules support module maps; thus, do not imply this
  602. # feature from other features - instead, require it.
  603. module_maps = feature(
  604. name = "module_maps",
  605. enabled = True,
  606. implies = [
  607. # "module_map_home_cwd",
  608. # "module_map_without_extern_module",
  609. # "generate_submodules",
  610. ],
  611. )
  612. layering_check = feature(
  613. name = "layering_check",
  614. implies = ["use_module_maps"],
  615. flag_sets = [
  616. flag_set(
  617. actions = [
  618. ACTION_NAMES.c_compile,
  619. ACTION_NAMES.cpp_compile,
  620. ACTION_NAMES.cpp_header_parsing,
  621. ACTION_NAMES.cpp_module_compile,
  622. ],
  623. flag_groups = [
  624. flag_group(flags = [
  625. "-fmodules-strict-decluse",
  626. "-Wprivate-header",
  627. ]),
  628. flag_group(
  629. iterate_over = "dependent_module_map_files",
  630. flags = [
  631. "-fmodule-map-file=%{dependent_module_map_files}",
  632. ],
  633. ),
  634. ],
  635. ),
  636. ],
  637. )
  638. fuzzer = feature(
  639. name = "fuzzer",
  640. flag_sets = [
  641. flag_set(
  642. actions = all_compile_actions + all_link_actions,
  643. flag_groups = [
  644. flag_group(
  645. flags = ["-fsanitize=fuzzer,address"],
  646. ),
  647. ],
  648. ),
  649. flag_set(
  650. actions = all_link_actions,
  651. flag_groups = ([
  652. flag_group(
  653. flags = [
  654. "-static-libsan",
  655. ],
  656. ),
  657. ]),
  658. ),
  659. ],
  660. )
  661. features = [
  662. feature(
  663. name = "no_legacy_features",
  664. ),
  665. feature(
  666. name = "supports_pic",
  667. enabled = True,
  668. ),
  669. feature(
  670. name = "supports_start_end_lib",
  671. enabled = True,
  672. ),
  673. default_compile_flags_feature,
  674. default_archiver_flags_feature,
  675. default_link_flags_feature,
  676. feature(name = "supports_dynamic_linker", enabled = True),
  677. feature(name = "dbg"),
  678. feature(name = "opt"),
  679. sysroot_feature,
  680. fuzzer,
  681. module_maps,
  682. layering_check,
  683. use_module_maps,
  684. ]
  685. return cc_common.create_cc_toolchain_config_info(
  686. ctx = ctx,
  687. features = features,
  688. action_configs = action_configs,
  689. cxx_builtin_include_directories = clang_include_dirs_list + [
  690. # Append the share directory for sanitizer data files.
  691. clang_resource_dir + "/share",
  692. ],
  693. toolchain_identifier = "local",
  694. host_system_name = "local",
  695. target_system_name = "local",
  696. target_cpu = "k8",
  697. target_libc = "local",
  698. compiler = "local",
  699. abi_version = "local",
  700. abi_libc_version = "local",
  701. tool_paths = tool_paths,
  702. )
  703. cc_toolchain_config = rule(
  704. implementation = _impl,
  705. provides = [CcToolchainConfigInfo],
  706. )