From c15103fa729a1a035fca4b0bab587a5bf10f25b1 Mon Sep 17 00:00:00 2001 From: Dmitriy Ivanov Date: Fri, 15 Aug 2014 11:30:23 -0700 Subject: [PATCH] Add compile time check for statically linked libc Bug: 17047392 (cherry picked from commit 655d6851f308ad890193787a848b003685d3df9c) Change-Id: Ia824137e690b9bca1688a7603254273a737ddcbb --- core/executable_internal.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/executable_internal.mk b/core/executable_internal.mk index 2e380b62e..3d17eb0b2 100644 --- a/core/executable_internal.mk +++ b/core/executable_internal.mk @@ -26,6 +26,13 @@ ifndef skip_build_from_source include $(BUILD_SYSTEM)/dynamic_binary.mk +# Check for statically linked libc +ifneq ($(LOCAL_FORCE_STATIC_EXECUTABLE),true) +ifneq ($(filter $(my_static_libraries),libc),) +$(error $(LOCAL_PATH): $(LOCAL_MODULE) is statically linking libc to dynamic executable, please remove libc from static libs or set LOCAL_FORCE_STATIC_EXECUTABLE := true) +endif +endif + # Define PRIVATE_ variables from global vars my_target_global_ld_dirs := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_GLOBAL_LD_DIRS) my_target_fdo_lib := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_FDO_LIB)