Skip to content

Commit 18a5510

Browse files
Update toolchain configuration artifacts to work with latest version of bazel
PiperOrigin-RevId: 161531749
1 parent ba45775 commit 18a5510

File tree

5 files changed

+91
-89
lines changed

5 files changed

+91
-89
lines changed

third_party/gpus/cuda/BUILD.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ cc_library(
152152

153153
cc_library(
154154
name = "cuda",
155+
visibility = ["//visibility:public"],
155156
deps = [
156157
":cublas",
157158
":cuda_headers",
@@ -160,7 +161,6 @@ cc_library(
160161
":cufft",
161162
":curand",
162163
],
163-
visibility = ["//visibility:public"],
164164
)
165165

166166
cc_library(

third_party/py/BUILD.tpl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ package(default_visibility = ["//visibility:public"])
55
cc_library(
66
name = "python_headers",
77
hdrs = [":python_include"],
8-
includes = ["python_include"],
98
data = select({
10-
":windows" : [":python_import_lib"],
11-
"//conditions:default": [],
9+
":windows": [":python_import_lib"],
10+
"//conditions:default": [],
1211
}),
12+
includes = ["python_include"],
1313
linkopts = select({
14-
# TODO(pcloudy): Ideally, this should just go into deps after resolving
15-
# https://github.com/bazelbuild/bazel/issues/3237,
16-
":windows" : ["$(locations :python_import_lib)"],
17-
"//conditions:default": [],
14+
# TODO(pcloudy): Ideally, this should just go into deps after resolving
15+
# https://github.com/bazelbuild/bazel/issues/3237,
16+
":windows": ["$(locations :python_import_lib)"],
17+
"//conditions:default": [],
1818
}),
1919
)
2020

@@ -31,5 +31,5 @@ config_setting(
3131
)
3232

3333
%{PYTHON_INCLUDE_GENRULE}
34-
%{PYTHON_IMPORT_LIB_GENRULE}
3534
%{NUMPY_INCLUDE_GENRULE}
35+
%{PYTHON_IMPORT_LIB_GENRULE}

third_party/toolchains/cpus/CROSSTOOL

Lines changed: 54 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -185,18 +185,20 @@ toolchain {
185185
flag_group {
186186
flag: '-fprofile-arcs'
187187
flag: '-ftest-coverage'
188-
}
188+
}
189+
190+
191+
189192
}
190193
flag_set {
191194
action: 'c++-link-interface-dynamic-library'
192195
action: 'c++-link-dynamic-library'
193196
action: 'c++-link-executable'
194197
flag_group {
195198
flag: '-lgcov'
196-
}
199+
}
197200
}
198201
}
199-
200202
}
201203

