diff --git a/android/api_levels.go b/android/api_levels.go index 70b251b61..cf1011b97 100644 --- a/android/api_levels.go +++ b/android/api_levels.go @@ -55,7 +55,19 @@ func GetApiLevelsJson(ctx PathContext) Path { func (a *apiLevelsSingleton) GenerateBuildActions(ctx blueprint.SingletonContext) { baseApiLevel := 9000 - apiLevelsMap := map[string]int{} + apiLevelsMap := map[string]int{ + "G": 9, + "I": 14, + "J": 16, + "J-MR1": 17, + "J-MR2": 18, + "K": 19, + "L": 21, + "L-MR1": 22, + "M": 23, + "N": 24, + "N-MR1": 25, + } for i, codename := range ctx.Config().(Config).PlatformVersionAllCodenames() { apiLevelsMap[codename] = baseApiLevel + i } diff --git a/cc/gen_stub_libs.py b/cc/gen_stub_libs.py index bed718c39..abb39c2a3 100755 --- a/cc/gen_stub_libs.py +++ b/cc/gen_stub_libs.py @@ -347,10 +347,16 @@ class Generator(object): if section_versioned and emit_version: self.version_script.write(' ' + symbol.name + ';\n') + weak = '' + if 'weak' in symbol.tags: + weak = '__attribute__((weak)) ' + if 'var' in symbol.tags: - self.src_file.write('int {} = 0;\n'.format(symbol.name)) + self.src_file.write('{}int {} = 0;\n'.format( + weak, symbol.name)) else: - self.src_file.write('void {}() {{}}\n'.format(symbol.name)) + self.src_file.write('{}void {}() {{}}\n'.format( + weak, symbol.name)) if not version_empty and section_versioned: base = '' if version.base is None else ' ' + version.base diff --git a/cc/test_gen_stub_libs.py b/cc/test_gen_stub_libs.py index 4df6cf8c6..b20a5c73a 100755 --- a/cc/test_gen_stub_libs.py +++ b/cc/test_gen_stub_libs.py @@ -430,6 +430,8 @@ class GeneratorTest(unittest.TestCase): gsl.Version('VERSION_1', None, [], [ gsl.Symbol('foo', []), gsl.Symbol('bar', ['var']), + gsl.Symbol('woodly', ['weak']), + gsl.Symbol('doodly', ['weak', 'var']), ]), gsl.Version('VERSION_2', 'VERSION_1', [], [ gsl.Symbol('baz', []), @@ -443,6 +445,8 @@ class GeneratorTest(unittest.TestCase): expected_src = textwrap.dedent("""\ void foo() {} int bar = 0; + __attribute__((weak)) void woodly() {} + __attribute__((weak)) int doodly = 0; void baz() {} void qux() {} """) @@ -453,6 +457,8 @@ class GeneratorTest(unittest.TestCase): global: foo; bar; + woodly; + doodly; }; VERSION_2 { global: