Unverified Commit 11621cc7 authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

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

parent ace2c229
......@@ -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,
......
......@@ -326,6 +326,7 @@ void main() {
'--deterministic',
'--snapshot_kind=app-aot-assembly',
'--assembly=$assembly',
'--strip',
'--no-sim-use-hardfp',
'--no-use-integer-division',
'--no-causal-async-stacks',
......@@ -360,7 +361,7 @@ void main() {
final String assembly = globals.fs.path.join(outputPath, 'snapshot_assembly.S');
genSnapshot.outputs = <String, String>{
assembly: 'blah blah\n.section __DWARF\nblah blah\n',
assembly: 'blah blah\n',
};
final RunResult successResult = RunResult(ProcessResult(1, 0, '', ''), <String>['command name', 'arguments...']);
......@@ -385,6 +386,7 @@ void main() {
'--deterministic',
'--snapshot_kind=app-aot-assembly',
'--assembly=$assembly',
'--strip',
'--no-sim-use-hardfp',
'--no-use-integer-division',
'--no-causal-async-stacks',
......@@ -407,11 +409,7 @@ void main() {
expect(clangArgs, contains(kSDKPath));
final File assemblyFile = globals.fs.file(assembly);
final File assemblyBitcodeFile = globals.fs.file('$assembly.stripped.S');
expect(assemblyFile.existsSync(), true);
expect(assemblyBitcodeFile.existsSync(), true);
expect(assemblyFile.readAsStringSync().contains('.section __DWARF'), true);
expect(assemblyBitcodeFile.readAsStringSync().contains('.section __DWARF'), false);
}, overrides: contextOverrides);
testUsingContext('builds iOS armv7 profile AOT snapshot', () async {
......@@ -447,6 +445,7 @@ void main() {
'--deterministic',
'--snapshot_kind=app-aot-assembly',
'--assembly=$assembly',
'--strip',
'--no-sim-use-hardfp',
'--no-use-integer-division',
'--no-causal-async-stacks',
......@@ -496,6 +495,7 @@ void main() {
'--deterministic',
'--snapshot_kind=app-aot-assembly',
'--assembly=${globals.fs.path.join(outputPath, 'snapshot_assembly.S')}',
'--strip',
'--no-causal-async-stacks',
'--lazy-async-stacks',
'main.dill',
......@@ -534,6 +534,7 @@ void main() {
'--deterministic',
'--snapshot_kind=app-aot-assembly',
'--assembly=${globals.fs.path.join(outputPath, 'snapshot_assembly.S')}',
'--strip',
'--no-sim-use-hardfp',
'--no-use-integer-division',
'--no-causal-async-stacks',
......@@ -574,6 +575,7 @@ void main() {
'--deterministic',
'--snapshot_kind=app-aot-assembly',
'--assembly=${globals.fs.path.join(outputPath, 'snapshot_assembly.S')}',
'--strip',
'--no-causal-async-stacks',
'--lazy-async-stacks',
'main.dill',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment