anchor.diff:      // Write summary.
       assembler = new PackageBundleAssembler();
       if (_shouldOutputSummary) {
  -      if (options.buildSummaryOnlyUnlinked) {
  -        for (var src in explicitSources) {
  -          // Note: This adds the unit to the assembler if it needed to be
  -          // computed, so we don't need to explicitly do that.
  -          _unlinkedUnitForUri('${src.uri}');
  -        }
  -      } else {
  -        Set<String> unlinkedUris =
  -            explicitSources.map((Source s) => s.uri.toString()).toSet();
  +      // Prepare all unlinked units.
  +      for (var src in explicitSources) {
  +        _prepareUnlinkedUnit('${src.uri}');
  +      }
  +
  +      // Build and assemble linked libraries.
  +      if (!options.buildSummaryOnlyUnlinked) {
  +        // Prepare URIs of unlinked units that should be linked.
  +        var unlinkedUris = new Set<String>();
           for (var bundle in unlinkedBundles) {
             unlinkedUris.addAll(bundle.unlinkedUnitUris);
           }
  -
  -        _serializeAstBasedSummary(unlinkedUris);
  +        for (var src in explicitSources) {
  +          unlinkedUris.add('${src.uri}');
  +        }
  +        // Perform linking.
  +        _computeLinkedLibraries(unlinkedUris);
           assembler.recordDependencies(summaryDataStore);
         }
  +
         // Write the whole package bundle.
         PackageBundleBuilder bundle = assembler.assemble();
         if (options.buildSummaryOutput != null) {
  
positive.code: 
    PackageBundleAssembler assembler;
    final Set<Source> processedSources = new Set<Source>();
    final Map<Uri, UnlinkedUnit> uriToUnit = <Uri, UnlinkedUnit>{};
  
    BuildMode(this.resourceProvider, this.options, this.stats);
  
  
negative.code:   }
  
    /**
     * Ensure that the [UnlinkedUnit] for [absoluteUri] is available.
     *
     * If the unit is in the input [summaryDataStore], do nothing.
     *
     * Otherwise compute it and store into the [uriToUnit] and [assembler].
     */
    void _prepareUnlinkedUnit(String absoluteUri) {
      // Maybe an input package contains the source.
      if (summaryDataStore.unlinkedMap[absoluteUri] != null) {
        return;
      }
      // Parse the source and serialize its AST.
      Uri uri = Uri.parse(absoluteUri);
      Source source = context.sourceFactory.forUri2(uri);
      if (!source.exists()) {
        // TODO(paulberry): we should report a warning/error because DDC
        // compilations are unlikely to work.
        return;
      }
      CompilationUnit unit = context.computeResult(source, PARSED_UNIT);
      UnlinkedUnitBuilder unlinkedUnit = serializeAstUnlinked(unit);
      uriToUnit[absoluteUri] = unlinkedUnit;
      assembler.addUnlinkedUnit(source, unlinkedUnit);
    }
  
    /**
     * Print errors for all explicit sources.  If [outputPath] is supplied, output
     * is sent to a new file at that path.
     */
  