From 3d5c6791bc4cbd32106fb69660b61290c02a4c4b Mon Sep 17 00:00:00 2001 From: Hsin-Yi Chen Date: Mon, 22 Apr 2024 11:47:57 +0800 Subject: [PATCH] Ensure opt-in platform ABI dumps are configured with ref_dump_dirs Test: make Bug: 323447559 Change-Id: I8eaa38970c81c71b7473bdb9e77dfe9b49a93c92 --- cc/library.go | 5 +++++ cc/sabi.go | 6 ++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cc/library.go b/cc/library.go index 12ecc131a..895b1993c 100644 --- a/cc/library.go +++ b/cc/library.go @@ -1490,6 +1490,11 @@ func (library *libraryDecorator) linkSAbiDumpFiles(ctx ModuleContext, deps PathD fileName, nameExt, isLlndk) } } + // Ensure that a module tagged with only platformLsdumpTag has ref_dump_dirs. + // Android.bp in vendor projects should be cleaned up before this is enforced for vendorLsdumpTag and productLsdumpTag. + if len(headerAbiChecker.Ref_dump_dirs) == 0 && len(tags) == 1 && tags[0] == platformLsdumpTag { + ctx.ModuleErrorf("header_abi_checker is explicitly enabled, but no ref_dump_dirs are specified.") + } // Check against the opt-in reference dumps. for i, optInDumpDir := range headerAbiChecker.Ref_dump_dirs { optInDumpDirPath := android.PathForModuleSrc(ctx, optInDumpDir) diff --git a/cc/sabi.go b/cc/sabi.go index edd9cfe80..64eab4160 100644 --- a/cc/sabi.go +++ b/cc/sabi.go @@ -43,8 +43,6 @@ func (tag *lsdumpTag) dirName() string { return "platform" case llndkLsdumpTag: return "vndk" - case platformLsdumpTag: - return "platform" default: return "" } @@ -134,10 +132,10 @@ func classifySourceAbiDump(ctx android.BaseModuleContext) []lsdumpTag { if m.isImplementationForLLNDKPublic() { result = append(result, llndkLsdumpTag) } - // APEX and opt-in platform dumps are placed in the same directory. if m.library.hasStubsVariants() { result = append(result, apexLsdumpTag) - } else if headerAbiChecker.enabled() { + } + if headerAbiChecker.enabled() { result = append(result, platformLsdumpTag) } } else if headerAbiChecker.enabled() {