Currently the the dynamic libraries from build hooks are bundled as is.
On Android and iOS we should run some compiler commands to strip them from debug symbols to reduce code size and provide the symbol files on the side.
- Android:
objcopy --only-keep-debug libmylib.so libmylib.so.sym + strip --strip-debug --strip-unneeded libmylib.so + objcopy --add-gnu-debuglink=libmylib.so.sym libmylib.so.
- iOS:
symutil libmylib.dylib + strip -x -S libmylib.dylib
For iOS we have code signing logic on copying. That would probably the right place to strip the symbols as well:
|
Future<void> copyNativeCodeAssetsIOS( |
For Android, we can add the stripping also just before the copying:
|
Future<void> copyNativeCodeAssetsAndroid( |
Thanks for the suggestion @mraleph!
(Note: since the debug symbols can be stripped by the SDK invoking the build hooks, we don't provide anything the build hooks itself to allow for reporting debug symbols in a separate file.)
Currently the the dynamic libraries from build hooks are bundled as is.
On Android and iOS we should run some compiler commands to strip them from debug symbols to reduce code size and provide the symbol files on the side.
objcopy --only-keep-debug libmylib.so libmylib.so.sym+strip --strip-debug --strip-unneeded libmylib.so+objcopy --add-gnu-debuglink=libmylib.so.sym libmylib.so.symutil libmylib.dylib+strip -x -S libmylib.dylibFor iOS we have code signing logic on copying. That would probably the right place to strip the symbols as well:
flutter/packages/flutter_tools/lib/src/isolated/native_assets/ios/native_assets.dart
Line 95 in 3d04e9a
For Android, we can add the stripping also just before the copying:
flutter/packages/flutter_tools/lib/src/isolated/native_assets/android/native_assets.dart
Line 19 in 3d04e9a
Thanks for the suggestion @mraleph!
(Note: since the debug symbols can be stripped by the SDK invoking the build hooks, we don't provide anything the build hooks itself to allow for reporting debug symbols in a separate file.)