[flutter_tools] remove dwarf stripping now that linked issue is fixed (#49563)

This commit is contained in:
Jonah Williams
2020-01-27 17:41:55 -08:00
committed by GitHub
parent ace2c2297f
commit 11621cc798
2 changed files with 9 additions and 23 deletions

View File

@@ -137,6 +137,7 @@ class AOTSnapshotter {
outputPaths.add(assembly);
genSnapshotArgs.add('--snapshot_kind=app-aot-assembly');
genSnapshotArgs.add('--assembly=$assembly');
genSnapshotArgs.add('--strip');
} else {
final String aotSharedLibrary = globals.fs.path.join(outputDir.path, 'app.so');
outputPaths.add(aotSharedLibrary);
@@ -184,23 +185,6 @@ class AOTSnapshotter {
return genSnapshotExitCode;
}
// TODO(dnfield): This should be removed when https://github.com/dart-lang/sdk/issues/37560
// is resolved.
// The DWARF section confuses Xcode tooling, so this strips it. Ideally,
// gen_snapshot would provide an argument to do this automatically.
final bool stripSymbols = platform == TargetPlatform.ios && buildMode == BuildMode.release && bitcode;
if (stripSymbols) {
final IOSink sink = globals.fs.file('$assembly.stripped.S').openWrite();
for (final String line in globals.fs.file(assembly).readAsLinesSync()) {
if (line.startsWith('.section __DWARF')) {
break;
}
sink.writeln(line);
}
await sink.flush();
await sink.close();
}
// Write path to gen_snapshot, since snapshots have to be re-generated when we roll
// the Dart SDK.
// TODO(jonahwilliams): remove when all callers are using assemble.
@@ -213,7 +197,7 @@ class AOTSnapshotter {
final RunResult result = await _buildFramework(
appleArch: darwinArch,
isIOS: platform == TargetPlatform.ios,
assemblyPath: stripSymbols ? '$assembly.stripped.S' : assembly,
assemblyPath: assembly,
outputPath: outputDir.path,
bitcode: bitcode,
quiet: quiet,