Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9582159c authored by Jooyung Han's avatar Jooyung Han
Browse files

Generate vendor specific STUB_LIBRARIES

When generating vendor/etc/linker.config.pb, STUB_LIBRARIES was used.
Because it lists *all* libraries with stubs regardless of its
install location (vendor or system), using it for vendor
linker.config.pb doesn't make sense. Instead, use vendor-specific
STUB_LIBRARIES, which is named SOONG_STUB_VENDOR_LIBRARIES.

Bug: 313806237
Test: m (aosp_cf_x86_64_phone)
Test: $OUT/vendor/etc/linker.config.pb not listing libz.so
Change-Id: Icd0aaf92d9630c07f58c4739a9f0ac713516db43
parent 85707de8
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ func init() {

type stubLibraries struct {
	stubLibraryMap       map[string]bool
	stubVendorLibraryMap map[string]bool

	apiListCoverageXmlPaths []string
}
@@ -54,6 +55,9 @@ func (s *stubLibraries) GenerateBuildActions(ctx android.SingletonContext) {
			if IsStubTarget(m) {
				if name := getInstalledFileName(m); name != "" {
					s.stubLibraryMap[name] = true
					if m.InVendor() {
						s.stubVendorLibraryMap[name] = true
					}
				}
			}
			if m.library != nil {
@@ -68,12 +72,14 @@ func (s *stubLibraries) GenerateBuildActions(ctx android.SingletonContext) {
func stubLibrariesSingleton() android.Singleton {
	return &stubLibraries{
		stubLibraryMap:       make(map[string]bool),
		stubVendorLibraryMap: make(map[string]bool),
	}
}

func (s *stubLibraries) MakeVars(ctx android.MakeVarsContext) {
	// Convert stub library file names into Makefile variable.
	ctx.Strict("STUB_LIBRARIES", strings.Join(android.SortedKeys(s.stubLibraryMap), " "))
	ctx.Strict("SOONG_STUB_VENDOR_LIBRARIES", strings.Join(android.SortedKeys(s.stubVendorLibraryMap), " "))

	// Export the list of API XML files to Make.
	sort.Strings(s.apiListCoverageXmlPaths)