From 062e30b422e9055ba25bdc1655482358bfadd09a Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Tue, 24 May 2016 13:06:07 -0700 Subject: [PATCH] Error on external includes To make the build hermetic, all include files should be located within the source tree (or generated as output). There was an Android.mk that was adding /usr/include to its include path. Change-Id: I4c40b908314239c8239c7835d592e409248a3150 --- core/binary.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/binary.mk b/core/binary.mk index 614b8aa8f..2bf185062 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -1228,6 +1228,11 @@ ifndef LOCAL_SDK_VERSION my_c_includes += $(JNI_H_INCLUDE) endif +my_outside_includes := $(filter-out $(OUT_DIR)/%,$(filter /%,$(my_c_includes))) +ifneq ($(my_outside_includes),) +$(error $(LOCAL_MODULE_MAKEFILE): $(LOCAL_MODULE): C_INCLUDES must be under the source or output directories: $(my_outside_includes)) +endif + # all_objects includes gen_o_objects which were part of LOCAL_GENERATED_SOURCES; # use normal_objects here to avoid creating circular dependencies. This assumes # that custom build rules which generate .o files don't consume other generated