Fix building static linux binaries
BUILD_HOST_static has been broken because I was stripping -Wl,--start-group/-Wl,--end-group into a separate set of ldflags instead of keeping them wrapped around some of the ldlibs. So don't pass some of the build system flags through the ldlibs checker. Bug: 30898128 Change-Id: I332b42679695cdc5da3cb0036290b6a3544699c0
This commit is contained in:
@@ -1675,6 +1675,10 @@ ifneq ($(my_bad_ldlibs),)
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# my_cxx_ldlibs may contain linker flags need to wrap certain libraries
|
||||||
|
# (start-group/end-group), so append after the check above.
|
||||||
|
my_ldlibs += $(my_cxx_ldlibs)
|
||||||
|
|
||||||
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_YACCFLAGS := $(LOCAL_YACCFLAGS)
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_YACCFLAGS := $(LOCAL_YACCFLAGS)
|
||||||
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_ASFLAGS := $(my_asflags)
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_ASFLAGS := $(my_asflags)
|
||||||
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_CONLYFLAGS := $(my_conlyflags)
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_CONLYFLAGS := $(my_conlyflags)
|
||||||
|
@@ -70,6 +70,7 @@ else
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
my_cxx_ldlibs :=
|
||||||
ifneq ($(filter $(my_cxx_stl),libc++ libc++_static),)
|
ifneq ($(filter $(my_cxx_stl),libc++ libc++_static),)
|
||||||
my_cflags += -D_USING_LIBCXX
|
my_cflags += -D_USING_LIBCXX
|
||||||
|
|
||||||
@@ -89,7 +90,7 @@ ifneq ($(filter $(my_cxx_stl),libc++ libc++_static),)
|
|||||||
my_cppflags += -nostdinc++
|
my_cppflags += -nostdinc++
|
||||||
my_ldflags += -nodefaultlibs
|
my_ldflags += -nodefaultlibs
|
||||||
my_ldlibs += -lpthread -lm
|
my_ldlibs += -lpthread -lm
|
||||||
my_ldlibs += $($($(my_prefix)OS)_$(my_link_type)_gcclibs)
|
my_cxx_ldlibs += $($($(my_prefix)OS)_$(my_link_type)_gcclibs)
|
||||||
else
|
else
|
||||||
ifeq (arm,$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH))
|
ifeq (arm,$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH))
|
||||||
my_static_libraries += libunwind_llvm
|
my_static_libraries += libunwind_llvm
|
||||||
@@ -114,7 +115,7 @@ else ifeq ($(my_cxx_stl),none)
|
|||||||
ifdef LOCAL_IS_HOST_MODULE
|
ifdef LOCAL_IS_HOST_MODULE
|
||||||
my_cppflags += -nostdinc++
|
my_cppflags += -nostdinc++
|
||||||
my_ldflags += -nodefaultlibs
|
my_ldflags += -nodefaultlibs
|
||||||
my_ldlibs += $($($(my_prefix)OS)_$(my_link_type)_gcclibs)
|
my_cxx_ldlibs += $($($(my_prefix)OS)_$(my_link_type)_gcclibs)
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
$(error $(LOCAL_PATH): $(LOCAL_MODULE): $(my_cxx_stl) is not a supported STL.)
|
$(error $(LOCAL_PATH): $(LOCAL_MODULE): $(my_cxx_stl) is not a supported STL.)
|
||||||
|
Reference in New Issue
Block a user