forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Embed ICU data inside libflutter.so on Android (flutter#7588)
Prior to this the Android embedder code would extract the icudtl.dat asset out of the APK and write it to local disk during the first startup of the app. This change will make that work unnecessary and eliminate the risk of ICU failures due to errors in the extraction process.
- Loading branch information
1 parent
c92df42
commit 050dcaa
Showing
12 changed files
with
130 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Copyright 2013 The Flutter Authors. All rights reserved. | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
# Linker script that exports the minimal symbols required for libflutter.so | ||
|
||
{ | ||
global: | ||
JNI_OnLoad; | ||
_binary_icudtl_dat_start; | ||
_binary_icudtl_dat_size; | ||
local: | ||
*; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/env python | ||
# Copyright 2013 The Flutter Authors. All rights reserved. | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
import argparse | ||
import os | ||
import subprocess | ||
import sys | ||
|
||
# BFD architecture names recognized by objcopy. | ||
BFD_ARCH = { | ||
'arm': 'arm', | ||
'arm64': 'aarch64', | ||
'x86': 'i386', | ||
'x64': 'i386:x86-64', | ||
} | ||
|
||
# BFD target names recognized by objcopy. | ||
BFD_TARGET = { | ||
'arm': 'elf32-littlearm', | ||
'arm64': 'elf64-littleaarch64', | ||
'x86': 'elf32-i386', | ||
'x64': 'elf64-x86-64', | ||
} | ||
|
||
def main(): | ||
parser = argparse.ArgumentParser(description='Convert a data file to an object file') | ||
parser.add_argument('--objcopy', type=str, required=True) | ||
parser.add_argument('--input', type=str, required=True) | ||
parser.add_argument('--output', type=str, required=True) | ||
parser.add_argument('--arch', type=str, required=True) | ||
|
||
args = parser.parse_args() | ||
|
||
input_dir, input_file = os.path.split(args.input) | ||
output_path = os.path.abspath(args.output) | ||
|
||
subprocess.check_call([ | ||
args.objcopy, | ||
'-I', 'binary', | ||
'-O', BFD_TARGET[args.arch], | ||
'-B', BFD_ARCH[args.arch], | ||
input_file, | ||
output_path, | ||
], cwd=input_dir) | ||
|
||
if __name__ == '__main__': | ||
sys.exit(main()) |