diff options
author | Lukacs Berki <lberki@google.com> | 2016-08-22 14:53:38 +0000 |
---|---|---|
committer | Philipp Wollermann <philwo@google.com> | 2016-08-23 09:28:15 +0000 |
commit | 76a2bbcf5e20f42400a5dad47729553ce8514e66 (patch) | |
tree | e204bbd30dbe408ac48aa5f949946bbea853534b /src/main/java/com/google/devtools/build/lib/rules | |
parent | fd843fe97e5e088ec422e5a294d71040e80b4cbd (diff) |
Remove support for thin archives.
--
MOS_MIGRATED_REVID=130938527
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules')
4 files changed, 8 insertions, 47 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java index ae9218d134..70af928677 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java @@ -271,7 +271,6 @@ public class CppConfiguration extends BuildConfiguration.Fragment { private final CcToolchainFeatures toolchainFeatures; private final boolean supportsGoldLinker; - private final boolean supportsThinArchives; private final boolean supportsStartEndLib; private final boolean supportsDynamicLinker; private final boolean supportsInterfaceSharedObjects; @@ -324,7 +323,6 @@ public class CppConfiguration extends BuildConfiguration.Fragment { private final ImmutableList<String> objcopyOptions; private final ImmutableList<String> ldOptions; private final ImmutableList<String> arOptions; - private final ImmutableList<String> arThinArchivesOptions; private final ImmutableMap<String, String> additionalMakeVariables; @@ -409,7 +407,6 @@ public class CppConfiguration extends BuildConfiguration.Fragment { toolchain = addLegacyFeatures(toolchain); this.toolchainFeatures = new CcToolchainFeatures(toolchain); this.supportsGoldLinker = toolchain.getSupportsGoldLinker(); - this.supportsThinArchives = toolchain.getSupportsThinArchives(); this.supportsStartEndLib = toolchain.getSupportsStartEndLib(); this.supportsInterfaceSharedObjects = toolchain.getSupportsInterfaceSharedObjects(); this.supportsEmbeddedRuntimes = toolchain.getSupportsEmbeddedRuntimes(); @@ -515,8 +512,6 @@ public class CppConfiguration extends BuildConfiguration.Fragment { this.objcopyOptions = ImmutableList.copyOf(toolchain.getObjcopyEmbedFlagList()); this.ldOptions = ImmutableList.copyOf(toolchain.getLdEmbedFlagList()); this.arOptions = copyOrDefaultIfEmpty(toolchain.getArFlagList(), "rcsD"); - this.arThinArchivesOptions = copyOrDefaultIfEmpty( - toolchain.getArThinArchivesFlagList(), "rcsDT"); this.abi = toolchain.getAbiVersion(); this.abiGlibcVersion = toolchain.getAbiLibcVersion(); @@ -1239,13 +1234,6 @@ public class CppConfiguration extends BuildConfiguration.Fragment { } /** - * Returns whether the toolchain supports thin archives. - */ - public boolean supportsThinArchives() { - return supportsThinArchives; - } - - /** * Returns whether the toolchain supports the --start-lib/--end-lib options. */ public boolean supportsStartEndLib() { @@ -1311,20 +1299,14 @@ public class CppConfiguration extends BuildConfiguration.Fragment { * Returns the type of archives being used. */ public Link.ArchiveType archiveType() { - if (useStartEndLib()) { - return Link.ArchiveType.START_END_LIB; - } - if (useThinArchives()) { - return Link.ArchiveType.THIN; - } - return Link.ArchiveType.FAT; + return useStartEndLib() ? Link.ArchiveType.START_END_LIB : Link.ArchiveType.REGULAR; } /** * Returns the ar flags to be used. */ - public ImmutableList<String> getArFlags(boolean thinArchives) { - return thinArchives ? arThinArchivesOptions : arOptions; + public ImmutableList<String> getArFlags() { + return arOptions; } /** @@ -1707,10 +1689,6 @@ public class CppConfiguration extends BuildConfiguration.Fragment { return cppOptions.useStartEndLib && supportsStartEndLib(); } - public boolean useThinArchives() { - return cppOptions.useThinArchives && supportsThinArchives(); - } - /** * Returns true if interface shared objects should be used. */ diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java index 47cd385670..0b7b82c193 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppOptions.java @@ -173,16 +173,6 @@ public class CppOptions extends FragmentOptions { ) public String glibc; - @Option( - name = "thin_archives", - defaultValue = "false", - category = "strategy", // but also adds edges to the action graph - help = - "Pass the 'T' flag to ar if supported by the toolchain. " - + "All supported toolchains support this setting." - ) - public boolean useThinArchives; - // O intrepid reaper of unused options: Be warned that the [no]start_end_lib // option, however tempting to remove, has a use case. Look in our telemetry data. @Option( @@ -581,7 +571,6 @@ public class CppOptions extends FragmentOptions { // -g0 first and let the user options override it. host.coptList = ImmutableList.<String>builder().add("-g0").addAll(hostCoptList).build(); - host.useThinArchives = useThinArchives; host.useStartEndLib = useStartEndLib; host.stripBinaries = StripMode.ALWAYS; host.fdoOptimize = null; diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/Link.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/Link.java index f03f128199..ec51c8413f 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/Link.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/Link.java @@ -60,10 +60,6 @@ public abstract class Link { CppFileTypes.VERSIONED_SHARED_LIBRARY, CppFileTypes.INTERFACE_SHARED_LIBRARY); - /** - * These need special handling when --thin_archive is true. {@link CppLinkAction} checks that - * these files are never added as non-libraries. - */ public static final FileTypeSet ARCHIVE_LIBRARY_FILETYPES = FileTypeSet.of( CppFileTypes.ARCHIVE, CppFileTypes.PIC_ARCHIVE, @@ -239,12 +235,11 @@ public abstract class Link { } /** - * Types of archive. + * How to pass archives to the linker on the command line. */ public enum ArchiveType { - FAT, // Regular archive that includes its members. - THIN, // Thin archive that just points to its members. - START_END_LIB // A --start-lib ... --end-lib group in the command line. + REGULAR, // Put the archive itself on the linker command line. + START_END_LIB // Put the object files enclosed by --start-lib / --end-lib on the command line } static boolean useStartEndLib(LinkerInput linkerInput, ArchiveType archiveType) { @@ -331,7 +326,7 @@ public abstract class Link { // start_end_lib archive (aka static library). Also check if the library contains object // files - otherwise getObjectFiles returns null, which would lead to an NPE in // simpleLinkerInputs. - boolean needMembersForLink = archiveType != ArchiveType.FAT + boolean needMembersForLink = archiveType != ArchiveType.REGULAR && (inputLibrary.getArtifactCategory() == ArtifactCategory.STATIC_LIBRARY || inputLibrary.getArtifactCategory() == ArtifactCategory.ALWAYSLINK_STATIC_LIBRARY) && inputLibrary.containsObjectFiles(); diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java index b3a0cc7d09..bb4826e242 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java @@ -433,8 +433,7 @@ public final class LinkCommandLine extends CommandLine { // The static library link command follows this template: // ar <cmd> <output_archive> <input_files...> argv.add(cppConfiguration.getArExecutable().getPathString()); - argv.addAll( - cppConfiguration.getArFlags(cppConfiguration.archiveType() == Link.ArchiveType.THIN)); + argv.addAll(cppConfiguration.getArFlags()); argv.add(output.getExecPathString()); argv.addAll(featureConfiguration.getCommandLine(actionName, variables)); argv.addAll(noWholeArchiveFlags); |