aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/cpp
Commit message (Collapse)AuthorAge
* Remove useless abstractions in C++ rules after internal cleanupGravatar hlopko2017-11-24
| | | | | RELNOTES: PiperOrigin-RevId: 176844836
* Remove uses of ar_flag and uses_action_config_for_arGravatar hlopko2017-11-23
| | | | | | | Bazel is not reading its value anyway. RELNOTES: None PiperOrigin-RevId: 176768851
* Move CppConfiguration's treatment of pic, --start-lib/--end-lib, and fission toGravatar cpeyser2017-11-22
| | | | | | | | | | | CppHelper. In CppHelper, CcToolchainProvider and CppConfiguration are used sepereately, allowing toolchain information to be removed from CppConfiguration. This is necessary to introduce hermetic toolchains, which require that toolchain information be seperated from the configuration, into the c++ rules. PiperOrigin-RevId: 176694160
* Move CppConfiguration#isLLVMcompiler, #isLLVMOptimizedFdo, #isLipoOptimization,Gravatar cpeyser2017-11-22
| | | | | | | | | and #getDynamicMode to CcToolchainProvider and CppHelper. Moving toolchain info out of CppConfiguration is required to use platform-based toolchain resolution in the c++ rules. PiperOrigin-RevId: 176662686
* Check if win_def_file attribute exists before getting its valueGravatar Yun Peng2017-11-22
| | | | | | | | | | | Because CcProtoAspect.java also uses CcLibraryHelper.java to generate linking action, but cc_proto_library doesn't have win_def_file attribute. Fix https://github.com/bazelbuild/bazel/issues/4126 Change-Id: I1b819c926c8025a49fea756bcaeb237824cb098e PiperOrigin-RevId: 176653922
* Improve error message when missing default_toolchain in CROSSTOOLGravatar hlopko2017-11-22
| | | | | RELNOTES: None. PiperOrigin-RevId: 176643685
* Add system_provide attribute to cc_import ruleGravatar pcloudy2017-11-22
| | | | | | | When system_provide attribute is 1, Bazel assumes the runtime shared library is provided by system. RELNOTES: None PiperOrigin-RevId: 176632326
* Return SpawnResults using a List instead of a Set.Gravatar ruperts2017-11-21
| | | | | | | | | Currently we don't care about the list order of SpawnResults. However, we may care about the list order later. Also, if the equals() method for SpawnResults is ever changed then it may be problematic to return SpawnResults in a Set. Aside: ActionResults use SpawnResults to calculate cumulative execution times for Actions, and may provide other metrics in future. RELNOTES: None. PiperOrigin-RevId: 176579460
* Allow conditioning flags on the _absence_ of a feature.Gravatar Googler2017-11-21
| | | | | | | | | | | | | | | This allows a flag_set to emit one flag when a feature is enabled, and a different flag when that feature is disabled. And while I was in there, I noticed and fixed a couple other issues: 1. env_set didn't actually implement with_feature, despite having the field in its proto. 2. action_config implemented with_feature as an optional field, instead of repeated field. RELNOTES: None PiperOrigin-RevId: 176510960
* CcProtoLibrary: Don't add dynamic librarys to filesToBuild on WindowsGravatar Yun Peng2017-11-20
| | | | | | | https://github.com/bazelbuild/bazel/issues/3985 Change-Id: Ib566103e147219122b3f745a98ad30db5f27553f PiperOrigin-RevId: 176365079
* Change default behavior for cc_toolchain.compiler and cc_toolchain.libc forGravatar cpeyser2017-11-18
| | | | | | | | platform-based toolchain selection to match legacy behavior. This is a change over previous behavior in the platform case, which was to throw if either of those attributes is not present. The default_toolchain field in CROSSTOOL gives a mapping from cc_toolchain.cpu values to toolchains - this map should be used with compiler and libc are not specified, as is currently the non-platforms, legacy behavior. PiperOrigin-RevId: 176246316
* Add cc_import rule definitionGravatar Yun Peng2017-11-17
| | | | | | | | Designed by https://docs.google.com/document/d/1hK2mWl3TYNL9oJYX_S020TKkXZvBw1aBoYERvTHVyfg/edit# Change-Id: I025adf555a9827c55a90acc3f254cbd105e224c6 PiperOrigin-RevId: 176114968
* Save dwoFile on LTOBackendArtifacts objectGravatar Googler2017-11-14
| | | | | | | | | This is some clean up pulled out of unknown commit. It avoids needing to reconstruct the dwoFile, which will be harder when we move to using shared LTO backends in some cases. RELNOTES: None PiperOrigin-RevId: 175692708
* Move CppConfiguration#getBuiltinIncludeDirectories to CcToolchainProvider.Gravatar cpeyser2017-11-14
| | | | PiperOrigin-RevId: 175682806
* Add win_def_file attribute to cc rules.Gravatar Yun Peng2017-11-14
| | | | | | | | RELNOTES[NEW]: Users can use win_def_file attribute to specify a DEF file for exporting symbols when build a shared library on Windows. Change-Id: Ifa28d8b7b24eaefcefc9640d8dc56fd2931e9688 PiperOrigin-RevId: 175651203
* Migrate CppConfiguration#getGnuSystemName to CcToolchainProvider.Gravatar cpeyser2017-11-13
| | | | PiperOrigin-RevId: 175558546
* toolchain_type can export make variables from the toolchain instead of theGravatar cpeyser2017-11-13
| | | | | | configuration. PiperOrigin-RevId: 175532550
* Allow an action_config to be activated by default.Gravatar cpeyser2017-11-13
| | | | PiperOrigin-RevId: 175531318
* Remove bazel's --experimental_skip_static_outputs option.Gravatar Googler2017-11-10
| | | | | | | | | | | It was added long ago, for reasons which are no longer relevant or useful. Also remove the build variable it controlled ("skip_mostly_static") from CROSSTOOL files. RELNOTES: None. PiperOrigin-RevId: 175325225
* Replace all usages of Blaze's Preconditions class with guava.Gravatar tomlu2017-11-09
| | | | | | | | Blaze had its own class to avoid GC from varargs array creation for the precondition happy path. Guava now (mostly) implements these, making it unnecessary to maintain our own. This change was almost entirely automated by search-and-replace. A few BUILD files needed fixing up since I removed an export of preconditions from lib:util, which was all done by add_deps. There was one incorrect usage of Preconditions that was caught by error prone (which checks Guava's version of Preconditions) that I had to change manually. PiperOrigin-RevId: 175033526
* Introduce cc_toolchain_type, which exports c++ make variables. UseGravatar cpeyser2017-11-07
| | | | | | //tools/cpp:toolchain_type as the canonical c++ toolchain. PiperOrigin-RevId: 174759558
* Move CppConfiguration#getHostSystemName, #getTestOnlyLinkOptions, ↵Gravatar cpeyser2017-11-06
| | | | | | #getObjCopyOptionsForEmbedding, #getLdOptionsForEmbedding and #getDefaultSysroot to CcToolchainProvider. PiperOrigin-RevId: 174508128
* Remove CppConfiguration#getFeatures in favor ofGravatar cpeyser2017-11-06
| | | | | | CcToolchainProvider#getFeatures. PiperOrigin-RevId: 174492427
* Schedule LtoBackendAction when creating LtoBackendArtifactGravatar Googler2017-11-06
| | | | | | | | | | | | | There is no need to defer the action creation and scheduling, which happens shortly thereafter, and just requires saving a bunch of information on the LtoBackendArtifact. This is preliminary restructuring that will aid some larger changes for making tests that use static linking more efficient when built with ThinLTO (for b/67424063). RELNOTES: None PiperOrigin-RevId: 174490283
* Don't keep set of LTO backend artifacts on link actionGravatar Googler2017-11-06
| | | | | | | | | | Small cleanup to avoid saving a set of the LTOBackendArtifact objects on the CppLinkAction. They can be accessed from the CppLinkActionBuilder, and keeping them on the CppLinkAction prevents them from being GC'ed when the builder is destroyed. RELNOTES: None PiperOrigin-RevId: 174469228
* Automated rollback of commit 5d42ae10195cd1acb9612df3a3d520f09b0c3e39.Gravatar cpeyser2017-11-03
| | | | | | | | | | | | | *** Reason for rollback *** Breaks alphago targets. *** Original change description *** Remove CppConfiguration#getFeatures in favor of CcToolchainProvider#getFeatures. PiperOrigin-RevId: 174373331
* When force_pic is on, build linkstamp objects with PIC.Gravatar Googler2017-11-03
| | | | | | | | | | Previously, linkstamp objects would be built without -fPIC. When linked into a PIE binary, this leads to text relocations, which causes IFUNC resolution to segfault (the resolution function is called while the binary is mapped RW). RELNOTES: None. PiperOrigin-RevId: 174366114
* Move CppConfiguration#toolchainNeedsPic, #getRuntimeSysroot, andGravatar cpeyser2017-10-31
| | | | | | #getSolibDirectory to CcToolchainProvider. PiperOrigin-RevId: 174032021
* Migrate CppConfiguration#supportsGoldLinker, supportsDynamicLinker,Gravatar cpeyser2017-10-31
| | | | | | supportsEmbeddedRuntimes, supportsExecOrigin to CcToolchainProvider. PiperOrigin-RevId: 173928009
* Remove CppConfiguration#getFeatures in favor ofGravatar cpeyser2017-10-30
| | | | | | CcToolchainProvider#getFeatures. PiperOrigin-RevId: 173702792
* Thread FileSystem through to a single Path#delete call site.Gravatar tomlu2017-10-30
| | | | | | This requires a fairly large amount of changes to fundamental objects like BlazeRuntime, Executor, and so on, as well as changing a lot of test code to thread the file system through. I expect future CLs to be much smaller. PiperOrigin-RevId: 173678144
* Add platform_common.MakeVariableInfo so that Skylark code has access to the ↵Gravatar lberki2017-10-27
| | | | | | | Make variables provider. RELNOTES: None. PiperOrigin-RevId: 173527191
* Move CppConfiguration#getStaticRuntimeLibsLabel and #getDynamicRuntimeLibsLabelGravatar cpeyser2017-10-25
| | | | | | to CcToolchainProvider. PiperOrigin-RevId: 173301847
* Move CppConfiguration#getAbi and #getAbiGlibcVersion to CcToolchainProvider.Gravatar cpeyser2017-10-25
| | | | PiperOrigin-RevId: 173287598
* Add support for linker scripts in auto-linked Android native depsGravatar Googler2017-10-23
| | | | | | | Android's mechanism for automatically linking native deps does not currently support linker scripts. A dependency cc_library can specify the linker script in the linkopts and include it in its deps, but since the artifact is not provided as an input to the generated link action, this results in an error. This change provides the missing inputs and makes this work. RELNOTES: Support for linker scripts in NativeDepsHelper (e.g., android_binary) PiperOrigin-RevId: 172963605
* Expose a CcToolchainProvider that is generated by the legacy toolchain ↵Gravatar cpeyser2017-10-23
| | | | | | selection logic to skylark. PiperOrigin-RevId: 172921818
* Add a flag to disable Make variables in the C++ configuration.Gravatar lberki2017-10-23
| | | | | RELNOTES: None. PiperOrigin-RevId: 172901568
* [Bazel] Change default place where {java,cc}_proto_library look for their ↵Gravatar carmi2017-10-20
| | | | | | | | | external repo dependencies. This fixes https://github.com/cgrushko/proto_library/issues/4. RELNOTES: [Bazel] {java,cc}_proto_library now look for dependencies in @com_google_protobuf, instead of in @com_google_protobuf_$LANG PiperOrigin-RevId: 172685722
* Flip the default value of --experimental_toolchain_id_in_output_directory to ↵Gravatar lberki2017-10-18
| | | | | | | | false and make the option a no-op. RELNOTES[INC]: C++ toolchain identifiers are not in the name of the output directory anymore. PiperOrigin-RevId: 172594237
* Add c++-module-codegen to known action typesGravatar hlopko2017-10-18
| | | | | | | Builds using c++-module-codegen actions stopped working after https://github.com/bazelbuild/bazel/commit/5518ce1f0d9a5a12dbf54ba3a6bc2e10d1cae979. This cl fixes that. RELNOTES: None PiperOrigin-RevId: 172587344
* Actions now have the option of returning an ActionResult, containing a ↵Gravatar ruperts2017-10-18
| | | | | | | (possibly empty) set of SpawnResults created during execution of the Action. RELNOTES: None. PiperOrigin-RevId: 172529328
* Make cc_toolchain put the files comprising the toolchain into its FileProvider.Gravatar lberki2017-10-18
| | | | | | | Note that cc_toolchain_suite is not changed this way, but that rule doesn't currently serve as a proxy for cc_toolchain (unlike java_runtime_suite for java_runtime), so that's OK. RELNOTES: None. PiperOrigin-RevId: 172502279
* In CppToolchainInfo, use the label of the cc_toolchain instead of ↵Gravatar cpeyser2017-10-16
| | | | | | --crosstool_top to find the crosstool package. PiperOrigin-RevId: 172320513
* Replace all tool getters in CppConfiguration with corresponding calls toGravatar cpeyser2017-10-12
| | | | | | CcToolchainProvider#getToolPathFragment. PiperOrigin-RevId: 171837541
* Check the implicit requirement of fdo_instrument and lipo_context.Gravatar ccalvarin2017-10-11
| | | | | | | The semantics of implicit requirements will soon change to adding the requirements in-place in the command line, so they will be slightly more likely to get overwritten. Explicitely check that the requirement is set, and warn appropriately if the user is sending mixed signals. RELNOTES: None. PiperOrigin-RevId: 171824297
* Migrate usage of CppConfiguration#getToolPathFragment andGravatar cpeyser2017-10-11
| | | | | | CppConfiguration#getLdExecutable to CcToolchainProvider. PiperOrigin-RevId: 171818406
* Remove unused MANDATORY_LINK_TARGET_TYPESGravatar George Gensure2017-10-11
| | | | | | | | | MANDATORY_LINK_TARGET_TYPES has not been in use since d83d9bf1 was released. Closes #3869. PiperOrigin-RevId: 171688095
* Workaround missing go_* target ThinLTO supportGravatar Googler2017-10-10
| | | | | | | Since go targets set up custom links and don't use CppLinkAction, handle ThinLTO builds by creating simple LTO backend actions to compile each IR file down to native code (without any whole program optimization). RELNOTES: None PiperOrigin-RevId: 171548766
* Extract CppToolchainInfo from CppConfiguration. CppToolchainInfo contains allGravatar cpeyser2017-10-10
| | | | | | | | information derived from the toolchain that is not also derived from build options. This will facilitate migration of toolchain information from CppConfiguration to CppToolchainProvider. CppConfiguration's usage of CppToolchainInfo can now be removed piece by piece as usage of toolchain information in the c++ rules is pointed at CppToolchainProvider instead of CppConfiguration. PiperOrigin-RevId: 171547509
* Add .imports file to the LTOBackendAction inputsGravatar Googler2017-10-07
| | | | | | | | | | Building with --experimental_discard_orphaned_artifacts will cause the .imports file produced by the LTO indexing action to not be preserved, unless it is marked as an input to the LTOBackendAction. It is only used in the input discovery phase, not as an input to the actual action, so it was not initially listed as an input. RELNOTES: None PiperOrigin-RevId: 171387388