This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: Basic support for ARM EABI GNU/Linux
- From: Mark Mitchell <mark at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: paul at codesourcery dot com
- Date: Fri, 19 Nov 2004 11:17:48 -0800
- Subject: PATCH: Basic support for ARM EABI GNU/Linux
- Reply-to: mark at codesourcery dot com
Here's a basic patch for ARM EABI GNU/Linux.
Paul, is this OK for the csl-arm-branch? Should I create the 2004-Q3
release branch before checking this in? What about mainline?
Thanks,
--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
2004-11-19 Mark Mitchell <mark@codesourcery.com>
* 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 (TARGET_LINUX_LINK_SPEC): New macro.
(LINK_SPEC): Use it.
* config/arm/t-linux-eabi: New file.
Index: config.gcc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config.gcc,v
retrieving revision 1.405.4.19
diff -c -5 -p -r1.405.4.19 config.gcc
*** config.gcc 30 Sep 2004 21:45:03 -0000 1.405.4.19
--- config.gcc 19 Nov 2004 19:10:07 -0000
*************** arm*-*-netbsd*)
*** 663,676 ****
tmake_file="t-netbsd arm/t-arm arm/t-netbsd"
extra_parts=""
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="t-slibgcc-elf-ver t-linux 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"
tmake_file="arm/t-arm arm/t-arm-elf"
;;
--- 663,690 ----
tmake_file="t-netbsd arm/t-arm arm/t-netbsd"
extra_parts=""
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="t-slibgcc-elf-ver 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"
tmake_file="arm/t-arm arm/t-arm-elf"
;;
Index: config/arm/bpabi.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/bpabi.h,v
retrieving revision 1.1.4.9
diff -c -5 -p -r1.1.4.9 bpabi.h
*** config/arm/bpabi.h 12 Oct 2004 14:10:40 -0000 1.1.4.9
--- config/arm/bpabi.h 19 Nov 2004 19:10:09 -0000
***************
*** 28,37 ****
--- 28,38 ----
/* BPABI targets use EABI frame unwinding tables. */
#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
calling convention. */
#define FLOAT_LIB_COMPARE_RETURNS_BOOL(MODE, COMPARISON) TARGET_BPABI
***************
*** 99,105 ****
--- 100,107 ----
{ \
builtin_define ("__GXX_MERGED_TYPEINFO_NAMES=0"); \
} \
while (false)
+ #undef TARGET_OS_CPP_BUILTINS
#define TARGET_OS_CPP_BUILTINS() \
TARGET_BPABI_CPP_BUILTINS()
Index: config/arm/linux-eabi.h
===================================================================
RCS file: config/arm/linux-eabi.h
diff -N config/arm/linux-eabi.h
*** /dev/null 1 Jan 1970 00:00:00 -0000
--- config/arm/linux-eabi.h 19 Nov 2004 19:10:14 -0000
***************
*** 0 ****
--- 1,44 ----
+ /* 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, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, 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)
+
+ /* GCC does not yet support a hard-float ABI with VFP. */
+ #undef TARGET_DEFAULT
+ #define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT)
+
+ #undef SUBTARGET_EXTRA_LINK_SPEC
+ #define SUBTARGET_EXTRA_LINK_SPEC "-m armelf_linux_eabi"
+
+ /* 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
Index: config/arm/linux-elf.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/linux-elf.h,v
retrieving revision 1.41.4.5
diff -c -5 -p -r1.41.4.5 linux-elf.h
*** config/arm/linux-elf.h 15 May 2004 13:02:09 -0000 1.41.4.5
--- config/arm/linux-elf.h 19 Nov 2004 19:10:14 -0000
***************
*** 75,96 ****
#undef ENDFILE_SPEC
#define ENDFILE_SPEC \
"%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
! #undef LINK_SPEC
! #define LINK_SPEC "%{h*} %{version:-v} \
%{b} %{Wl,*:%*} \
%{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() LINUX_TARGET_OS_CPP_BUILTINS()
/* This is how we tell the assembler that two symbols have the same value. */
#define ASM_OUTPUT_DEF(FILE, NAME1, NAME2) \
do \
--- 75,98 ----
#undef ENDFILE_SPEC
#define ENDFILE_SPEC \
"%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
! #define LINUX_TARGET_LINK_SPEC "%{h*} %{version:-v} \
%{b} %{Wl,*:%*} \
%{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
+ #undef LINK_SPEC
+ #define LINK_SPEC LINUX_TARGET_LINK_SPEC
+
#define TARGET_OS_CPP_BUILTINS() LINUX_TARGET_OS_CPP_BUILTINS()
/* This is how we tell the assembler that two symbols have the same value. */
#define ASM_OUTPUT_DEF(FILE, NAME1, NAME2) \
do \
Index: config/arm/t-linux-eabi
===================================================================
RCS file: config/arm/t-linux-eabi
diff -N config/arm/t-linux-eabi
*** /dev/null 1 Jan 1970 00:00:00 -0000
--- config/arm/t-linux-eabi 19 Nov 2004 19:10:14 -0000
***************
*** 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 =