aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/cpp
Commit message (Collapse)AuthorAge
...
* Fix osx_cc_wrapper.sh for multiple rpathsGravatar Marcel Hlopko2017-08-18
| | | | | | | | | | | | | | osx_cc_wrapper.sh was not working correctly in cases when multiple rpaths were specified on linking command line. This cl modifies the wrapper to record all rpaths, and use the rpath that corresponds to a particular library when updating libraries install name. Fixes #3450 RELNOTES: None. Change-Id: I614694a792b6724a1db9814ee25af1802560c463 PiperOrigin-RevId: 165618946
* windows_cc_configure.bzl: Clear PATH, INCLUDE, LIB envsGravatar Yun Peng2017-08-04
| | | | | | | | | | | | | This change prevents leaking irrelevant envs to C++ actions. Before running VCVARSALL.BAT, we set PATH=<system root> INCLUDE= LIB= See https://github.com/bazelbuild/bazel/issues/3500 Change-Id: I767a36a3be3c8c01ad5cac2a7762edd34047e1bf PiperOrigin-RevId: 164242012
* Add no_stripping feature to MSVC CROSSTOOLGravatar Yun Peng2017-08-04
| | | | | | | | | | | | If no_stripping feature is enabled, then strip action config is not necessary, building stripped binary will just copy the orignial binary. Fix https://github.com/bazelbuild/bazel/issues/3482 Also fixed CI breakage: https://github.com/bazelbuild/bazel/issues/3505 Change-Id: Ie78fe174c42248c9b3e930008eef96dcd1864741 PiperOrigin-RevId: 164237588
* Simplify copts handling and expose them as a build variableGravatar hlopko2017-08-02
| | | | | | | | | | | This cl changes copts to be immutable (and changes addCopts methods into setCopts, so it's simpler to reason about copts) and exposes copts as a build variable. It also introduces CompileBuildVariablesTest, similar to LinkBuildVariablesTest, to test that right build variables are exposed for right actions. RELNOTES: None. PiperOrigin-RevId: 163876774
* Fix UNIX linker detection (was erroneously disabling ld.gold)Gravatar Allen Lavoie2017-08-01
| | | | | | | | | | Adds back a compiler test empty .cc file. Seems to be an omission in https://github.com/bazelbuild/bazel/commit/65cda4f219e564ccb190b2992151658dfae9904 The _is_gold_supported check in unix_cc_configure.bzl always fails without this change, since the file it's checking with isn't created. Looks like there may be other effects through _add_option_if_supported, although I only noticed because apparently I have written linker-specific code. Closes #3484. PiperOrigin-RevId: 163832465
* MSVC CROSSTOOL: Stop adding -g in debug modeGravatar pcloudy2017-07-31
| | | | | | | Fix https://github.com/bazelbuild/bazel/issues/3473 RELNOTES: None PiperOrigin-RevId: 163686215
* MSVC CROSSTOOL: Remove some legacy featuresGravatar pcloudy2017-07-31
| | | | | RELNOTES: None PiperOrigin-RevId: 163679651
* Add preprocessor_defines feature for MSVC CROSSTOOLGravatar pcloudy2017-07-31
| | | | | | | | Fix https://github.com/bazelbuild/bazel/issues/3474 Fix https://github.com/bazelbuild/bazel/issues/3472 RELNOTES: None PiperOrigin-RevId: 163677371
* windows_cc_configure.bzl: Set maxsplit to 1 when parsing environment variablesGravatar pcloudy2017-07-25
| | | | | | | fix https://github.com/bazelbuild/bazel/issues/3442 RELNOTES: PiperOrigin-RevId: 163039890
* 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