diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1217bce6c85..b0c808d1d1f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,15 @@ +2003-01-24 Bob Wilson + + * config.gcc (xtensa-*-elf*): Removed assignments to with_newlib, + extra_parts, and fixincludes. Add xtensa/t-elf tmake_file. + (xtensa-*-linux*): Add xtensa/t-linux tmake_file. + * config/xtensa/crti.asm: New file. + * config/xtensa/crtn.asm: New file. + * config/xtensa/t-elf: New file. + * config/xtensa/t-linux: New file. + * config/xtensa/t-xtensa: Add rules for crti.o and crtn.o. + Move various CFLAGS settings to new t-elf file. + 2003-01-24 Richard Henderson PR optimization/4382 diff --git a/gcc/config.gcc b/gcc/config.gcc index dd06d690c28..b287bd32afa 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -2666,14 +2666,11 @@ xstormy16-*-elf) ;; xtensa-*-elf*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h xtensa/elf.h" - with_newlib=yes - tmake_file=xtensa/t-xtensa - extra_parts="crtbegin.o crtend.o" - fixincludes=Makefile.in # newlib headers should be OK + tmake_file="xtensa/t-xtensa xtensa/t-elf" ;; xtensa-*-linux*) tm_file="${tm_file} dbxelf.h elfos.h svr4.h linux.h xtensa/linux.h" - tmake_file="t-linux xtensa/t-xtensa" + tmake_file="t-linux xtensa/t-xtensa xtensa/t-linux" ;; *) echo "*** Configuration $machine not supported" 1>&2 diff --git a/gcc/config/xtensa/crti.asm b/gcc/config/xtensa/crti.asm new file mode 100644 index 00000000000..8019ed1c3db --- /dev/null +++ b/gcc/config/xtensa/crti.asm @@ -0,0 +1,44 @@ +# Start .init and .fini sections. +# Copyright (C) 2003 Free Software Foundation, Inc. +# +# This file 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. +# +# In addition to the permissions in the GNU General Public License, the +# Free Software Foundation gives you unlimited permission to link the +# compiled version of this file into combinations with other programs, +# and to distribute those combinations without any restriction coming +# from the use of this file. (The General Public License restrictions +# do apply in other respects; for example, they cover modification of +# the file, and distribution when not linked into a combine +# executable.) +# +# 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. + +# This file just makes a stack frame for the contents of the .fini and +# .init sections. Users may put any desired instructions in those +# sections. + + .section .init + .globl _init + .type _init,@function + .align 4 +_init: + entry sp, 40 + + .section .fini + .globl _fini + .type _fini,@function + .align 4 +_fini: + entry sp, 40 diff --git a/gcc/config/xtensa/crtn.asm b/gcc/config/xtensa/crtn.asm new file mode 100644 index 00000000000..b4bdad93fe4 --- /dev/null +++ b/gcc/config/xtensa/crtn.asm @@ -0,0 +1,36 @@ +# End of .init and .fini sections. +# Copyright (C) 2003 Free Software Foundation, Inc. +# +# This file 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. +# +# In addition to the permissions in the GNU General Public License, the +# Free Software Foundation gives you unlimited permission to link the +# compiled version of this file into combinations with other programs, +# and to distribute those combinations without any restriction coming +# from the use of this file. (The General Public License restrictions +# do apply in other respects; for example, they cover modification of +# the file, and distribution when not linked into a combine +# executable.) +# +# 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. + +# This file just makes sure that the .fini and .init sections do in +# fact return. Users may put any desired instructions in those sections. +# This file is the last thing linked into any executable. + + .section .init + retw + + .section .fini + retw diff --git a/gcc/config/xtensa/t-elf b/gcc/config/xtensa/t-elf new file mode 100644 index 00000000000..7d6cd1a3a9b --- /dev/null +++ b/gcc/config/xtensa/t-elf @@ -0,0 +1,6 @@ +# Build CRT files and libgcc with the "longcalls" option +CRTSTUFF_T_CFLAGS += -mlongcalls +CRTSTUFF_T_CFLAGS_S += -mlongcalls +TARGET_LIBGCC2_CFLAGS += -mlongcalls + +EXTRA_MULTILIB_PARTS = crti.o crtn.o crtbegin.o crtend.o diff --git a/gcc/config/xtensa/t-linux b/gcc/config/xtensa/t-linux new file mode 100644 index 00000000000..7d39351fa66 --- /dev/null +++ b/gcc/config/xtensa/t-linux @@ -0,0 +1 @@ +EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o diff --git a/gcc/config/xtensa/t-xtensa b/gcc/config/xtensa/t-xtensa index e93a153fb9d..5597650273a 100644 --- a/gcc/config/xtensa/t-xtensa +++ b/gcc/config/xtensa/t-xtensa @@ -8,21 +8,20 @@ fp-bit.c: $(srcdir)/config/fp-bit.c echo '#define FLOAT' > fp-bit.c cat $(srcdir)/config/fp-bit.c >> fp-bit.c -######################################################################## - # Don't run fixproto STMP_FIXPROTO = -# Build crtbegin and crtend with the "longcalls" option -CRTSTUFF_T_CFLAGS += -mlongcalls -CRTSTUFF_T_CFLAGS_S += -mlongcalls - LIB1ASMSRC = xtensa/lib1funcs.asm LIB1ASMFUNCS = _mulsi3 _nsau _divsi3 _modsi3 _udivsi3 _umodsi3 -TARGET_LIBGCC2_CFLAGS += -mlongcalls - LIB2FUNCS_EXTRA += $(srcdir)/config/xtensa/lib2funcs.S +$(T)crti.o: $(srcdir)/config/xtensa/crti.asm $(GCC_PASSES) + $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crti.o \ + -x assembler-with-cpp $(srcdir)/config/xtensa/crti.asm +$(T)crtn.o: $(srcdir)/config/xtensa/crtn.asm $(GCC_PASSES) + $(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crtn.o \ + -x assembler-with-cpp $(srcdir)/config/xtensa/crtn.asm + $(out_object_file): gt-xtensa.h gt-xtensa.h : s-gtype ; @true