gcc-patches@gcc.gnu.org
[Top] [All Lists]

[patch] Add basic support for arm-none-linux-gnueabi.

Subject: [patch] Add basic support for arm-none-linux-gnueabi.
From: Kazu Hirata
Date: Sat, 20 Aug 2005 10:27:51 -0700
Hi,

Attached is a patch to add basic support for arm-none-linux-gnueabi.

The gcc portion is taken from

  http://gcc.gnu.org/ml/gcc-patches/2004-11/msg01636.html

I had to make a minor modification to libcpp's configuration bits.
Specifically, I needed need_64bit_hwint=yes so that HOST_WIDE_INT
would have the same size in both libcpp and gcc.

Built arm-none-linux-gnueabi.  OK to apply?

p.s.
By the way, is anybody trying to cleanup need_64bit_hwint?  It's less
than ideal to have it in both libcpp and gcc and maintain it manually.
(But then I don't know if it's worth messing with the top-level
configure bits just for libcpp and gcc.)

Kazu Hirata

gcc/
2005-08-20  Kazu Hirata  <kazu@xxxxxxxxxxxxxxxx>

        Merge from csl-arm-20050325-branch:
        2004-11-19  Mark Mitchell  <mark@xxxxxxxxxxxxxxxx>
        * config.gcc (arm*-*-linux-gnueabi): Add it.
        * config/arm/bpabi.h (FPUTYPE_DEFAULT): Undefine it before
        redefining it.
        (TARGET_OS_CPP_BUILTINS): Likeiwse.
        * config/arm/linux-eabi.h: New file.
        * config/arm/linux-elf.h (LINUX_TARGET_INTERPRETER): New macro.
        (LINUX_TARET_LINK_SPEC): Likewise.
        (LINK_SPEC): Use it.
        * config/arm/t-linux-eabi: New file.

libcpp/
2005-08-20  Kazu Hirata  <kazu@xxxxxxxxxxxxxxxx>

        * configure.ac: Require 64-bit int for arm*-*-*eabi*.
        * configure: Regenerate.

Index: gcc/config.gcc
===================================================================
RCS file: /home/gcc/repos/gcc/gcc/gcc/config.gcc,v
retrieving revision 1.562
diff -c -d -p -r1.562 config.gcc
*** gcc/config.gcc      17 Aug 2005 11:11:01 -0000      1.562
--- gcc/config.gcc      20 Aug 2005 00:50:24 -0000
*************** arm*-*-netbsd*)
*** 671,680 ****
        use_collect2=yes
        ;;
  arm*-*-linux*)                        # ARM GNU/Linux with ELF
!       tm_file="dbxelf.h elfos.h linux.h arm/elf.h  arm/linux-gas.h 
arm/linux-elf.h arm/aout.h arm/arm.h"
!       tmake_file="${tmake_file} arm/t-arm arm/t-linux"
        extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
        gnu_ld=yes
        ;;
  arm*-*-uclinux*)              # ARM ucLinux
        tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h 
arm/arm.h arm/linux-gas.h arm/linux-elf.h arm/uclinux-elf.h"
--- 671,694 ----
        use_collect2=yes
        ;;
  arm*-*-linux*)                        # ARM GNU/Linux with ELF
!       tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h 
arm/linux-elf.h" 
!       tmake_file="${tmake_file} t-linux arm/t-arm"
        extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
        gnu_ld=yes
+       case ${target} in
+       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"
+           # The BPABI long long divmod functions return a 128-bit value in 
+           # registers r0-r3.  Correctly modeling that requires the use of
+           # TImode.
+           need_64bit_hwint=yes
+           ;;
+       *)
+           tmake_file="$tmake_file arm/t-linux"
+           ;;
+       esac
+       tm_file="$tm_file arm/aout.h arm/arm.h"
        ;;
  arm*-*-uclinux*)              # ARM ucLinux
        tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h 
arm/arm.h arm/linux-gas.h arm/linux-elf.h arm/uclinux-elf.h"
Index: gcc/config/arm/bpabi.h
===================================================================
RCS file: /home/gcc/repos/gcc/gcc/gcc/config/arm/bpabi.h,v
retrieving revision 1.13
diff -c -d -p -r1.13 bpabi.h
*** gcc/config/arm/bpabi.h      28 Jun 2005 19:51:30 -0000      1.13
--- gcc/config/arm/bpabi.h      20 Aug 2005 00:51:45 -0000
***************
*** 30,35 ****
--- 30,36 ----
  #define TARGET_UNWIND_INFO 1
  
  /* Section 4.1 of the AAPCS requires the use of VFP format.  */
