Commit Graph

16 Commits

Author SHA1 Message Date
hlopko 0c017ebc6d Do not condition linker_flags from DYNAMIC linking_mode_flags for transitive dynamic libraries on dynamic_linking_mode feature
https://github.com/bazelbuild/bazel/issues/6861

RELNOTES: None.
PiperOrigin-RevId: 238941083
2019-03-18 01:04:18 -07:00
hlopko 10f38e16da Fix migrator to correctly migrate dynamic linking mode linker_flags
This would have not introduced the osx crosstool bug in 2d0e27e8bc which was then fixed in unknown commit.

RELNOTES: None.
PiperOrigin-RevId: 238699176
2019-03-15 13:25:11 -07:00
hlopko 0b8e7b5940 Use is_using_fission in legacy_fields_migrator
Since unknown commit is submitted, the principled variable to use in per_object_debug_info is is_using_fission, not per_object_debug_info_file (in case of thinlto build, the former is present also for thinlto bitcode compile, the latter only for backend compile).

RELNOTES: None.
PiperOrigin-RevId: 237192121
2019-03-07 00:02:00 -08:00
hlopko 7e835b273a Clear dynamic_library_linker_flag in legacy_fields_migrator
RELNOTES: None.
PiperOrigin-RevId: 234748020
2019-02-20 00:25:12 -08:00
hlopko d485e267a5 Enable features that were previously enabled by Bazel in legacy_fields_migrator
https://github.com/bazelbuild/bazel/issues/6861

RELNOTES: None.
PiperOrigin-RevId: 233735389
2019-02-13 05:40:50 -08:00
hlopko 49a6c21b32 Do not use static_linking_mode for dynamic libraries and objc rules
Another dark corner corner of crosstools appeared, and apparently we didn't enable MOSTLY STATIC linking mode flags for dynamic libraries or objc. This cl addresses that in the legacy fields migrator.

RELNOTES: None.
PiperOrigin-RevId: 233397974
2019-02-11 06:47:26 -08:00
hlopko dfb180b486 Migrate repeated expand_if_(all|none)_available into nested flag_groups
Crosstool in Starlark assumes these fields as singular, not collections. This cl updates the migration script to prepare crosstool in proto for this.

https://github.com/bazelbuild/bazel/issues/6861
https://github.com/bazelbuild/bazel/issues/5883

RELNOTES: None.
PiperOrigin-RevId: 233041028
2019-02-08 04:53:52 -08:00
hlopko ddf13fe1da Don't require supports_fission to be set in the crosstool
Having a 'per_object_debug_data' feature enabled is giving the same signal as having supports_fission enabled. This is a safe change because all crosstools that have supports_fission: true have per_object_debug_info disabled, and with the legacy crosstool fields migration we will migrate this feature to be enabled by default for these crosstools.

https://github.com/bazelbuild/bazel/issues/6861
https://github.com/bazelbuild/bazel/issues/5883

RELNOTES: None.
PiperOrigin-RevId: 230701029
2019-01-24 04:55:15 -08:00
hlopko f9cdb36627 Always put linker_flags from linking_mode_flags.DYNAMIC to nodeps-dynamic-library
This cl fixes a bug in the migrator where it didn't pass mentioned flags to c++-nodeps-dynamic-library unconditionally (it only passed them as with feature { feature: 'dynamic_linking_mode' }, which is incorrect, the feature doesn't not apply to nodeps-dynamic-library, only to transitive linking actions.

https://github.com/bazelbuild/bazel/issues/6861
https://github.com/bazelbuild/bazel/issues/5883

RELNOTES: None.
PiperOrigin-RevId: 229692958
2019-01-17 00:07:27 -08:00
hlopko 0fd5bb9b75 Rename/remove fields referencing legacy features in legacy_fields_migrator
When renaming legacy_*_flags to default_*_flags, also rename other fields such as requires.

We're intentionally not replacing the implies line, just removing it, because default_*_features are enabled by default, so they don't need to be implied (Implied field is older than enabled field, so there are uses of it where enabled would work just fine. The only semantic difference is that implied features cannot be disabled, whereas enabled can. But since the standard style of writing crosstools seems to prefer enabled, I'm doing the same here.)

https://github.com/bazelbuild/bazel/issues/6861
https://github.com/bazelbuild/bazel/issues/5883

RELNOTES: None.
PiperOrigin-RevId: 229518029
2019-01-16 01:41:22 -08:00
hlopko 04195ada17 Fix legacy_fields_migrator
Another round of fixes:

* if the toolchain contains legacy_compile_flags or legacy_link_flags, replace the feature with default_compile_flags or default_link_flags. This is to ensure the location of the flags stays intact.
* it fixes the order of compilation flags, the correct order is:
  1) compiler_flag
  2) compilation_mode_flags.compiler_flag
  3) cxx_flag
  4) compilation_mode_flags.cxx_flag
* We don't add cxx_flags to assemble and preprocess-assemble actions
* We don't add sysroot to assemble action

https://github.com/bazelbuild/bazel/issues/6861
https://github.com/bazelbuild/bazel/issues/5883

RELNOTES: None.
PiperOrigin-RevId: 229336027
2019-01-15 02:09:19 -08:00
hlopko c0ac741cbe Improve legacy_fields_migrator to work properly for objc crosstools
https://github.com/bazelbuild/bazel/issues/5883
https://github.com/bazelbuild/bazel/issues/6861

RELNOTES: None.
PiperOrigin-RevId: 228839863
2019-01-11 00:11:34 -08:00
hlopko 63003094c9 Make cc_embed_data.bzl forward compatible with removal of legacy crosstool fields
RELNOTES: None
PiperOrigin-RevId: 228301880
2019-01-09 08:58:59 +01:00
hlopko f835b8bea2 Fix legacy_fields_migrator
This cl fixes:

* clears 'supports_embedded_runtimes'
* adds user_compile_flags and sysroot feature
  * these are needed to appear before unfiltered_compile_flags

Progress towards:
https://github.com/bazelbuild/bazel/issues/6861
https://github.com/bazelbuild/bazel/issues/5883

RELNOTES: None.
PiperOrigin-RevId: 228299172
2019-01-09 08:58:48 +01:00
hlopko b809b1312f Fix edge cases of legacy crosstool migrator
https://github.com/bazelbuild/bazel/issues/5883

RELNOTES: None.
PiperOrigin-RevId: 227688115
2019-01-09 08:57:53 +01:00
hlopko e1d74cbe59 Move legacy_fields_migrator to rules_cc
Needed for --incompatible_disable_legacy_crosstool_fields migration: https://github.com/bazelbuild/bazel/issues/6861
Tracking issue: https://github.com/bazelbuild/bazel/issues/5883

RELNOTES: None.
PiperOrigin-RevId: 225956311
2019-01-09 08:56:10 +01:00