[PATCH/m68k] Move feature defines from config headers into config.gcc

Gunther Nikl gni@gecko.de
Fri Nov 28 14:13:00 GMT 2003


Hello!

Recently m68k.c was converted from "#ifdef MOTOROLA" to "if (MOTOROLA)".
This patch is a prerequisite to convert m68k.md in the same fashion.
It deletes MOTOROLA and USE_GAS defines from m68k/netbsd-elf.h. The
same defines are removed from m68k/m68kelf.h together with an undef of
SGS_CMP_ORDER. It seems undefing SGS_CMP_ORDER is a leftover and since
its only defined in hp320base.h (which is only used by m68k-hpux targets)
it can safely be deleted. Then the MOTOROLA define is deleted from
m68k/rtemself.h where it was superflous anyway since the symbol was already
defined by m68k/m68kelf.h which m68k-rtems included before the rtems header
(interestingly, defining MOTOROLA again didn't cause a redefinition warning,
probably because both defines agreed).
I verified that this patch doesn't change the behaviour by compiling
m68k-elf, m68k-netbsdelf and m68k-rtems with and without this patch
and then comparing all objects+cc1 which showed no difference.
The only difference I found was within collect2.o which with this patch
installed says "Motorola syntax". Before it would say "MIT syntax" because
TARGET_VERSION is set in m68k/m68k.h which is included before m68k/m68kelf.h.
Thus this patch could even be considered beeing a bug fix.

Gunther

2003-11-28  Gunther Nikl  <gni@gecko.de>

	* config.gcc (m68020-*-elf*, m68k-*-elf*, m68010-*-netbsdelf*,
	m68k*-*-netbsdelf*, m68k-*-rtems*): Add tm_defines containing
	MOTOROLA and USE_GAS.
	* config/m68k/rtemself.h (MOTOROLA): Delete.
	* config/m68k/netbsd-elf.h (MOTOROLA, USE_GAS): Delete.
	* config/m68k/m68kelf.h (MOTOROLA, USE_GAS, SGS_CMP_ORDER): Delete.

-- cut1 --
--- config.gcc_	Mon Nov 24 10:35:27 2003
+++ config.gcc	Thu Nov 27 16:07:40 2003
@@ -1324,12 +1324,14 @@
 	;;
 m68020-*-elf* | m68k-*-elf*)
 	tm_file="m68k/m68k.h m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h"
+	tm_defines="MOTOROLA USE_GAS"
 	tmake_file=m68k/t-m68kelf
 	extra_parts="crtbegin.o crtend.o"
 	use_fixproto=yes
 	;;
 m68010-*-netbsdelf* | m68k*-*-netbsdelf*)
 	tm_file="${tm_file} dbxelf.h elfos.h netbsd.h netbsd-elf.h m68k/netbsd-elf.h"
+	tm_defines="MOTOROLA USE_GAS"
 	case ${target} in
 	m68010*)
 		target_cpu_default="0"
@@ -1376,6 +1378,7 @@
 m68k-*-rtems*)
 	tmake_file="m68k/t-m68kbare m68k/t-crtstuff t-rtems m68k/t-rtems"
 	tm_file="m68k/m68k.h m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h m68k/rtemself.h rtems.h"
+	tm_defines="MOTOROLA USE_GAS"
 	extra_parts="crtbegin.o crtend.o"
 	;;
 mcore-*-elf)
-- cut1 --

-- cut2 --
diff -up .old/m68kelf.h .new/m68kelf.h
--- .old/m68kelf.h	Mon Sep 29 10:40:40 2003
+++ .new/m68kelf.h	Wed Nov 26 16:34:49 2003
@@ -22,13 +22,6 @@ along with GCC; see the file COPYING.  I
 the Free Software Foundation, 59 Temple Place - Suite 330,
 Boston, MA 02111-1307, USA.  */
 
-/* These are necessary for -fpic/-fPIC to work correctly.  */
-#ifndef MOTOROLA
-#define MOTOROLA                /* Use MOTOROLA syntax.  */
-#endif
-#ifndef  USE_GAS  /* forces jsbr instead of jsr.  */
-#define  USE_GAS
-#endif
 
 #ifndef SWBEG_ASM_OP
 #define SWBEG_ASM_OP "\t.swbeg\t"
@@ -245,8 +238,6 @@ extern int switch_table_difference_label
 #define ASM_OUTPUT_BEFORE_CASE_LABEL(FILE,PREFIX,NUM,TABLE)		\
   fprintf ((FILE), "%s&%d\n", SWBEG_ASM_OP, XVECLEN (PATTERN (TABLE), 1));
 /* end of stuff from m68kv4.h */
-
-#undef SGS_CMP_ORDER
 
 #undef ENDFILE_SPEC
 #define ENDFILE_SPEC "crtend.o%s"
diff -up .old/netbsd-elf.h .new/netbsd-elf.h
--- .old/netbsd-elf.h	Mon Sep 29 10:40:40 2003
+++ .new/netbsd-elf.h	Wed Nov 26 16:20:45 2003
@@ -143,9 +143,6 @@ while (0)
    Here is a bunch of stuff lifted from m68kelf.h.  We don't use that
    file directly, because it has a lot of baggage we don't want.  */
 
-#define MOTOROLA	/* Use Motorola syntax */
-#define USE_GAS		/* But GAS wants jbsr instead of jsr */
-
 
 /* The prefix for register names.  Note that REGISTER_NAMES
    is supposed to include this prefix.  Also note that this is NOT an
diff -up .old/rtemself.h .new/rtemself.h
--- .old/rtemself.h	Mon Sep 29 10:40:40 2003
+++ .new/rtemself.h	Wed Nov 26 16:10:33 2003
@@ -20,8 +20,6 @@ the Free Software Foundation, 59 Temple 
 Boston, MA 02111-1307, USA.  */
 
 
-#define MOTOROLA       /* Use Motorola syntax rather than MIT.  */
-
 /* Target OS builtins.  */
 #undef TARGET_OS_CPP_BUILTINS	/* Defined in m68kemb.h.  */
 #define TARGET_OS_CPP_BUILTINS()		\
-- cut2 --



More information about the Gcc-patches mailing list