[MIPS] Do not use compact branches until GDB supports them

GDB does not yet have support for compact branches, and is unable to
set a breakpoint on them. Turn compact branch generation off, until
GDB is fixed.

Change-Id: Ie7d6fb891e9934f8fc645fe9cf8f706be15a5f77
diff --git a/core/combo/TARGET_linux-mips64.mk b/core/combo/TARGET_linux-mips64.mk
index 1116f46..f01cdd1 100644
--- a/core/combo/TARGET_linux-mips64.mk
+++ b/core/combo/TARGET_linux-mips64.mk
@@ -79,6 +79,15 @@
   TARGET_mips_CFLAGS += -fno-omit-frame-pointer
 endif
 
+# For mips r6 (both 32bit and 64bit), GDB cannot stop on a breakpoint
+# if it is set on a compact branch. Turn generation of compact
+# branches off, to allow GDB to work properly.
+# Note: JIC instruction is not affected by this flag.
+# TODO: Remove this after GDB is fixed.
+ifeq ($(TARGET_ARCH),mips64)
+TARGET_mips_CFLAGS += -mcompact-branches=never
+endif
+
 android_config_h := $(call select-android-config-h,linux-mips64)
 
 TARGET_GLOBAL_CFLAGS += \