From 2be559488db202d09ac6989b091b6f809d6e683b Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Mon, 3 Apr 2017 16:06:00 -0700 Subject: [PATCH] Exclude ndk stubs from notice file list There are many references to ndk stub libraries in the third party notices: out/soong/ndk/platforms/android-10/arch-arm/usr/lib/libc.so out/soong/ndk/platforms/android-10/arch-arm/usr/lib/liblog.so ... These are just stub libraries, and aren't distributed on the device. The real versions of these libraries will be distributed on the device, and already have the license information. So let Soong set LOCAL_NO_NOTICE_FILE to prevent these from appearing. Bug: 36867708 Test: Diff aosp_arm's system/etc/NOTICE.html.gz file before/after Change-Id: Ifa3693bde7d3b6b9dc7a83122f9cfa24997fac50 --- core/clear_vars.mk | 1 + core/notice_files.mk | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/core/clear_vars.mk b/core/clear_vars.mk index 72c451c9b0..257f3f91c1 100644 --- a/core/clear_vars.mk +++ b/core/clear_vars.mk @@ -156,6 +156,7 @@ LOCAL_NO_DEFAULT_COMPILER_FLAGS:= LOCAL_NO_FPIE := LOCAL_NO_LIBCOMPILER_RT:= LOCAL_NO_LIBGCC:= +LOCAL_NO_NOTICE_FILE:= LOCAL_NO_PIC:= LOCAL_NOSANITIZE:= LOCAL_NO_STANDARD_LIBRARIES:= diff --git a/core/notice_files.mk b/core/notice_files.mk index 447e59ba6d..f850ffff11 100644 --- a/core/notice_files.mk +++ b/core/notice_files.mk @@ -14,6 +14,14 @@ ifeq ($(LOCAL_MODULE_CLASS),GYP) notice_file := endif +# Soong generates stub libraries that don't need NOTICE files +ifdef LOCAL_NO_NOTICE_FILE + ifneq ($(LOCAL_MODULE_MAKEFILE),$(SOONG_ANDROID_MK)) + $(call pretty-error,LOCAL_NO_NOTICE_FILE should not be used by Android.mk files) + endif + notice_file := +endif + ifeq ($(LOCAL_MODULE_CLASS),NOTICE_FILES) # If this is a NOTICE-only module, we don't include base_rule.mk, # so my_prefix is not set at this point.