202204
toolchain {
@@ -215,23 +217,23 @@ toolchain {
215217

216218
tool_path {
217219
name: "ar"
218-
path: "wrapper/bin/msvc_link.bat"
220+
path: ""
219221
}
220222
tool_path {
221223
name: "cpp"
222-
path: "wrapper/bin/msvc_cl.bat"
224+
path: ""
223225
}
224226
tool_path {
225227
name: "gcc"
226-
path: "wrapper/bin/msvc_cl.bat"
228+
path: ""
227229
}
228230
tool_path {
229231
name: "gcov"
230232
path: "wrapper/bin/msvc_nop.bat"
231233
}
232234
tool_path {
233235
name: "ld"
234-
path: "wrapper/bin/msvc_link.bat"
236+
path: ""
235237
}
236238
tool_path {
237239
name: "nm"
@@ -285,8 +287,6 @@ toolchain {
285287
compiler_flag: "/Gy"
286288
# Use string pooling.
287289
compiler_flag: "/GF"
288-
# Warning level 3 (could possibly go to 4 in the future).
289-
compiler_flag: "/W3"
290290
# Catch both asynchronous (structured) and synchronous (C++) exceptions.
291291
compiler_flag: "/EHsc"
292292

@@ -304,6 +304,10 @@ toolchain {
304304

305305
linker_flag: "/SUBSYSTEM:CONSOLE"
306306

307+
feature {
308+
name: "no_legacy_features"
309+
}
310+
307311
# Suppress startup banner.
308312
feature {
309313
name: "nologo"
@@ -364,6 +368,18 @@ toolchain {
364368
}
365369
}
366370

371+
feature {
372+
name: "use_linker"
373+
env_set {
374+
action: "c++-link-executable"
375+
action: "c++-link-dynamic-library"
376+
env_entry {
377+
key: "USE_LINKER"
378+
value: "1"
379+
}
380+
}
381+
}
382+
367383
feature {
368384
name: 'include_paths'
369385
flag_set {
@@ -425,7 +441,7 @@ toolchain {
425441
config_name: 'c-compile'
426442
action_name: 'c-compile'
427443
tool {
428-
tool_path: 'wrapper/bin/msvc_cl.bat'
444+
tool_path: ''
429445
}
430446
flag_set {
431447
flag_group {
@@ -461,7 +477,7 @@ toolchain {
461477
config_name: 'c++-compile'
462478
action_name: 'c++-compile'
463479
tool {
464-
tool_path: 'wrapper/bin/msvc_cl.bat'
480+
tool_path: ''
465481
}
466482
flag_set {
467483
flag_group {
@@ -497,26 +513,25 @@ toolchain {
497513
config_name: 'c++-link-executable'
498514
action_name: 'c++-link-executable'
499515
tool {
500-
tool_path: 'wrapper/bin/msvc_link.bat'
516+
tool_path: ''
501517
}
502518
implies: 'nologo'
503-
implies: 'strip_debug_symbols'
504519
implies: 'linkstamps'
505520
implies: 'output_execpath_flags'
506521
implies: 'input_param_flags'
507522
implies: 'legacy_link_flags'
508523
implies: 'linker_param_file'
509524
implies: 'msvc_env'
525+
implies: 'use_linker'
510526
}
511527

512528
action_config {
513529
config_name: 'c++-link-dynamic-library'
514530
action_name: 'c++-link-dynamic-library'
515531
tool {
516-
tool_path: 'wrapper/bin/msvc_link.bat'
532+
tool_path: ''
517533
}
518534
implies: 'nologo'
519-
implies: 'strip_debug_symbols'
520535
implies: 'shared_flag'
521536
implies: 'linkstamps'
522537
implies: 'output_execpath_flags'
@@ -525,15 +540,17 @@ toolchain {
525540
implies: 'legacy_link_flags'
526541
implies: 'linker_param_file'
527542
implies: 'msvc_env'
543+
implies: 'use_linker'
528544
}
529545

530546
action_config {
531547
config_name: 'c++-link-static-library'
532548
action_name: 'c++-link-static-library'
533549
tool {
534-
tool_path: 'wrapper/bin/msvc_link.bat'
550+
tool_path: ''
535551
}
536552
implies: 'nologo'
553+
implies: 'archiver_flags'
537554
implies: 'input_param_flags'
538555
implies: 'linker_param_file'
539556
implies: 'msvc_env'
@@ -543,9 +560,10 @@ toolchain {
543560
config_name: 'c++-link-alwayslink-static-library'
544561
action_name: 'c++-link-alwayslink-static-library'
545562
tool {
546-
tool_path: 'wrapper/bin/msvc_link.bat'
563+
tool_path: ''
547564
}
548565
implies: 'nologo'
566+
implies: 'archiver_flags'
549567
implies: 'input_param_flags'
550568
implies: 'linker_param_file'
551569
implies: 'msvc_env'
@@ -557,9 +575,10 @@ toolchain {
557575
config_name: 'c++-link-pic-static-library'
558576
action_name: 'c++-link-pic-static-library'
559577
tool {
560-
tool_path: 'wrapper/bin/msvc_link.bat'
578+
tool_path: ''
561579
}
562580
implies: 'nologo'
581+
implies: 'archiver_flags'
563582
implies: 'input_param_flags'
564583
implies: 'linker_param_file'
565584
implies: 'msvc_env'
@@ -569,9 +588,10 @@ toolchain {
569588
config_name: 'c++-link-alwayslink-pic-static-library'
570589
action_name: 'c++-link-alwayslink-pic-static-library'
571590
tool {
572-
tool_path: 'wrapper/bin/msvc_link.bat'
591+
tool_path: ''
573592
}
574593
implies: 'nologo'
594+
implies: 'archiver_flags'
575595
implies: 'input_param_flags'
576596
implies: 'linker_param_file'
577597
implies: 'msvc_env'
@@ -581,10 +601,9 @@ toolchain {
581601
config_name: 'c++-link-interface-dynamic-library'
582602
action_name: 'c++-link-interface-dynamic-library'
583603
tool {
584-
tool_path: 'wrapper/bin/msvc_link.bat'
604+
tool_path: ''
585605
}
586606
implies: 'nologo'
587-
implies: 'strip_debug_symbols'
588607
implies: 'linker_param_file'
589608
implies: 'msvc_env'
590609
}
@@ -603,19 +622,6 @@ toolchain {
603622
name: 'has_configured_linker_path'
604623
}
605624

606-
feature {
607-
name: 'strip_debug_symbols'
608-
flag_set {
609-
action: 'c++-link-executable'
610-
action: 'c++-link-dynamic-library'
611-
action: 'c++-link-interface-dynamic-library'
612-
flag_group {
613-
expand_if_all_available: 'strip_debug_symbols'
614-
flag: '-Wl,-S'
615-
}
616-
}
617-
}
618-
619625
feature {
620626
name: 'shared_flag'
621627
flag_set {
@@ -652,15 +658,25 @@ toolchain {
652658
}
653659

654660
feature {
655-
name: 'input_param_flags'
661+
name: 'archiver_flags'
656662
flag_set {
657-
expand_if_all_available: 'library_search_directories'
658-
action: 'c++-link-executable'
659-
action: 'c++-link-dynamic-library'
663+
expand_if_all_available: 'output_execpath'
660664
action: 'c++-link-static-library'
661665
action: 'c++-link-alwayslink-static-library'
662666
action: 'c++-link-pic-static-library'
663667
action: 'c++-link-alwayslink-pic-static-library'
668+
flag_group {
669+
flag: '/OUT:%{output_execpath}'
670+
}
671+
}
672+
}
673+
674+
feature {
675+
name: 'input_param_flags'
676+
flag_set {
677+
expand_if_all_available: 'library_search_directories'
678+
action: 'c++-link-executable'
679+
action: 'c++-link-dynamic-library'
664680
flag_group {
665681
iterate_over: 'library_search_directories'
666682
flag: "-L%{library_search_directories}"
@@ -670,10 +686,6 @@ toolchain {
670686
expand_if_all_available: 'libopts'
671687
action: 'c++-link-executable'
672688
action: 'c++-link-dynamic-library'
673-
action: 'c++-link-static-library'
674-
action: 'c++-link-alwayslink-static-library'
675-
action: 'c++-link-pic-static-library'
676-
action: 'c++-link-alwayslink-pic-static-library'
677689
flag_group {
678690
iterate_over: 'libopts'
679691
flag: '%{libopts}'
@@ -787,12 +799,6 @@ toolchain {
787799
expand_if_all_available: 'linker_param_file'
788800
action: 'c++-link-executable'
789801
action: 'c++-link-dynamic-library'
790-
flag_group {
791-
flag: '-Wl,@%{linker_param_file}'
792-
}
793-
}
794-
flag_set {
795-
expand_if_all_available: 'linker_param_file'
796802
action: 'c++-link-static-library'
797803
action: 'c++-link-alwayslink-static-library'
798804
action: 'c++-link-pic-static-library'
@@ -907,22 +913,6 @@ toolchain {
907913
implies: 'link_crt_library'
908914
}
909915

910-
compilation_mode_flags {
911-
mode: DBG
912-
compiler_flag: "-Xcompilation-mode=dbg"
913-
linker_flag: "-Xcompilation-mode=dbg"
914-
}
915-
916-
compilation_mode_flags {
917-
mode: FASTBUILD
918-
compiler_flag: "-Xcompilation-mode=fastbuild"
919-
linker_flag: "-Xcompilation-mode=fastbuild"
920-
}
921916

922-
compilation_mode_flags {
923-
mode: OPT
924-
compiler_flag: "-Xcompilation-mode=opt"
925-
linker_flag: "-Xcompilation-mode=opt"
926-
}
927917

928918
}

0 commit comments

Comments
 (0)