From 063ef3308992ce67c9a72c351978c3b7d2346e94 Mon Sep 17 00:00:00 2001 From: Nikola Veljkovic Date: Mon, 25 May 2015 11:16:10 +0200 Subject: [PATCH] [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 --- core/clang/mips.mk | 3 +++ core/clang/mips64.mk | 3 +++ core/combo/TARGET_linux-mips.mk | 9 +++++++++ core/combo/TARGET_linux-mips64.mk | 9 +++++++++ 4 files changed, 24 insertions(+) diff --git a/core/clang/mips.mk b/core/clang/mips.mk index 70832a33d9..b2ea579ba2 100644 --- a/core/clang/mips.mk +++ b/core/clang/mips.mk @@ -14,6 +14,9 @@ CLANG_CONFIG_mips_UNKNOWN_CFLAGS := \ -msynci \ -mno-fused-madd +# Temporary workaround until GDB supports compact branches. +CLANG_CONFIG_mips_UNKNOWN_CFLAGS += -mcompact-branches=never + # Temporary workaround for Mips clang++ problem, creates # relocated ptrs in read-only pic .gcc_exception_table; # permanent fix pending at http://reviews.llvm.org/D9669 diff --git a/core/clang/mips64.mk b/core/clang/mips64.mk index ba9c1d14b5..0a904283fe 100644 --- a/core/clang/mips64.mk +++ b/core/clang/mips64.mk @@ -14,6 +14,9 @@ CLANG_CONFIG_mips64_UNKNOWN_CFLAGS := \ -msynci \ -mno-fused-madd +# Temporary workaround until GDB supports compact branches. +CLANG_CONFIG_mips64_UNKNOWN_CFLAGS += -mcompact-branches=never + # Temporary workaround for Mips clang++ problem creating # relocated ptrs in read-only pic .gcc_exception_table; # permanent fix pending at http://reviews.llvm.org/D9669 diff --git a/core/combo/TARGET_linux-mips.mk b/core/combo/TARGET_linux-mips.mk index 962aa4573c..87a6144416 100644 --- a/core/combo/TARGET_linux-mips.mk +++ b/core/combo/TARGET_linux-mips.mk @@ -79,6 +79,15 @@ ifeq ($(FORCE_MIPS_DEBUGGING),true) 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-mips) $(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS += \ diff --git a/core/combo/TARGET_linux-mips64.mk b/core/combo/TARGET_linux-mips64.mk index 1116f46eb9..f01cdd1c03 100644 --- a/core/combo/TARGET_linux-mips64.mk +++ b/core/combo/TARGET_linux-mips64.mk @@ -79,6 +79,15 @@ ifeq ($(FORCE_MIPS_DEBUGGING),true) 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 += \