Loading android/api_levels.go +1 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,7 @@ func getApiLevelsMap(config Config) map[string]int { "O": 26, "O-MR1": 27, "P": 28, "Q": 29, } for i, codename := range config.PlatformVersionCombinedCodenames() { apiLevelsMap[codename] = baseApiLevel + i Loading android/neverallow.go +10 −1 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ func createNeverAllows() []*rule { rules := []*rule{} rules = append(rules, createTrebleRules()...) rules = append(rules, createLibcoreRules()...) rules = append(rules, createMediaRules()...) rules = append(rules, createJavaDeviceForHostRules()...) return rules } Loading @@ -70,7 +71,7 @@ func createTrebleRules() []*rule { // TODO(b/67974785): always enforce the manifest neverallow(). without("name", "libhidltransport"). without("name", "libhidltransport-impl-internal"). with("product_variables.enforce_vintf_manifest.cflags", "*"). because("manifest enforcement should be independent of ."), Loading Loading @@ -111,6 +112,14 @@ func createLibcoreRules() []*rule { return rules } func createMediaRules() []*rule { return []*rule{ neverallow(). with("libs", "updatable-media"). because("updatable-media includes private APIs. Use updatable_media_stubs instead."), } } func createJavaDeviceForHostRules() []*rule { javaDeviceForHostProjectsWhitelist := []string{ "external/guava", Loading android/neverallow_test.go +11 −15 Original line number Diff line number Diff line Loading @@ -89,21 +89,6 @@ var neverallowTests = []struct { }, expectedError: "manifest enforcement should be independent", }, { name: "libhidltransport enforce_vintf_manifest.cflags", fs: map[string][]byte{ "Blueprints": []byte(` cc_library { name: "libhidltransport", product_variables: { enforce_vintf_manifest: { cflags: ["-DSHOULD_NOT_EXIST"], }, }, }`), }, expectedError: "", }, { name: "no treble_linker_namespaces.cflags", Loading Loading @@ -135,6 +120,17 @@ var neverallowTests = []struct { }, expectedError: "", }, { name: "dependency on updatable-media", fs: map[string][]byte{ "Blueprints": []byte(` java_library { name: "needs_updatable_media", libs: ["updatable-media"], }`), }, expectedError: "updatable-media includes private APIs. Use updatable_media_stubs instead.", }, { name: "java_device_for_host", fs: map[string][]byte{ Loading cc/config/clang.go +5 −9 Original line number Diff line number Diff line Loading @@ -101,9 +101,8 @@ func init() { // not emit the table by default on Android since NDK still uses GNU binutils. "-faddrsig", // Make implicit fallthrough an error in the future. // -Wimplicit-fallthrough is not enabled by -Wall. "-Wimplicit-fallthrough", "-Wno-error=implicit-fallthrough", // Help catch common 32/64-bit errors. "-Werror=int-conversion", Loading Loading @@ -171,11 +170,6 @@ func init() { "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-tautological-unsigned-zero-compare", // http://b/72330874 Disable -Wenum-compare until the instances detected by this new // warning are fixed. "-Wno-enum-compare", "-Wno-enum-compare-switch", // Disable c++98-specific warning since Android is not concerned with C++98 // compatibility. "-Wno-c++98-compat-extra-semi", Loading @@ -184,9 +178,11 @@ func init() { "-Wno-return-std-move-in-c++11", }, " ")) // Extra cflags for projects under external/ directory // Extra cflags for projects under external/ directory to disable warnings that are infeasible // to fix in all the external projects and their upstream repos. pctx.StaticVariable("ClangExtraExternalCflags", strings.Join([]string{ // TODO(yikong): Move -Wno flags here "-Wno-enum-compare", "-Wno-enum-compare-switch", // http://b/72331524 Allow null pointer arithmetic until the instances detected by // this new warning are fixed. Loading cc/sanitize.go +2 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,8 @@ var ( minimalRuntimeFlags = []string{"-fsanitize-minimal-runtime", "-fno-sanitize-trap=integer,undefined", "-fno-sanitize-recover=integer,undefined"} hwasanGlobalOptions = []string{"heap_history_size=1023,stack_history_size=512"} hwasanGlobalOptions = []string{"heap_history_size=1023", "stack_history_size=512", "export_memory_stats=0", "max_malloc_fill_size=0"} ) type sanitizerType int Loading Loading
android/api_levels.go +1 −0 Original line number Diff line number Diff line Loading @@ -71,6 +71,7 @@ func getApiLevelsMap(config Config) map[string]int { "O": 26, "O-MR1": 27, "P": 28, "Q": 29, } for i, codename := range config.PlatformVersionCombinedCodenames() { apiLevelsMap[codename] = baseApiLevel + i Loading
android/neverallow.go +10 −1 Original line number Diff line number Diff line Loading @@ -51,6 +51,7 @@ func createNeverAllows() []*rule { rules := []*rule{} rules = append(rules, createTrebleRules()...) rules = append(rules, createLibcoreRules()...) rules = append(rules, createMediaRules()...) rules = append(rules, createJavaDeviceForHostRules()...) return rules } Loading @@ -70,7 +71,7 @@ func createTrebleRules() []*rule { // TODO(b/67974785): always enforce the manifest neverallow(). without("name", "libhidltransport"). without("name", "libhidltransport-impl-internal"). with("product_variables.enforce_vintf_manifest.cflags", "*"). because("manifest enforcement should be independent of ."), Loading Loading @@ -111,6 +112,14 @@ func createLibcoreRules() []*rule { return rules } func createMediaRules() []*rule { return []*rule{ neverallow(). with("libs", "updatable-media"). because("updatable-media includes private APIs. Use updatable_media_stubs instead."), } } func createJavaDeviceForHostRules() []*rule { javaDeviceForHostProjectsWhitelist := []string{ "external/guava", Loading
android/neverallow_test.go +11 −15 Original line number Diff line number Diff line Loading @@ -89,21 +89,6 @@ var neverallowTests = []struct { }, expectedError: "manifest enforcement should be independent", }, { name: "libhidltransport enforce_vintf_manifest.cflags", fs: map[string][]byte{ "Blueprints": []byte(` cc_library { name: "libhidltransport", product_variables: { enforce_vintf_manifest: { cflags: ["-DSHOULD_NOT_EXIST"], }, }, }`), }, expectedError: "", }, { name: "no treble_linker_namespaces.cflags", Loading Loading @@ -135,6 +120,17 @@ var neverallowTests = []struct { }, expectedError: "", }, { name: "dependency on updatable-media", fs: map[string][]byte{ "Blueprints": []byte(` java_library { name: "needs_updatable_media", libs: ["updatable-media"], }`), }, expectedError: "updatable-media includes private APIs. Use updatable_media_stubs instead.", }, { name: "java_device_for_host", fs: map[string][]byte{ Loading
cc/config/clang.go +5 −9 Original line number Diff line number Diff line Loading @@ -101,9 +101,8 @@ func init() { // not emit the table by default on Android since NDK still uses GNU binutils. "-faddrsig", // Make implicit fallthrough an error in the future. // -Wimplicit-fallthrough is not enabled by -Wall. "-Wimplicit-fallthrough", "-Wno-error=implicit-fallthrough", // Help catch common 32/64-bit errors. "-Werror=int-conversion", Loading Loading @@ -171,11 +170,6 @@ func init() { "-Wno-tautological-unsigned-enum-zero-compare", "-Wno-tautological-unsigned-zero-compare", // http://b/72330874 Disable -Wenum-compare until the instances detected by this new // warning are fixed. "-Wno-enum-compare", "-Wno-enum-compare-switch", // Disable c++98-specific warning since Android is not concerned with C++98 // compatibility. "-Wno-c++98-compat-extra-semi", Loading @@ -184,9 +178,11 @@ func init() { "-Wno-return-std-move-in-c++11", }, " ")) // Extra cflags for projects under external/ directory // Extra cflags for projects under external/ directory to disable warnings that are infeasible // to fix in all the external projects and their upstream repos. pctx.StaticVariable("ClangExtraExternalCflags", strings.Join([]string{ // TODO(yikong): Move -Wno flags here "-Wno-enum-compare", "-Wno-enum-compare-switch", // http://b/72331524 Allow null pointer arithmetic until the instances detected by // this new warning are fixed. Loading
cc/sanitize.go +2 −1 Original line number Diff line number Diff line Loading @@ -58,7 +58,8 @@ var ( minimalRuntimeFlags = []string{"-fsanitize-minimal-runtime", "-fno-sanitize-trap=integer,undefined", "-fno-sanitize-recover=integer,undefined"} hwasanGlobalOptions = []string{"heap_history_size=1023,stack_history_size=512"} hwasanGlobalOptions = []string{"heap_history_size=1023", "stack_history_size=512", "export_memory_stats=0", "max_malloc_fill_size=0"} ) type sanitizerType int Loading