Group needed libraries together to solve the cyclic dependence
between libc, libc_nomalloc and libgcc. When building with upcoming
arm-linux-androideabi toolchain, Symbol raise is needed by libgcc.a
and defined by libc.a or libc_nomalloc.a.which.

This patch groups libgc.a, libc_nomalloc.a and libgcc.a together, which is
a minimal group to solve this problem.

Change-Id: I27ed78c495dc53c1db7b302da8704f5e478ad893
diff --git a/core/combo/TARGET_linux-arm.mk b/core/combo/TARGET_linux-arm.mk
index dec2388..98bb00d 100644
--- a/core/combo/TARGET_linux-arm.mk
+++ b/core/combo/TARGET_linux-arm.mk
@@ -278,8 +278,12 @@
 	$(TARGET_GLOBAL_LDFLAGS) \
 	$(PRIVATE_LDFLAGS) \
 	$(PRIVATE_ALL_OBJECTS) \
-	$(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \
+	$(call normalize-target-libraries,$(filter-out %libc_nomalloc.a,$(filter-out %libc.a,$(PRIVATE_ALL_STATIC_LIBRARIES)))) \
+	-Wl,--start-group \
+	$(call normalize-target-libraries,$(filter %libc.a,$(PRIVATE_ALL_STATIC_LIBRARIES))) \
+	$(call normalize-target-libraries,$(filter %libc_nomalloc.a,$(PRIVATE_ALL_STATIC_LIBRARIES))) \
 	$(TARGET_FDO_LIB) \
 	$(TARGET_LIBGCC) \
+	-Wl,--end-group \
 	$(TARGET_CRTEND_O)
 endef