Merge changes I67893f8c,I5f29258e into main
* changes:
Ensure that filesystem module can track modules with prefer32
bpf modules can be included in filesystem modules
diff --git a/bpf/bpf.go b/bpf/bpf.go
index e1b512f..38fbd88 100644
--- a/bpf/bpf.go
+++ b/bpf/bpf.go
@@ -203,6 +203,15 @@
}
}
+
+ installDir := android.PathForModuleInstall(ctx, "etc", "bpf")
+ if len(bpf.properties.Sub_dir) > 0 {
+ installDir = installDir.Join(ctx, bpf.properties.Sub_dir)
+ }
+ for _, obj := range bpf.objs {
+ ctx.PackageFile(installDir, obj.Base(), obj)
+ }
+
android.SetProvider(ctx, blueprint.SrcsFileProviderKey, blueprint.SrcsFileProviderData{SrcPaths: srcs.Strings()})
}
diff --git a/filesystem/Android.bp b/filesystem/Android.bp
index 07d57c9..cdf6682 100644
--- a/filesystem/Android.bp
+++ b/filesystem/Android.bp
@@ -9,6 +9,7 @@
"blueprint",
"soong",
"soong-android",
+ "soong-bpf", // for testing
"soong-linkerconfig",
],
srcs: [
diff --git a/filesystem/filesystem_test.go b/filesystem/filesystem_test.go
index aef4756..c448105 100644
--- a/filesystem/filesystem_test.go
+++ b/filesystem/filesystem_test.go
@@ -19,6 +19,7 @@
"testing"
"android/soong/android"
+ "android/soong/bpf"
"android/soong/cc"
"android/soong/etc"
@@ -31,6 +32,7 @@
var fixture = android.GroupFixturePreparers(
android.PrepareForIntegrationTestWithAndroid,
+ bpf.PrepareForTestWithBpf,
etc.PrepareForTestWithPrebuiltEtc,
cc.PrepareForIntegrationTestWithCc,
PrepareForTestWithFilesystemBuildComponents,
@@ -40,11 +42,55 @@
result := fixture.RunTestWithBp(t, `
android_filesystem {
name: "myfilesystem",
+ multilib: {
+ common: {
+ deps: [
+ "bpf.o",
+ ],
+ },
+ lib32: {
+ deps: [
+ "foo",
+ "libbar",
+ ],
+ },
+ lib64: {
+ deps: [
+ "libbar",
+ ],
+ },
+ },
+ compile_multilib: "both",
+ }
+
+ bpf {
+ name: "bpf.o",
+ srcs: ["bpf.c"],
+ }
+
+ cc_binary {
+ name: "foo",
+ compile_multilib: "prefer32",
+ }
+
+ cc_library {
+ name: "libbar",
}
`)
// produces "myfilesystem.img"
result.ModuleForTests("myfilesystem", "android_common").Output("myfilesystem.img")
+
+ fs := result.ModuleForTests("myfilesystem", "android_common").Module().(*filesystem)
+ expected := []string{
+ "bin/foo",
+ "lib/libbar.so",
+ "lib64/libbar.so",
+ "etc/bpf/bpf.o",
+ }
+ for _, e := range expected {
+ android.AssertStringListContains(t, "missing entry", fs.entries, e)
+ }
}
func TestFileSystemFillsLinkerConfigWithStubLibs(t *testing.T) {