diff options
-rw-r--r-- | android/module.go | 1 | ||||
-rw-r--r-- | android/path_properties.go | 2 | ||||
-rw-r--r-- | android/path_properties_test.go | 27 | ||||
-rw-r--r-- | android/sh_binary.go | 37 | ||||
-rw-r--r-- | androidmk/cmd/androidmk/android.go | 2 | ||||
-rw-r--r-- | androidmk/cmd/androidmk/androidmk_test.go | 16 | ||||
-rw-r--r-- | cc/binary.go | 4 | ||||
-rw-r--r-- | cc/config/clang.go | 4 | ||||
-rw-r--r-- | cc/config/global.go | 4 | ||||
-rw-r--r-- | cc/library.go | 4 | ||||
-rw-r--r-- | cc/lto.go | 3 |
11 files changed, 92 insertions, 12 deletions
diff --git a/android/module.go b/android/module.go index c5252c8b0..9a69a2631 100644 --- a/android/module.go +++ b/android/module.go @@ -383,6 +383,7 @@ func InitAndroidModule(m Module) { &base.nameProperties, &base.commonProperties, &base.variableProperties) + base.generalProperties = m.GetProperties() base.customizableProperties = m.GetProperties() } diff --git a/android/path_properties.go b/android/path_properties.go index 5d8970927..1a12290d3 100644 --- a/android/path_properties.go +++ b/android/path_properties.go @@ -33,7 +33,7 @@ func pathDepsMutator(ctx BottomUpMutatorContext) { return } - props := m.base().customizableProperties + props := m.base().generalProperties for _, ps := range props { pathProperties := pathPropertiesForPropertyStruct(ctx, ps) diff --git a/android/path_properties_test.go b/android/path_properties_test.go index 6471a3cf5..ecc2d2122 100644 --- a/android/path_properties_test.go +++ b/android/path_properties_test.go @@ -25,7 +25,7 @@ type pathDepsMutatorTestModule struct { ModuleBase props struct { Foo string `android:"path"` - Bar []string `android:"path"` + Bar []string `android:"path,arch_variant"` Baz *string `android:"path"` Qux string } @@ -36,7 +36,7 @@ type pathDepsMutatorTestModule struct { func pathDepsMutatorTestModuleFactory() Module { module := &pathDepsMutatorTestModule{} module.AddProperties(&module.props) - InitAndroidModule(module) + InitAndroidArchModule(module, DeviceSupported, MultilibBoth) return module } @@ -64,6 +64,23 @@ func TestPathDepsMutator(t *testing.T) { }`, deps: []string{"a", "b", "c"}, }, + { + name: "arch variant", + bp: ` + test { + name: "foo", + arch: { + arm64: { + bar: [":a"], + }, + arm: { + bar: [":b"], + }, + }, + bar: [":c"], + }`, + deps: []string{"c", "a"}, + }, } buildDir, err := ioutil.TempDir("", "soong_path_properties_test") @@ -74,8 +91,8 @@ func TestPathDepsMutator(t *testing.T) { for _, test := range tests { t.Run(test.name, func(t *testing.T) { - config := TestConfig(buildDir, nil) - ctx := NewTestContext() + config := TestArchConfig(buildDir, nil) + ctx := NewTestArchContext() ctx.RegisterModuleType("test", ModuleFactoryAdaptor(pathDepsMutatorTestModuleFactory)) ctx.RegisterModuleType("filegroup", ModuleFactoryAdaptor(FileGroupFactory)) @@ -110,7 +127,7 @@ func TestPathDepsMutator(t *testing.T) { _, errs = ctx.PrepareBuildActions(config) FailIfErrored(t, errs) - m := ctx.ModuleForTests("foo", "").Module().(*pathDepsMutatorTestModule) + m := ctx.ModuleForTests("foo", "android_arm64_armv8-a").Module().(*pathDepsMutatorTestModule) if g, w := m.sourceDeps, test.deps; !reflect.DeepEqual(g, w) { t.Errorf("want deps %q, got %q", w, g) diff --git a/android/sh_binary.go b/android/sh_binary.go index 52c5a9a33..8bb351783 100644 --- a/android/sh_binary.go +++ b/android/sh_binary.go @@ -17,6 +17,7 @@ package android import ( "fmt" "io" + "strings" ) // sh_binary is for shell scripts (and batch files) that are installed as @@ -28,6 +29,7 @@ import ( func init() { RegisterModuleType("sh_binary", ShBinaryFactory) RegisterModuleType("sh_binary_host", ShBinaryHostFactory) + RegisterModuleType("sh_test", ShTestFactory) } type shBinaryProperties struct { @@ -48,6 +50,16 @@ type shBinaryProperties struct { Installable *bool } +type TestProperties struct { + // list of compatibility suites (for example "cts", "vts") that the module should be + // installed into. + Test_suites []string `android:"arch_variant"` + + // the name of the test configuration (for example "AndroidTest.xml") that should be + // installed with the module. + Test_config *string `android:"arch_variant"` +} + type ShBinary struct { ModuleBase @@ -57,6 +69,12 @@ type ShBinary struct { outputFilePath OutputPath } +type ShTest struct { + ShBinary + + testProperties TestProperties +} + func (s *ShBinary) DepsMutator(ctx BottomUpMutatorContext) { if s.properties.Src == nil { ctx.PropertyErrorf("src", "missing prebuilt source file") @@ -119,6 +137,16 @@ func (s *ShBinary) AndroidMk() AndroidMkData { } } +func (s *ShTest) AndroidMk() AndroidMkData { + data := s.ShBinary.AndroidMk() + data.Extra = append(data.Extra, func(w io.Writer, outputFile Path) { + fmt.Fprintln(w, "LOCAL_COMPATIBILITY_SUITE :=", + strings.Join(s.testProperties.Test_suites, " ")) + fmt.Fprintln(w, "LOCAL_TEST_CONFIG :=", String(s.testProperties.Test_config)) + }) + return data +} + func InitShBinaryModule(s *ShBinary) { s.AddProperties(&s.properties) } @@ -140,3 +168,12 @@ func ShBinaryHostFactory() Module { InitAndroidArchModule(module, HostSupported, MultilibFirst) return module } + +func ShTestFactory() Module { + module := &ShTest{} + InitShBinaryModule(&module.ShBinary) + module.AddProperties(&module.testProperties) + + InitAndroidArchModule(module, HostAndDeviceSupported, MultilibFirst) + return module +} diff --git a/androidmk/cmd/androidmk/android.go b/androidmk/cmd/androidmk/android.go index 1d66ab750..9276eb5fd 100644 --- a/androidmk/cmd/androidmk/android.go +++ b/androidmk/cmd/androidmk/android.go @@ -76,6 +76,8 @@ var rewriteProperties = map[string](func(variableAssignmentContext) error){ "LOCAL_ANNOTATION_PROCESSOR_CLASSES": skip, // Soong gets the processor classes from the plugin "LOCAL_CTS_TEST_PACKAGE": skip, // Obsolete + "LOCAL_JACK_ENABLED": skip, // Obselete + "LOCAL_JACK_FLAGS": skip, // Obselete } // adds a group of properties all having the same type diff --git a/androidmk/cmd/androidmk/androidmk_test.go b/androidmk/cmd/androidmk/androidmk_test.go index 2976a0cd6..e3499d2eb 100644 --- a/androidmk/cmd/androidmk/androidmk_test.go +++ b/androidmk/cmd/androidmk/androidmk_test.go @@ -1094,6 +1094,22 @@ android_app { } `, }, + { + desc: "blah", + in: ` +include $(CLEAR_VARS) +LOCAL_MODULE := foo +LOCAL_JACK_ENABLED := incremental +LOCAL_JACK_FLAGS := --multi-dex native +include $(BUILD_PACKAGE) + `, + expected: ` +android_app { + name: "foo", + +} + `, + }, } func TestEndToEnd(t *testing.T) { diff --git a/cc/binary.go b/cc/binary.go index 995294330..cae1739b8 100644 --- a/cc/binary.go +++ b/cc/binary.go @@ -437,7 +437,9 @@ func (binary *binaryDecorator) install(ctx ModuleContext, file android.Path) { // The original path becomes a symlink to the corresponding file in the // runtime APEX. if isBionic(ctx.baseModuleName()) && ctx.Arch().Native && ctx.apexName() == "" && !ctx.inRecovery() { - binary.installSymlinkToRuntimeApex(ctx, file) + if ctx.Device() { + binary.installSymlinkToRuntimeApex(ctx, file) + } binary.baseInstaller.subDir = "bootstrap" } binary.baseInstaller.install(ctx, file) diff --git a/cc/config/clang.go b/cc/config/clang.go index 6a1c7363b..a57bbf86f 100644 --- a/cc/config/clang.go +++ b/cc/config/clang.go @@ -174,6 +174,10 @@ func init() { // Disable this warning because we don't care about behavior with older compilers. "-Wno-return-std-move-in-c++11", + + // Disable -Wstring-plus-int until the instances detected by this new warning is + // fixed. + "-Wno-string-plus-int", }, " ")) // Extra cflags for projects under external/ directory diff --git a/cc/config/global.go b/cc/config/global.go index 689b315b0..e3fab0c2a 100644 --- a/cc/config/global.go +++ b/cc/config/global.go @@ -120,8 +120,8 @@ var ( // prebuilts/clang default settings. ClangDefaultBase = "prebuilts/clang/host" - ClangDefaultVersion = "clang-r349610" - ClangDefaultShortVersion = "8.0.8" + ClangDefaultVersion = "clang-r353983" + ClangDefaultShortVersion = "9.0.1" // Directories with warnings from Android.bp files. WarningAllowedProjects = []string{ diff --git a/cc/library.go b/cc/library.go index 6404906cb..5df511294 100644 --- a/cc/library.go +++ b/cc/library.go @@ -920,7 +920,9 @@ func (library *libraryDecorator) install(ctx ModuleContext, file android.Path) { // The original path becomes a symlink to the corresponding file in the // runtime APEX. if isBionic(ctx.baseModuleName()) && !library.buildStubs() && ctx.Arch().Native && !ctx.inRecovery() { - library.installSymlinkToRuntimeApex(ctx, file) + if ctx.Device() { + library.installSymlinkToRuntimeApex(ctx, file) + } library.baseInstaller.subDir = "bootstrap" } } @@ -83,8 +83,7 @@ func (lto *lto) flags(ctx BaseModuleContext, flags Flags) Flags { if lto.LTO() { var ltoFlag string if Bool(lto.Properties.Lto.Thin) { - ltoFlag = "-flto=thin" - + ltoFlag = "-flto=thin -fsplit-lto-unit" } else { ltoFlag = "-flto" } |