aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/cpp
Commit message (Collapse)AuthorAge
...
* Windows, CROSSTOOL: add subsystem flag feature in theGravatar Laszlo Csomor2017-07-20
| | | | | | | | | BUILD file. They must use "-" instead of "/" otherwise Bazel believes the linkopts entry declares a (invalid) label. Change-Id: I6ad33c3f51c37f59e7d3b92be872fc4e2b27d434 PiperOrigin-RevId: 162597691
* Add support for Visual Studio 2017 in cc_configure auto-detection and our ↵Gravatar Philipp Wollermann2017-07-14
| | | | | | | | | Python tests. RELNOTES: None. Change-Id: I76c4f11323b1c0690e20d54f129abd671275acb0 PiperOrigin-RevId: 161934858
* Remove /DOS_WINDOWS from Windows CROSSTOOLGravatar pcloudy2017-07-14
| | | | | | | Fixed https://github.com/bazelbuild/bazel/issues/3366 RELNOTES: None PiperOrigin-RevId: 161926642
* Add *_alias rules to @bazel_tools so that people don't have to keep writing ↵Gravatar lberki2017-07-14
| | | | | | | | | | their own. The alias_rules.bzl hack is required because Bazel at HEAD needs to be able to be built with released Bazel, which doesn't know these rules yet. RELNOTES: None. PiperOrigin-RevId: 161808672
* Correct environment variable name local_config_cc depends onGravatar pcloudy2017-07-13
| | | | | | | Should be USE_MSVC_WRAPPER instead NO_MSVC_WRAPPER now. RELNOTES: None PiperOrigin-RevId: 161668110
* Windows: Switch wrapper-less CROSSTOOL to defaultGravatar pcloudy2017-07-12
| | | | | | | | | set USE_MSVC_WRAPPER=1 if you still want to use wrapper script. RELNOTES: Windows: Wrapper-less CROSSTOOL becomes default now. set USE_MSVC_WRAPPER=1 if you still want to use wrapper script. PiperOrigin-RevId: 161654018
* Add /DNOMINMAX back to CROSSTOOLGravatar pcloudy2017-07-10
| | | | | | | | | /DNOMINMAX is a very common use and no one has complained about it yet, so keep it in CROSSTOOL Fixed https://github.com/bazelbuild/bazel/issues/3347 RELNOTES: None. PiperOrigin-RevId: 161381862
* Remove some unnecessary compiler_flags from Windows CROSSTOOLGravatar pcloudy2017-07-07
| | | | | | | After reviewing these options' meanings, I don't think we need to put them in CROSSTOOL. Users can add them in their own BUILD files if needed, so that they don't have to undefine them. See https://github.com/bazelbuild/bazel/pull/3310 RELNOTES: None PiperOrigin-RevId: 161177879
* Assume crosstools that don't have 'no_legacy_features' feature need patchingGravatar hlopko2017-07-06
| | | | | | | | | | | | | Right now there are 2 ways how to control crosstool patches. If there is 'no_legacy_features' feature defined, no patching will be performed. If there is not, then depending on whether any c++ action_config is defined one set of patches is applied, or other set of patches is applied. It's a mess, and in the most cases, crosstools that do not define 'no_legacy_features' need the full patching. This cl fixes the crosstools that need the partial patching. RELNOTES: Crosstool patches are only applied if the toolchain doesn't define 'no_legacy_features' feature. PiperOrigin-RevId: 160979463
* Only configure wrapper scripts when they are neededGravatar Yun Peng2017-07-05
| | | | | | | | | BAZEL_PYTHON is no logger needed if we don't use wrapper script. Also, decode stdout and stderr so that tests work with Python 3. Change-Id: I61b60775a51f8322b40f7682e6cf3f63e8e8b6cc PiperOrigin-RevId: 160874163
* Remove implicit iteration from CrosstoolGravatar hlopko2017-07-05
| | | | | | | | | | | | | | | | | Up until now we allowed implicit iteration, e.g.: flag_group { flag: '%{some_sequence_variable}' } From now on, snippet above will raise an error. We require explicit 'iterate_over' message, e.g.: flag_group { iterate_over: 'some_sequence_variable' flag: '%{some_sequence_variable}' } RELNOTES: Implicit iteration in the CROSSTOOL has been removed, use explicit 'iterate_over' message. PiperOrigin-RevId: 160871888
* Output more debug information when running python testsGravatar Yun Peng2017-06-28
| | | | | | | This is for debugging https://github.com/bazelbuild/bazel/issues/3273 Change-Id: I84e260ae1a22147fed0cffc2960352c77af2cf58 PiperOrigin-RevId: 160399209
* Move the docker tests in src/test/dockerGravatar dmarting2017-06-27
| | | | | | | | | | | | This is a better location and tools/cpp is packaged in embedded_tools that make the test ends-up in embedded_tools, which is requiring network access to build embedded_tools! Side-effect: have to correctly mock the bazel workspace file on a couple of tests. This is blocking on https://bazel-review.googlesource.com/c/12350/ PiperOrigin-RevId: 160265524
* Stop adding python paths into INCLUDE and LIBGravatar Yun Peng2017-06-27
| | | | | | | See https://github.com/bazelbuild/bazel/issues/3237 Change-Id: I4befad7a329695a952f792605b4936b93cfa2a7f PiperOrigin-RevId: 160249037
* Fix include check on WindowsGravatar Yun Peng2017-06-26
| | | | | | | | | | | Don't add $TMP as cxx_builtin_include_directory, instead use $TMP/nvcc_inter_files_tmp_dir as tmp direcotry for nvcc.exe Fixed https://github.com/bazelbuild/bazel/issues/3202 RELNOTES: None. PiperOrigin-RevId: 160109290
* Get rid of batch script in MSVC CROSSTOOLGravatar Yun Peng2017-06-26
| | | | | | | Now the MSVC CROSSTOOL can truly be wrapper-free! \o/ RELNOTES: None. PiperOrigin-RevId: 159962674
* Refactor cc_configure.bzlGravatar Yun Peng2017-06-22
| | | | | | | | | | | | Split original cc_configure.bzl into 4 different files: lib_cc_configure.bzl: base library for C++ toolchain configuration unix_cc_configure.bzl: For Unix platforms osx_cc_configure.bzl: For macOS windows_cc_configure.bzl: For Windows Change-Id: I76fa44294c6ca4304f0a94f3a1c57d6e76141667 PiperOrigin-RevId: 159801973
* Make cc_configure on Windows simpler and more robustGravatar Yun Peng2017-06-13
| | | | | | | | | | | | | The previous registry value we are querying only exists when Visual Studio is installed. If user only has VC build tools installed and doesn't set env vars like BAZEL_VS, VS140COMNTOOLS, VC won't be detected. HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VC7 exists in both situations and works for all VS versions. Change-Id: I07b5593e882e23fa9e0079e082e6d357b905736d PiperOrigin-RevId: 158841618
* Also add TEMP into msvc_env featureGravatar Yun Peng2017-06-12
| | | | | Change-Id: Ia2510a2b8df728c02f77e2df4effff3232cfe3a2 PiperOrigin-RevId: 158685074
* Use a wrapper-free MSVC toolchain when NO_MSVC_WRAPPER=1Gravatar Yun Peng2017-06-06
| | | | | | | | | | | | | | | | | | | To enable a wrapper free MSVC CROSSTOOL, set NO_MSVC_WRAPPER=1 or add --action_env=NO_MSVC_WRAPPER=1 flag. Note that we still use windows_cc_wrapper.bat to invoke cl.exe and link.exe for different actions. Result for bazel build src/main/cpp:client : NO_WRAPPER: INFO: Elapsed time: 76.833s, Critical Path: 16.70s WRAPPER: INFO: Elapsed time: 138.517s, Critical Path: 27.78s Change-Id: Iaf6b67fc791ae1f8b62d332e47f96f719510bda1 PiperOrigin-RevId: 158118110
* Make C++ archiving use action_configs instead of hardcoded flagsGravatar hlopko2017-06-01
| | | | | RELNOTES: Use action_config in crosstool for static library archiving, remove ar_flag. PiperOrigin-RevId: 157685703
* Fix typo: s/exists/exist/ where needed.Gravatar philwo2017-05-31
| | | | | RELNOTES: None. PiperOrigin-RevId: 157572063
* Reverts non-xcode-available darwin crosstool generation.Gravatar cparsons2017-05-31
| | | | | RELNOTES: None. PiperOrigin-RevId: 157529642
* Let MSVC wrapper recongnize -DEFAULTLIB:library optionGravatar Yun Peng2017-05-26
| | | | | | | | | | | | | If MSVC wrapper is removed, users cannot put flags like `-Wl,ws2_32.lib` in linkopts of C++ rules on Windows. Instead, they should do `-DEFAULTLIB:ws2_32.lib`. This change is to make the wrapper script also accpet -DEFAULTLIB:library option. https://msdn.microsoft.com/en-us/library/229a6ysd.aspx Change-Id: I0cf9f5529f833470166488100b70fb497384e083 PiperOrigin-RevId: 156978364
* Fix msvc_cl.py for cuda compilationGravatar Yun Peng2017-05-24
| | | | | | | Passing /MT or /MD option using --compiler_options to nvcc Change-Id: Idf02ca0a4abf25bced397f5fffc1bc10ff0c160f PiperOrigin-RevId: 156976225
* Remove /W3 from compiler_flag from MSVC CROSSTOOLGravatar pcloudy2017-05-24
| | | | | | | | | The default warning level will become /W1 which only display severe warnings. https://msdn.microsoft.com/en-us/library/thxezb7y.aspx RELNOTES: None PiperOrigin-RevId: 156972872
* Wrap ar invocations for osx bazel crosstool.Gravatar cparsons2017-05-23
| | | | | | | | | This: 1. Forces ar invocations to go through xcrunwrapper (thus having the environment variables set correctly so that the appropriate xcode is used) 2. Institutes a fix for non-hermeticism around object file timestamps. RELNOTES: None. PiperOrigin-RevId: 156759530
* Fixes compilation on Power8Gravatar davideleoni902017-05-15
| | | | | | | | This fixes #3000 Closes #3002. PiperOrigin-RevId: 156046356
* Adding feature for linking C Run-Time library on WindowsGravatar Yun Peng2017-05-12
| | | | | | | | | | | | | | | By default, we use /MT(/MTd for debug mode) and link to libcmt.lib(libcmtd.lib). Users can set USE_DYNAMIC_CRT=1 or add --action_env=USE_DYNAMIC_CRT=1 to switch to /MD and msvcrt.lib (/MDd and msvcrtd.lib for debug mode) Reference: https://msdn.microsoft.com/en-us/library/abx4dbyh.aspx Fixed https://github.com/bazelbuild/bazel/issues/2120 Change-Id: I61e65ace82163acd456bf82f2b108c5fe8d8a8ce PiperOrigin-RevId: 155850886
* Escape % in strings that will appear in CrosstoolGravatar hlopko2017-05-10
| | | | | | | | | | %foo% syntax is not allowed in Crosstool, but some Windows environment variables that we read in cc_configure.bzl can reference other variables, therefore in order not to crash, we need to escape them before putting the values into the Crosstool. RELNOTES: None. PiperOrigin-RevId: 155602425
* Rollforward #2 of: Basic open-source crosstool to support targeting apple ↵Gravatar cparsons2017-05-04
| | | | | | | platform types. RELNOTES: None. PiperOrigin-RevId: 154993630
* Automated g4 rollback of commit 5038016e6573962d2554fcf9c10faa0cca8714e2.Gravatar dmarting2017-05-02
| | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Broke rules_go and all its dependencies: http://ci.bazel.io/job/rules_web/BAZEL_VERSION=HEAD,PLATFORM_NAME=darwin-x86_64/464/console http://ci.bazel.io/job/rules_go/BAZEL_VERSION=HEAD,PLATFORM_NAME=darwin-x86_64/823/console http://ci.bazel.io/job/buildifier/BAZEL_VERSION=HEAD,PLATFORM_NAME=darwin-x86_64/557/console Bisected with `bazel build ...` in rules_go The error message is still -whole-archive appearing in rules_go. *** Original change description *** Rollforward of: Basic open-source crosstool to support targeting apple platform types. RELNOTES: None. PiperOrigin-RevId: 154825240
* Rollforward of: Basic open-source crosstool to support targeting apple ↵Gravatar cparsons2017-04-28
| | | | | | | platform types. RELNOTES: None. PiperOrigin-RevId: 154547417
* Reformat Bazel crosstools to have consistent 2 spaces indentGravatar hlopko2017-04-28
| | | | | RELNOTES: None. PiperOrigin-RevId: 154426101
* Parse /showIncludes output for MSVC compilerGravatar Yun Peng2017-04-25
| | | | | | | | Instead of parsing .d file generated by wrapper script, we directly parse the output of /showIncludes option. Change-Id: Id94e20a5cb05a494a793fd6a43756d44d27cea8a PiperOrigin-RevId: 154161939
* Clean up more things in MSVC wrapper scriptsGravatar Yun Peng2017-04-24
| | | | | | | | | | | 1. Moved /nologo flag into feature 2. No need to specify -m64, adding /MACHINVE:X64 as linker flag 3. Still use wrapper script to add /MT or /MD for now, because our users are depending on it: https://github.com/bazelbuild/bazel/issues/2120 We need a plan first before move them into CROSSTOOL Change-Id: If5e4c01a900fcf9e93877e04a893879897bff3a3 PiperOrigin-RevId: 154036870
* MSVC: attempt to choose msvcrt.lib vs libcmt.lib correctlyGravatar Steven Johnson2017-04-24
| | | | | | | | | See Issue #2120: if we specify /MD for copts, we should attempt to use MSVCRTx.lib instead of LIBCMTx.lib. Closes #2862. PiperOrigin-RevId: 154032031
* Automated g4 rollback of commit 501b62716af12ba42c019bd9f231468b3c144757.Gravatar aehlig2017-04-18
| | | | | | | | | | | | | | | *** Reason for rollback *** Broke //src/test/shell/bazel:cc_inc_library_test on darwin see http://ci.bazel.io/job/bazel-tests/BAZEL_VERSION=HEAD,PLATFORM_NAME=darwin-x86_64/704/console *** Original change description *** Basic open-source crosstool to support targetting apple platform types. RELNOTES: None. PiperOrigin-RevId: 153460334
* Generating PDB files on WindowsGravatar Yun Peng2017-04-18
| | | | | | | | | | | | | | | | | | | | | | | | | | 1. Add /Z7 as compiler flag in CROSSTOOL, this causes full debugging infomation built into object files, no PDB file is generated. 2. Add /DEBUG as linker flag so that a PDB file will be generated for executable or dll. * /DEBUG:FULL for dbg mode. the full PDB can be used to debug the executable when no other build products are available, such as when the executable is deployed. * /DEBUG:FASTLINK for fastbuild mode. object files are still needed when debugging the executable, but linking speed can be two to four times faster that full PDB generation. * No option is added for opt mode. More detailed info: https://msdn.microsoft.com/en-us/library/xe4t6fc1.aspx 3. Add an empty feature in MSVC CROSSTOOL to tell Bazel we need PDB file 4. Add PDB file artifact in an output named pdb_file of cc_binary, then you can build the pdb file by bazel build //foo/bar:bin --output_groups=pdb_file 5. Add test for PDB file generation Change-Id: Ia5096470187ebca72f2c804f32d5b723f40c0b85 PiperOrigin-RevId: 153449059
* Basic open-source crosstool to support targetting apple platform types.Gravatar cparsons2017-04-18
| | | | | RELNOTES: None. PiperOrigin-RevId: 153360877
* Automated g4 rollback of commit 045104899738594d85f9ab9b0b9ccbde320b8055.Gravatar jfield2017-04-18
| | | | | | | | | | | | | *** Reason for rollback *** Breaks internal tests that use nonstandard crosstools *** Original change description *** Make C++ archiving use action_configs instead of hardcoded flags RELNOTES: Use action_config in crosstool for static library archiving, remove ar_flag. PiperOrigin-RevId: 153344597
* Make C++ archiving use action_configs instead of hardcoded flagsGravatar hlopko2017-04-13
| | | | | RELNOTES: Use action_config in crosstool for static library archiving, remove ar_flag. PiperOrigin-RevId: 153046587
* Do not add a build id to C++ binaries by default.Gravatar lberki2017-04-13
| | | | | | | Fixes #2805. RELNOTES: None. PiperOrigin-RevId: 153039178
* cc_configure: stricter error checks in _executeGravatar laszlocsomor2017-04-11
| | | | | | | | | | | | | | | | | Add stricter error checks in hopes of catching occasional CI flakiness where the stdout of a command seems to get lost. It's now an error if the command returns a non-zero exit code (or a zero one if it's expected to fail) or if its stdout is empty. Previously we only checked if stderr was empty to consider the action successful. See https://github.com/bazelbuild/bazel/issues/2675 RELNOTES: none PiperOrigin-RevId: 152685220
* Provide more information regarding compilerGravatar Eric Cousineau2017-04-10
| | | | | | | | | | | | | | | | | | | | This addresses #2761, to provide a minor improvement if neither `gcc` or `CC` are found on the path. Let me know if you would like anything changed! Local qualification steps: ``` $ cd bazel $ git rebase 0.4.5 # Did not want to spend too much time synchronizing derived stuff in master $ ln -s ~/Downloads/bazel-0.4.5-dist/derived . $ ./compile.sh $ export PATH=~+/output/bazel;$PATH $ cd .../someproject $ CC=clang-9000 bazel build //package:test Cannot find gcc or CC (clang-9000), either correct your path or set the CC environment variable. ``` Closes #2773. PiperOrigin-RevId: 152658002
* Suppress some warning messages from cc_configure.bzlGravatar Yun Peng2017-04-06
| | | | | | | Fixed https://github.com/bazelbuild/bazel/issues/2775 Change-Id: I4f5bab56ab961fd5310d62c7eee70abf9c98f9d9 PiperOrigin-RevId: 152359801
* Windows MSVC toolchain: Move environment variables setup from wrapper script ↵Gravatar Yun Peng2017-04-06
| | | | | | | to CROSSTOOL Change-Id: Ic6ee5a22412281743267a40623f4a8514a2e70f6 PiperOrigin-RevId: 152252048
* adding more env vars to invalidation listGravatar Nicolas Lopez2017-04-04
| | | | | | | | | It seems several env vars that are used by cc_configure are not in the invalidation list and not included in the bootstrap compile. Adding them. Change-Id: I67f73ae09abbe9033bcbbcb4026dab04d225b699 PiperOrigin-RevId: 152139948
* Disable cc_configure tests on debian stretch altogetherGravatar hlopko2017-04-04
| | | | | | | | | | | | | Not only opt builds fail, also fastbuild: http://ci.bazel.io/view/Dashboard/job/bazel-docker-tests/lastCompletedBuild/BAZEL_VERSION=latest,PLATFORM_NAME=docker/console The issue is tracked here: https://github.com/bazelbuild/bazel/issues/2418 RELNOTES: NONE. PiperOrigin-RevId: 152109844
* Fix MSVC CROSSTOOL for linking against lib filesGravatar pcloudy2017-03-31
| | | | | | | | | | | | | | | | 1. No need to add /WHOLEARCHIVE option for object files 2. When linking against a .lib file of a dll with /WHOLEARCHIVE option, the linker produces an error. So strip it in msvc_link.py. The second point is a temporary workaround to make TF GPU build work, we'll fix it properly when we figure out how to deal with .lib, .dll, .pdb files on Windwos. Fix https://github.com/bazelbuild/bazel/issues/2753 Change-Id: Ia77b67546bfd4f19ceeb0f6ab9ab3b7a598c4fe9 PiperOrigin-RevId: 151811504