Patchwork [committed,SH] Fix build failure on sh-linux

login
register
mail settings
Submitter Kaz Kojima
Date March 14, 2013, 3:03 a.m.
Message ID <20130314.120304.196892858.kkojima@rr.iij4u.or.jp>
Download mbox | patch
Permalink /patch/227428/
State New
Headers show

Comments

Kaz Kojima - March 14, 2013, 3:03 a.m.
Hi,

The attached patch is to fix build failure on sh-linux caused
with the recent Oleg's changes.  Committed on trunk.

Regards,
	kaz
--
2013-03-14  Kaz Kojima  <kkojima@gcc.gnu.org>

	* config/sh/linux.h (TARGET_DEFAULT): Remove MASK_USERMODE.
	(SUBTARGET_OVERRIDE_OPTIONS): Set TARGET_USERMODE as default.
	* config/sh/netbsd-elf.h (TARGET_DEFAULT): Remove MASK_USERMODE.
	(SUBTARGET_OVERRIDE_OPTIONS): New.

Patch

diff -up ORIG/trunk/gcc/config/sh/linux.h trunk/gcc/config/sh/linux.h
--- ORIG/trunk/gcc/config/sh/linux.h	2013-02-04 09:32:36.000000000 +0900
+++ trunk/gcc/config/sh/linux.h	2013-03-14 11:25:41.000000000 +0900
@@ -39,8 +39,7 @@  along with GCC; see the file COPYING3.  
 
 #undef TARGET_DEFAULT
 #define TARGET_DEFAULT \
-  (TARGET_CPU_DEFAULT | MASK_USERMODE | TARGET_ENDIAN_DEFAULT \
-   | TARGET_OPT_DEFAULT)
+  (TARGET_CPU_DEFAULT | TARGET_ENDIAN_DEFAULT | TARGET_OPT_DEFAULT)
 
 #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
 
@@ -146,5 +145,8 @@  along with GCC; see the file COPYING3.  
 	  else if (TARGET_SH1)						\
 	    sh_atomic_model_str = "soft-imask";				\
 	}								\
+      /* Set -musermode if it hasn't been specified.  */		\
+      if (global_options_set.x_TARGET_USERMODE == 0)			\
+	TARGET_USERMODE = true;						\
     }									\
   while (0)
diff -up ORIG/trunk/gcc/config/sh/netbsd-elf.h trunk/gcc/config/sh/netbsd-elf.h
--- ORIG/trunk/gcc/config/sh/netbsd-elf.h	2013-02-04 09:32:37.000000000 +0900
+++ trunk/gcc/config/sh/netbsd-elf.h	2013-03-14 11:25:11.000000000 +0900
@@ -58,7 +58,7 @@  along with GCC; see the file COPYING3.  
 
 #undef TARGET_DEFAULT
 #define TARGET_DEFAULT \
-  (TARGET_CPU_DEFAULT | MASK_USERMODE | TARGET_ENDIAN_DEFAULT)
+  (TARGET_CPU_DEFAULT | TARGET_ENDIAN_DEFAULT)
 
 /* Define because we use the label and we do not need them.  */
 #define NO_PROFILE_COUNTERS 1
@@ -94,3 +94,13 @@  while (0)
 #define SH_DIV_STRATEGY_DEFAULT SH_DIV_CALL2
 #undef SH_DIV_STR_FOR_SIZE
 #define SH_DIV_STR_FOR_SIZE "call2"
+
+#undef SUBTARGET_OVERRIDE_OPTIONS
+#define SUBTARGET_OVERRIDE_OPTIONS					\
+  do									\
+    {									\
+      /* Set -musermode if it hasn't been specified.  */		\
+      if (global_options_set.x_TARGET_USERMODE == 0)			\
+	TARGET_USERMODE = true;						\
+    }									\
+  while (0)