From e508169caf2a9c6d83b5d758023ed1d8f3b5d03e Mon Sep 17 00:00:00 2001 From: Ivan Lozano Date: Fri, 11 May 2018 14:09:36 -0700 Subject: [PATCH] Don't export UBSan minimal runtime symbols. When linking in the UBSan minimal runtime, don't export the symbols. This was resulting in an edge case where symbols were sometimes undefined at runtime on address sanitized builds if static library dependencies were integer overflow sanitized. Bug: 78766744 Test: readelf on libraries show either inclusion of the shared library or no undefined symbols related to the minimal runtime. Change-Id: I4382cc72baefd7fa96cd83e8349e82f7b083f5aa --- core/config_sanitizers.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/core/config_sanitizers.mk b/core/config_sanitizers.mk index aa591ecda8..1363c8d27d 100644 --- a/core/config_sanitizers.mk +++ b/core/config_sanitizers.mk @@ -345,6 +345,7 @@ ifeq ($(LOCAL_IS_HOST_MODULE)$(LOCAL_IS_AUX_MODULE),) ifeq ($(filter STATIC_LIBRARIES,$(LOCAL_MODULE_CLASS)),) ifndef LOCAL_SDK_VERSION my_static_libraries += $($(LOCAL_2ND_ARCH_VAR_PREFIX)UBSAN_MINIMAL_RUNTIME_LIBRARY) + my_ldflags += -Wl,--exclude-libs,$($(LOCAL_2ND_ARCH_VAR_PREFIX)UBSAN_MINIMAL_RUNTIME_LIBRARY).a endif endif ifneq ($(filter unsigned-integer-overflow signed-integer-overflow integer,$(my_sanitize)),)