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
diff --git a/core/binary.mk b/core/binary.mk
index 21a6019..a35d7e2 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -1675,6 +1675,10 @@
 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_ASFLAGS := $(my_asflags)
 $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_CONLYFLAGS := $(my_conlyflags)