Hi,

Recently I used --target=nds32be-elf to configure nds32 gcc,
it seems that the big endian is not set as default.

In the config.gcc, I notice that target_cpu_default is defined as:

  nds32le-*-*)
        target_cpu_default="0"

  nds32be-*-*)
        target_cpu_default="0|MASK_BIG_ENDIAN"

But the TARGET_CPU_DEFAULT is not added into TARGET_DEFAULT_TARGET_FLAGS so that
MASK_BIG_ENDIAN is not enabled for nds32be-elf.

The following is the patch to fix this issue.  Tested on nds32be-elf.

OK to apply?

Index: common/config/nds32/nds32-common.c
===================================================================
--- common/config/nds32/nds32-common.c  (revision 205880)
+++ common/config/nds32/nds32-common.c  (working copy)
@@ -93,7 +93,8 @@
      TARGET_CMOV     : Generate conditional move instruction.  */
 #undef TARGET_DEFAULT_TARGET_FLAGS
 #define TARGET_DEFAULT_TARGET_FLAGS            \
-  (MASK_GP_DIRECT                              \
+  (TARGET_CPU_DEFAULT                          \
+   | MASK_GP_DIRECT                            \
    | MASK_16_BIT                               \
    | MASK_PERF_EXT                             \
    | MASK_CMOV)
Index: ChangeLog
===================================================================
--- ChangeLog   (revision 205880)
+++ ChangeLog   (working copy)
@@ -1,3 +1,8 @@
+2013-12-11  Monk Chiang <sh.chian...@gmail.com>
+
+       * common/config/nds32/nds32-common.c (TARGET_DEFAULT_TARGET_FLAGS):
+       Redefine.
+
 2013-12-11  Bin Cheng  <bin.ch...@arm.com>

        Reverted:

Monk

Reply via email to