This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ARM fix for big endian linux-elf targets


Daniel Jacobowitz wrote:
> On Mon, Nov 14, 2005 at 09:55:28PM +0100, Sebastian Pop wrote:
> >  	case ${target} in
> > +	arm*b-*-linux*)
> > +	    tm_file="$tm_file arm/linux-elfb.h"
> > +	    ;;
> >  	arm*-*-linux-gnueabi)
> >  	    tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h"
> >  	    tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"
> 
> No, please put this after the EABI case; your patch would make
> armeb-linux-gnueabi configure as an old-ABI compiler.
> 

ouch, right!

> Bonus points for fixing the EABI case too...
> 

like this?

	* config.gcc (arm*-*-linux-gnueabi): Refine for arm*b-*: include
	linux-elfb.h.
	(arm*b-*-linux*): Added. Include linux-elfb.h.
	* config/arm/linux-elfb.h: New file.  Redefine LINK_SPEC and
	MULTILIB_DEFAULTS.

Index: config.gcc
===================================================================
--- config.gcc	(revision 106902)
+++ config.gcc	(working copy)
@@ -675,7 +675,14 @@ arm*-*-linux*)			# ARM GNU/Linux with EL
 	tmake_file="${tmake_file} t-linux arm/t-arm"
 	case ${target} in
 	arm*-*-linux-gnueabi)
-	    tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h"
+	    case ${target} in
+	    arm*b-*)
+		tm_file="$tm_file arm/linux-elfb.h arm/bpabi.h arm/linux-eabi.h"
+		;;
+	    *)
+		tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h"
+		;;
+	    esac
 	    tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"
   	    # The BPABI long long divmod functions return a 128-bit value in 
 	    # registers r0-r3.  Correctly modeling that requires the use of
@@ -684,6 +691,9 @@ arm*-*-linux*)			# ARM GNU/Linux with EL
 	    # The EABI requires the use of __cxa_atexit.
 	    default_use_cxa_atexit=yes
 	    ;;
+	arm*b-*-linux*)
+	    tm_file="$tm_file arm/linux-elfb.h"
+	    ;;
 	*)
 	    tmake_file="$tmake_file arm/t-linux"
 	    ;;
Index: config/arm/linux-elfb.h
===================================================================
--- config/arm/linux-elfb.h	(revision 0)
+++ config/arm/linux-elfb.h	(revision 0)
@@ -0,0 +1,48 @@
+/* Configuration file for big endian ARM GNU/Linux targets.
+   Copyright (C) 2005 Free Software Foundation, Inc.
+   Contributed by Sebastian Pop <pop@cri.ensmp.fr>
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING.  If not, write to the Free
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA.  */
+
+/* Redefine MULTILIB_DEFAULTS with mbig-endian.  */
+#undef  MULTILIB_DEFAULTS
+#define MULTILIB_DEFAULTS \
+	{ "marm", "mbig-endian", "mhard-float", "mno-thumb-interwork" }
+
+/* The value of LINUX_TARGET_INTERPRETER is inherited from linux-elf.h
+   that is included before this file.  */
+
+/* Redefine LINK_SPEC with armelfb_linux.  */
+#undef SUBTARGET_EXTRA_LINK_SPEC
+#define SUBTARGET_EXTRA_LINK_SPEC " -m armelfb_linux -p"
+
+#undef LINUX_TARGET_LINK_SPEC
+#define LINUX_TARGET_LINK_SPEC  "%{h*} %{version:-v} \
+   %{b} \
+   %{static:-Bstatic} \
+   %{shared:-shared} \
+   %{symbolic:-Bsymbolic} \
+   %{rdynamic:-export-dynamic} \
+   %{!dynamic-linker:-dynamic-linker " LINUX_TARGET_INTERPRETER "} \
+   -X \
+   %{mbig-endian:-EB}" \
+   SUBTARGET_EXTRA_LINK_SPEC
+
+#undef  LINK_SPEC
+#define LINK_SPEC LINUX_TARGET_LINK_SPEC
+


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]