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 5d77edf after Bazel with the flag was cut.

RELNOTES: Incompatible flag `--incompatible_dont_emit_static_libgcc` has been flipped (#6825)
PiperOrigin-RevId: 233589665
  • Loading branch information
hlopko authored and Copybara-Service committed Feb 12, 2019
1 parent d62d294 commit fb7c373
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,20 @@
public class BazelRulesModule extends BlazeModule {
/** This is where deprecated options go to die. */
public static class GraveyardOptions extends OptionsBase {
@Option(
name = "incompatible_dont_emit_static_libgcc",
oldName = "experimental_dont_emit_static_libgcc",
defaultValue = "true",
documentationCategory = OptionDocumentationCategory.TOOLCHAIN,
effectTags = {OptionEffectTag.ACTION_COMMAND_LINES, OptionEffectTag.LOADING_AND_ANALYSIS},
metadataTags = {
OptionMetadataTag.DEPRECATED,
OptionMetadataTag.INCOMPATIBLE_CHANGE,
OptionMetadataTag.TRIGGERED_BY_ALL_INCOMPATIBLE_CHANGES
},
help = "Deprecated no-op.")
public boolean disableEmittingStaticLibgcc;

@Option(
name = "incompatible_linkopts_in_user_link_flags",
defaultValue = "true",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -726,16 +726,6 @@ public static Pair<CcLinkingOutputs, CcLauncherInfo> createTransitiveLinkingActi
NestedSetBuilder.wrap(Order.LINK_ORDER, precompiledLibraries.build()));

ImmutableList.Builder<String> userLinkflags = ImmutableList.builder();
if (linkingMode != Link.LinkingMode.DYNAMIC
&& !cppConfiguration.disableEmittingStaticLibgcc()) {
// Only force a static link of libgcc if static runtime linking is enabled (which
// can't be true if runtimeInputs is empty).
// TODO(bazel-team): Move this to CcToolchain.
if (!ccToolchain.getStaticRuntimeLinkInputs(ruleContext, featureConfiguration).isEmpty()) {
userLinkflags.add("-static-libgcc");
}
}

userLinkflags.addAll(common.getLinkopts());
currentCcLinkingContextBuilder
.addNonCodeInputs(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -556,10 +556,6 @@ public static String getLegacyCrosstoolFieldErrorMessage(String field) {
+ "migration instructions).";
}

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

public boolean disableDepsetInUserFlags() {
return cppOptions.disableDepsetInUserFlags;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -727,21 +727,6 @@ public Label getFdoPrefetchHintsLabel() {
+ "(see https://github.com/bazelbuild/bazel/issues/7008 for migration instructions).")
public boolean disableExpandIfAllAvailableInFlagSet;

@Option(
name = "incompatible_dont_emit_static_libgcc",
oldName = "experimental_dont_emit_static_libgcc",
defaultValue = "true",
documentationCategory = OptionDocumentationCategory.TOOLCHAIN,
effectTags = {OptionEffectTag.ACTION_COMMAND_LINES, OptionEffectTag.LOADING_AND_ANALYSIS},
metadataTags = {
OptionMetadataTag.INCOMPATIBLE_CHANGE,
OptionMetadataTag.TRIGGERED_BY_ALL_INCOMPATIBLE_CHANGES
},
help =
"If true, bazel will not add --static-libgcc to the linking command line, it will be "
+ "the responsibility of the C++ toolchain to append this flag.")
public boolean disableEmittingStaticLibgcc;

@Option(
name = "incompatible_disable_crosstool_file",
defaultValue = "false",
Expand Down Expand Up @@ -877,7 +862,6 @@ public FragmentOptions getHost() {

host.doNotUseCpuTransformer = doNotUseCpuTransformer;
host.disableGenruleCcToolchainDependency = disableGenruleCcToolchainDependency;
host.disableEmittingStaticLibgcc = disableEmittingStaticLibgcc;
host.disableDepsetInUserFlags = disableDepsetInUserFlags;
host.disableExpandIfAllAvailableInFlagSet = disableExpandIfAllAvailableInFlagSet;
host.disableLegacyCcProvider = disableLegacyCcProvider;
Expand Down

0 comments on commit fb7c373

Please sign in to comment.