Skip to content

Commit

Permalink
Flip --incompatible_dont_emit_static_libgcc flag
Browse files Browse the repository at this point in the history
    Closes #6825.
    Closes #6185.

    This is a rollforward of bazelbuild/bazel@5d77edf after Bazel with the flag was cut.

    RELNOTES: Incompatible flag `--incompatible_dont_emit_static_libgcc` has been flipped (bazelbuild/bazel#6825)
    PiperOrigin-RevId: 233589665
  • Loading branch information
Luca Di Grazia committed Sep 4, 2022
1 parent 3aa81d9 commit 99d7d52
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static class GraveyardOptions extends OptionsBase {
name = "incompatible_dont_emit_static_libgcc",
oldName = "experimental_dont_emit_static_libgcc",
defaultValue = "true",
documentationCategory = OptionDocumentationCategory.UNDOCUMENTED,
documentationCategory = OptionDocumentationCategory.TOOLCHAIN,
effectTags = {OptionEffectTag.ACTION_COMMAND_LINES, OptionEffectTag.LOADING_AND_ANALYSIS},
metadataTags = {
OptionMetadataTag.DEPRECATED,
Expand All @@ -57,7 +57,7 @@ public static class GraveyardOptions extends OptionsBase {
@Option(
name = "incompatible_linkopts_in_user_link_flags",
defaultValue = "true",
documentationCategory = OptionDocumentationCategory.UNDOCUMENTED,
documentationCategory = OptionDocumentationCategory.TOOLCHAIN,
effectTags = {OptionEffectTag.ACTION_COMMAND_LINES, OptionEffectTag.LOADING_AND_ANALYSIS},
metadataTags = {
OptionMetadataTag.DEPRECATED,
Expand All @@ -70,7 +70,7 @@ public static class GraveyardOptions extends OptionsBase {
@Option(
name = "incompatible_disable_runtimes_filegroups",
defaultValue = "false",
documentationCategory = OptionDocumentationCategory.UNDOCUMENTED,
documentationCategory = OptionDocumentationCategory.TOOLCHAIN,
effectTags = {OptionEffectTag.ACTION_COMMAND_LINES, OptionEffectTag.LOADING_AND_ANALYSIS},
metadataTags = {
OptionMetadataTag.DEPRECATED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,14 +318,7 @@ public static ConfiguredTarget init(CppSemantics semantics, RuleContext ruleCont
}
CcCompilationHelper compilationHelper =
new CcCompilationHelper(
ruleContext,
ruleContext,
ruleContext.getLabel(),
CppHelper.getGrepIncludes(ruleContext),
semantics,
featureConfiguration,
ccToolchain,
fdoContext)
ruleContext, semantics, featureConfiguration, ccToolchain, fdoContext)
.fromCommon(common, /* additionalCopts= */ ImmutableList.of())
.addPrivateHeaders(common.getPrivateHeaders())
.addSources(common.getSources())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,10 +396,6 @@ public boolean legacyWholeArchive() {
return cppOptions.legacyWholeArchive;
}

public boolean removeLegacyWholeArchive() {
return cppOptions.removeLegacyWholeArchive;
}

public boolean getInmemoryDotdFiles() {
return cppOptions.inmemoryDotdFiles;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,18 +360,16 @@ public String getTypeDescription() {
public Label customMalloc;

@Option(
name = "legacy_whole_archive",
defaultValue = "true",
documentationCategory = OptionDocumentationCategory.OUTPUT_PARAMETERS,
effectTags = {OptionEffectTag.ACTION_COMMAND_LINES, OptionEffectTag.AFFECTS_OUTPUTS},
metadataTags = {OptionMetadataTag.DEPRECATED},
help =
"Deprecated, superseded by --incompatible_remove_legacy_whole_archive "
+ "(see https://github.com/bazelbuild/bazel/issues/7362 for details). "
+ "When on, use --whole-archive for cc_binary rules that have "
+ "linkshared=1 and either linkstatic=1 or '-static' in linkopts. "
+ "This is for backwards compatibility only. "
+ "A better alternative is to use alwayslink=1 where required.")
name = "legacy_whole_archive",
defaultValue = "true",
documentationCategory = OptionDocumentationCategory.OUTPUT_PARAMETERS,
effectTags = {OptionEffectTag.ACTION_COMMAND_LINES, OptionEffectTag.AFFECTS_OUTPUTS},
help =
"When on, use --whole-archive for cc_binary rules that have "
+ "linkshared=1 and either linkstatic=1 or '-static' in linkopts. "
+ "This is for backwards compatibility only. "
+ "A better alternative is to use alwayslink=1 where required."
)
public boolean legacyWholeArchive;

@Option(
Expand Down Expand Up @@ -700,20 +698,6 @@ public Label getFdoPrefetchHintsLabel() {
+ "(see https://github.com/bazelbuild/bazel/issues/6861 for migration instructions).")
public boolean disableLegacyCrosstoolFields;

@Option(
name = "incompatible_remove_legacy_whole_archive",
defaultValue = "false",
documentationCategory = OptionDocumentationCategory.TOOLCHAIN,
effectTags = {OptionEffectTag.LOADING_AND_ANALYSIS},
metadataTags = {
OptionMetadataTag.INCOMPATIBLE_CHANGE,
OptionMetadataTag.TRIGGERED_BY_ALL_INCOMPATIBLE_CHANGES
},
help =
"If true, Bazel will not link library dependencies as whole archive by default "
+ "(see https://github.com/bazelbuild/bazel/issues/7362 for migration instructions).")
public boolean removeLegacyWholeArchive;

@Option(
name = "incompatible_remove_cpu_and_compiler_attributes_from_cc_toolchain",
defaultValue = "false",
Expand Down Expand Up @@ -885,7 +869,6 @@ public FragmentOptions getHost() {
host.disableLegacyCrosstoolFields = disableLegacyCrosstoolFields;
host.disableCrosstool = disableCrosstool;
host.enableCcToolchainResolution = enableCcToolchainResolution;
host.removeLegacyWholeArchive = removeLegacyWholeArchive;
return host;
}

Expand Down

0 comments on commit 99d7d52

Please sign in to comment.