This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
ARM: Fix up linux-gnueabi config
- From: Daniel Jacobowitz <drow at false dot org>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Paul Brook <paul at codesourcery dot com>, Kazu Hirata <kazu at codesourcery dot com>
- Date: Fri, 30 Sep 2005 11:50:18 -0400
- Subject: ARM: Fix up linux-gnueabi config
This patch brings the arm-none-linux-gnueabi configuration in sync with (A)
the arm-linux configuration and (B) the standard Linux configurations. Most
of the changes are cosmetic (removing redundant redefinitions), except for:
- STARTFILE_SPEC/ENDFILE_SPEC pick up PIE and crtbeginT.o support.
- EXTRA_MULTILIB_PARTS no longer includes crti.o and crtn.o, so we use
glibc's.
- Division by 0 on arm-none-linux-gnueabi will now trap using a SWI, just
like arm-linux. I've been wondering if we could arrange to call the C
library's raise() here instead...
I moved a bunch of macros to uclinux-elf.h; that target uses unknown-elf.h
instead of config/linux.h so it doesn't pick up the right defaults
otherwise.
OK for csl-arm-branch? For HEAD after Kazu adds the configuration there?
--
Daniel Jacobowitz
CodeSourcery, LLC
2005-09-30 Daniel Jacobowitz <dan@codesourcery.com>
* config.gcc (arm*-*-linux*): Remove redundant extra_parts and
gnu_ld assignments.
* config/arm/lib1funcs.asm (ARM_LDIV0, THUMB_LDIV0): Remove
redundant labels.
* config/arm/t-linux-eabi (LIB1ASMFUNCS)
(EXTRA_MULTILIB_PARTS): Define.
* config/arm/linux-elf.h (NO_IMPLICIT_EXTERN_C, CPLUSPLUS_CPP_SPEC)
(STARTFILE_SPEC, ENDFILE_SPEC, CC1_SPEC)
(LINK_GCC_C_SEQUENCE_SPEC): Move to...
* config/arm/uclinux-elf.h (NO_IMPLICIT_EXTERN_C, CPLUSPLUS_CPP_SPEC)
(STARTFILE_SPEC, ENDFILE_SPEC, CC1_SPEC)
(LINK_GCC_C_SEQUENCE_SPEC): ... here.
Index: gcc-csl-arm-branch/gcc/config/arm/lib1funcs.asm
===================================================================
--- gcc-csl-arm-branch.orig/gcc/config/arm/lib1funcs.asm 2005-09-29 14:55:54.000000000 -0400
+++ gcc-csl-arm-branch/gcc/config/arm/lib1funcs.asm 2005-09-30 10:39:20.000000000 -0400
@@ -141,7 +141,6 @@
.macro ARM_LDIV0
-LSYM(Ldiv0):
str lr, [sp, #-4]!
bl SYM (__div0) __PLT__
mov r0, #0 @ About as wrong as it could be.
@@ -150,7 +149,6 @@
.macro THUMB_LDIV0
-LSYM(Ldiv0):
push { lr }
bl SYM (__div0)
mov r0, #0 @ About as wrong as it could be.
Index: gcc-csl-arm-branch/gcc/config/arm/t-linux-eabi
===================================================================
--- gcc-csl-arm-branch.orig/gcc/config/arm/t-linux-eabi 2005-09-30 10:50:26.000000000 -0400
+++ gcc-csl-arm-branch/gcc/config/arm/t-linux-eabi 2005-09-30 10:58:35.000000000 -0400
@@ -5,3 +5,10 @@
# CLEAR_INSN_CACHE in linux-gas.h does not work in Thumb mode.
MULTILIB_OPTIONS =
MULTILIB_DIRNAMES =
+
+# Use a version of div0 which raises SIGFPE.
+LIB1ASMFUNCS := $(filter-out _dvmd_tls,$(LIB1ASMFUNCS)) _dvmd_lnx
+
+# Multilib the standard Linux files. Don't include crti.o or crtn.o,
+# which are provided by glibc.
+EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
Index: gcc-csl-arm-branch/gcc/config.gcc
===================================================================
--- gcc-csl-arm-branch.orig/gcc/config.gcc 2005-09-29 14:55:07.000000000 -0400
+++ gcc-csl-arm-branch/gcc/config.gcc 2005-09-30 11:09:11.000000000 -0400
@@ -673,8 +673,6 @@
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"
Index: gcc-csl-arm-branch/gcc/config/arm/linux-elf.h
===================================================================
--- gcc-csl-arm-branch.orig/gcc/config/arm/linux-elf.h 2005-03-02 11:09:38.000000000 -0500
+++ gcc-csl-arm-branch/gcc/config/arm/linux-elf.h 2005-09-30 11:20:43.000000000 -0400
@@ -28,9 +28,6 @@
#undef TARGET_VERSION
#define TARGET_VERSION fputs (" (ARM GNU/Linux with ELF)", stderr);
-/* Do not assume anything about header files. */
-#define NO_IMPLICIT_EXTERN_C
-
#undef TARGET_DEFAULT_FLOAT_ABI
#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD
@@ -45,10 +42,6 @@
#define MULTILIB_DEFAULTS \
{ "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" }
-/* The GNU C++ standard library requires that these macros be defined. */
-#undef CPLUSPLUS_CPP_SPEC
-#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
-
/* Now we define the strings used to build the spec file. */
#undef LIB_SPEC
#define LIB_SPEC \
@@ -58,29 +51,6 @@
#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
-/* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add
- the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
- provides part of the support for getting C++ file-scope static
- object constructed before entering `main'. */
-
-#undef STARTFILE_SPEC
-#define STARTFILE_SPEC \
- "%{!shared: \
- %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
- %{!p:%{profile:gcrt1.o%s} \
- %{!profile:crt1.o%s}}}} \
- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
-
-/* Provide a ENDFILE_SPEC appropriate for GNU/Linux. Here we tack on
- the GNU/Linux magical crtend.o file (see crtstuff.c) which
- provides part of the support for getting C++ file-scope static
- object constructed before entering `main', followed by a normal
- GNU/Linux "finalizer" file, `crtn.o'. */
-
-#undef ENDFILE_SPEC
-#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} \
@@ -126,9 +96,3 @@
prologue knows to save it. */
#define PROFILE_HOOK(X) \
emit_insn (gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (SImode, LR_REGNUM)))
-
-#undef CC1_SPEC
-#define CC1_SPEC "%{profile:-p}"
-
-#define LINK_GCC_C_SEQUENCE_SPEC \
- "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
Index: gcc-csl-arm-branch/gcc/config/arm/uclinux-elf.h
===================================================================
--- gcc-csl-arm-branch.orig/gcc/config/arm/uclinux-elf.h 2004-05-15 09:02:10.000000000 -0400
+++ gcc-csl-arm-branch/gcc/config/arm/uclinux-elf.h 2005-09-30 11:20:39.000000000 -0400
@@ -28,3 +28,42 @@
#undef TARGET_DEFAULT
#define TARGET_DEFAULT (ARM_FLAG_SINGLE_PIC_BASE)
+
+/* NOTE: The remaining definitions in this file are needed because uclinux
+ does not use config/linux.h. */
+
+/* Do not assume anything about header files. */
+#define NO_IMPLICIT_EXTERN_C
+
+/* The GNU C++ standard library requires that these macros be defined. */
+#undef CPLUSPLUS_CPP_SPEC
+#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
+
+/* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add
+ the GNU/Linux magical crtbegin.o file (see crtstuff.c) which
+ provides part of the support for getting C++ file-scope static
+ object constructed before entering `main'. */
+
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC \
+ "%{!shared: \
+ %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \
+ %{!p:%{profile:gcrt1.o%s} \
+ %{!profile:crt1.o%s}}}} \
+ crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
+
+/* Provide a ENDFILE_SPEC appropriate for GNU/Linux. Here we tack on
+ the GNU/Linux magical crtend.o file (see crtstuff.c) which
+ provides part of the support for getting C++ file-scope static
+ object constructed before entering `main', followed by a normal
+ GNU/Linux "finalizer" file, `crtn.o'. */
+
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC \
+ "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
+
+#undef CC1_SPEC
+#define CC1_SPEC "%{profile:-p}"
+
+#define LINK_GCC_C_SEQUENCE_SPEC \
+ "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"