+ #undef FPUTYPE_DEFAULT
  #define FPUTYPE_DEFAULT FPUTYPE_VFP
  
  /* The ARM BPABI functions return a boolean; they use no special
***************
*** 101,106 ****
--- 102,108 ----
      }                                                 \
    while (false)
  
+ #undef TARGET_OS_CPP_BUILTINS
  #define TARGET_OS_CPP_BUILTINS() \
    TARGET_BPABI_CPP_BUILTINS()
  
Index: gcc/config/arm/linux-elf.h
===================================================================
RCS file: /home/gcc/repos/gcc/gcc/gcc/config/arm/linux-elf.h,v
retrieving revision 1.55
diff -c -d -p -r1.55 linux-elf.h
*** gcc/config/arm/linux-elf.h  5 Aug 2005 03:20:10 -0000       1.55
--- gcc/config/arm/linux-elf.h  20 Aug 2005 00:53:50 -0000
***************
*** 81,98 ****
  #define ENDFILE_SPEC \
    "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
  
! #undef  LINK_SPEC
! #define LINK_SPEC "%{h*} %{version:-v} \
     %{b} \
     %{static:-Bstatic} \
     %{shared:-shared} \
     %{symbolic:-Bsymbolic} \
     %{rdynamic:-export-dynamic} \
!    %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \
     -X \
     %{mbig-endian:-EB}" \
     SUBTARGET_EXTRA_LINK_SPEC
  
  #define TARGET_OS_CPP_BUILTINS()              \
    do                                          \
      {                                         \
--- 81,102 ----
  #define ENDFILE_SPEC \
    "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
  
! #define LINUX_TARGET_INTERPRETER "/lib/ld-linux.so.2"
! 
! #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
+ 
  #define TARGET_OS_CPP_BUILTINS()              \
    do                                          \
      {                                         \
Index: libcpp/configure
===================================================================
RCS file: /home/gcc/repos/gcc/gcc/libcpp/configure,v
retrieving revision 1.19
diff -c -d -p -r1.19 configure
*** libcpp/configure    24 Jul 2005 03:44:26 -0000      1.19
--- libcpp/configure    20 Aug 2005 04:47:22 -0000
*************** fi
*** 8218,8224 ****
  
  case $target in
        alpha*-*-* | \
!       arm*-*-eabi* | \
        arm*-*-symbianelf* | \
        x86_64-*-* | \
        ia64-*-* | \
--- 8218,8224 ----
  
  case $target in
        alpha*-*-* | \
!       arm*-*-*eabi* | \
        arm*-*-symbianelf* | \
        x86_64-*-* | \
        ia64-*-* | \
Index: libcpp/configure.ac
===================================================================
RCS file: /home/gcc/repos/gcc/gcc/libcpp/configure.ac,v
retrieving revision 1.16
diff -c -d -p -r1.16 configure.ac
*** libcpp/configure.ac 24 Jul 2005 03:44:26 -0000      1.16
--- libcpp/configure.ac 20 Aug 2005 04:46:48 -0000
*************** fi
*** 113,119 ****
  m4_changequote(,)
  case $target in
        alpha*-*-* | \
!       arm*-*-eabi* | \
        arm*-*-symbianelf* | \
        x86_64-*-* | \
        ia64-*-* | \
--- 113,119 ----
  m4_changequote(,)
  case $target in
        alpha*-*-* | \
!       arm*-*-*eabi* | \
        arm*-*-symbianelf* | \
        x86_64-*-* | \
        ia64-*-* | \
--- /dev/null   2005-07-29 06:07:43.066949360 -0700
+++ gcc/config/arm/linux-eabi.h 2005-08-20 07:53:07.905267862 -0700
@@ -0,0 +1,50 @@
+/* Configuration file for ARM GNU/Linux EABI targets.
+   Copyright (C) 2004
+   Free Software Foundation, Inc.
+   Contributed by CodeSourcery, LLC   
+
+   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.  */
+
+/* On EABI GNU/Linux, we want both the BPABI builtins and the
+   GNU/Linux builtins.  */
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS()               \
+  do                                           \
+    {                                          \
+      TARGET_BPABI_CPP_BUILTINS();             \
+      LINUX_TARGET_OS_CPP_BUILTINS();          \
+    }                                          \
+  while (false)
+
+/* We default to a soft-float ABI so that binaries can run on all
+   target hardware.  */
+#undef TARGET_DEFAULT_FLOAT_ABI
+#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT
+
+#undef SUBTARGET_EXTRA_LINK_SPEC
+#define SUBTARGET_EXTRA_LINK_SPEC "-m armelf_linux_eabi"
+
+/* Use ld-linux.so.3 so that it will be possible to run "classic"
+   GNU/Linux binaries on an EABI system.  */
+#undef LINUX_TARGET_INTERPRETER
+#define LINUX_TARGET_INTERPRETER "/lib/ld-linux.so.3"
+
+/* At this point, bpabi.h will have clobbered LINK_SPEC.  We want to
+   use the GNU/Linux version, not the generic BPABI version.  */
+#undef LINK_SPEC
+#define LINK_SPEC LINUX_TARGET_LINK_SPEC
--- /dev/null   2005-07-29 06:07:43.066949360 -0700
+++ gcc/config/arm/t-linux-eabi 2005-08-19 17:44:26.094008348 -0700
@@ -0,0 +1,4 @@
+# We do not build a Thumb multilib for Linux because the definition of
+# CLEAR_INSN_CACHE in linux-gas.h does not work in Thumb mode.
+MULTILIB_OPTIONS       =
+MULTILIB_DIRNAMES      =

<Prev in Thread] Current Thread [Next in Thread>