This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch 2.95.3 branch]: Make ARM compiler recognize recent binutils
On Thursday, 21 December 2000, 14:00:06 +0000, bernds@redhat.com wrote:
> On Thu, 21 Dec 2000, Manfred Hollstein wrote:
>
> > I'd like the appended patch to be integrated into the upcoming 2.95.3
> > release. Without this patch, gcc-2.95.3 will be pretty much useless on
> > ARM Linux systems, as recent versions of GNU ARM ld (including 2.10)
> > do not recognize the emulation name which is passed in the invocation
> > from gcc.
>
> Was this due to a change in binutils? Why was this change made if it
> means no existing release of gcc can be used on arm-linux targets?
This is the ChangeLog entry from ld/ChangeLog:
1999-04-12 Philip Blundell <pb@nexus.co.uk>
* emulparams/armelf_linux.sh: New file. Support for ARM
GNU/Linux ELF ABI.
* emulparams/armelf_linux26.sh: New file. APCS-26 version of above.
* configure.tgt: For arm*-*-linux-gnu*, set default emulation to
`armelf_linux', and also include `armelf_linux26' and `armelf'.
* Makefile.am: Add rules to make earmlinux.c and earmlinux26.c.
(ALL_EMULATIONS): Add earmlinux.o and earmlinux26.o.
* Makefile.in: Regenerate.
I remember lots of discussions on renaming elf32_armlinux (or however
it was called) into armelf_linux on the various mailing lists. But, without
this patch (the mainline contains an even better one), gcc is pretty
much useless.
Cheers.
l8er
manfred
>
> Philip, can you confirm that the patch below is necessary?
>
>
> Bernd
>
>
> > Fri Sep 10 11:43:07 1999 Philip Blundell <pb@futuretv.com>
> >
> > * configure.in, config/arm/linux-oldld.h,
> > config/arm/linux-elf26.h, config/arm/linux-elf.h: Backport latest
> > ARM GNU/Linux config from mainline.
> > * configure: Regenerate.
> >
> > Fri Jul 16 10:29:48 1999 Philip Blundell <pb@futuretv.com>
> >
> > * config/arm/linux-elf.h (MULTILIB_DEFAULTS): Define.
> > (SUBTARGET_EXTRA_LINK_SPEC): Provide alternative definition for
> > use with new binutils.
> >
> > * config/arm/t-linux (EXTRA_MULTILIB_PARTS): Define.
> > (MULTILIB_OPTIONS, MULTILIB_DIRNAMES): Multilib for hard/soft
> > float by default.
> >
> > diff -rupN -x CVS -x RCS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el gcc-2.95.3.orig/gcc/config/arm/linux-elf.h gcc-2.95.3/gcc/config/arm/linux-elf.h
> > --- gcc-2.95.3.orig/gcc/config/arm/linux-elf.h Wed Dec 20 13:59:36 2000
> > +++ gcc-2.95.3/gcc/config/arm/linux-elf.h Thu Dec 21 12:43:01 2000
> > @@ -28,13 +28,34 @@ Boston, MA 02111-1307, USA. */
> > /* We have libgcc2. */
> > #define HAVE_ATEXIT
> >
> > -/* Default is to use APCS-32 mode. */
> > #ifndef SUBTARGET_DEFAULT_APCS26
> > -#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_SHORT_BYTE)
> > -#define SUBTARGET_EXTRA_LINK_SPEC \
> > +/* Default is to use APCS-32 mode. */
> > +# define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_SHORT_BYTE)
> > +# ifdef SUBTARGET_OLD_LINKER
> > +# define SUBTARGET_EXTRA_LINK_SPEC \
> > " %{mapcs-26:-m elf32arm26} %{!mapcs-26:-m elf32arm}"
> > -#define SUBTARGET_EXTRA_ASM_SPEC \
> > +# else /* new linker */
> > +# define SUBTARGET_EXTRA_LINK_SPEC \
> > + " %{mapcs-26:-m armelf_linux26} %{!mapcs-26:-m armelf_linux} -p"
> > +# endif
> > +# define SUBTARGET_EXTRA_ASM_SPEC \
> > " %{mapcs-26:-mapcs-26} %(!mapcs-26:-mapcs-32}"
> > +# define MULTILIB_DEFAULTS \
> > + { "mlittle-endian", "mhard-float", "mapcs-32", "mno-thumb-interwork" }
> > +# define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__"
> > +#else /* default is APCS-26 */
> > +# define TARGET_DEFAULT (ARM_FLAG_SHORT_BYTE)
> > +# ifdef SUBTARGET_OLD_LINKER
> > +# define SUBTARGET_LINK_SPEC \
> > + " %{mapcs-32:-m elf32arm} %{!mapcs-32:-m elf32arm26}"
> > +# else /* new linker */
> > +# define SUBTARGET_LINK_SPEC \
> > + " %{mapcs-32:-m armelf_linux} %{!mapcs-32:-m armelf_linux26} -p"
> > +# endif
> > +# define SUBTARGET_EXTRA_ASM_SPEC \
> > + " %{mapcs-32:-mapcs-32} %(!mapcs-32:-mapcs-26}"
> > +# define MULTILIB_DEFAULTS \
> > + { "mlittle-endian", "mhard-float", "mapcs-26", "mno-thumb-interwork" }
> > #endif
> >
> > /* This was defined in linux.h. Define it here also. */
> > diff -rupN -x CVS -x RCS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el gcc-2.95.3.orig/gcc/config/arm/linux-elf26.h gcc-2.95.3/gcc/config/arm/linux-elf26.h
> > --- gcc-2.95.3.orig/gcc/config/arm/linux-elf26.h Sat Dec 19 10:11:45 1998
> > +++ gcc-2.95.3/gcc/config/arm/linux-elf26.h Thu Dec 21 12:43:01 2000
> > @@ -1,6 +1,7 @@
> > -/* Definitions for 26-bit ARM running Linux-based GNU systems using ELF
> > - Copyright (C) 1998 Free Software Foundation, Inc.
> > - Contributed by Philip Blundell <philb@gnu.org>
> > +/* Definitions for ARM running Linux-based GNU systems
> > + using ELF and 26-bit APCS.
> > + Copyright (C) 1999 Free Software Foundation, Inc.
> > + Contributed by Philip Blundell <Philip.Blundell@pobox.com>
> >
> > This file is part of GNU CC.
> >
> > @@ -19,14 +20,5 @@ along with this program; see the file CO
> > the Free Software Foundation, 59 Temple Place - Suite 330,
> > Boston, MA 02111-1307, USA. */
> >
> > +/* Tell linux-elf.h to default to 26-bit mode. */
> > #define SUBTARGET_DEFAULT_APCS26
> > -
> > -#define SUBTARGET_LINK_SPEC \
> > - " %{mapcs-32:-m elf32arm} %{!mapcs-32:-m elf32arm26}"
> > -
> > -#define SUBTARGET_EXTRA_ASM_SPEC \
> > - " %{mapcs-32:-mapcs-32} %(!mapcs-32:-mapcs-26}"
> > -
> > -#define TARGET_DEFAULT (ARM_FLAG_SHORT_BYTE)
> > -
> > -#include "arm/linux-elf.h"
> > diff -rupN -x CVS -x RCS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el gcc-2.95.3.orig/gcc/config/arm/linux-elf26.h gcc-2.95.3/gcc/config/arm/linux-elf26.h
> > --- gcc-2.95.3.orig/gcc/config/arm/linux-oldld.h Tue Nov 7 16:06:25 2000
> > +++ gcc-2.95.3/gcc/config/arm/linux-oldld.h
> > @@ -0,0 +1,27 @@
> > +/* Definitions for ARM running Linux-based GNU systems
> > + using ELF with old binutils.
> > + Copyright (C) 1999 Free Software Foundation, Inc.
> > + Contributed by Philip Blundell <Philip.Blundell@pobox.com>
> > +
> > +This file is part of GNU CC.
> > +
> > +GNU CC 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.
> > +
> > +GNU CC 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 this program; see the file COPYING. If not, write to
> > +the Free Software Foundation, 59 Temple Place - Suite 330,
> > +Boston, MA 02111-1307, USA. */
> > +
> > +/* Unfortunately, owing to various historical accidents, version 2.9.4
> > + and newer of GNU binutils are not quite compatible with the old
> > + (2.9.1-based) toolset. This tells linux-elf.h to generate specs
> > + appropriate for the older versions. */
> > +#define SUBTARGET_OLD_LINKER
> > diff -rupN -x CVS -x RCS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el gcc-2.95.3.orig/gcc/config/arm/t-linux gcc-2.95.3/gcc/config/arm/t-linux
> > --- gcc-2.95.3.orig/gcc/config/arm/t-linux Sat Mar 27 15:33:31 1999
> > +++ gcc-2.95.3/gcc/config/arm/t-linux Thu Dec 21 12:43:01 2000
> > @@ -13,10 +13,15 @@ LIBGCC1 = libgcc1-asm.a
> > LIB1ASMSRC = arm/lib1funcs.asm
> > LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx
> >
> > +MULTILIB_OPTIONS = mhard-float/msoft-float
> > +MULTILIB_DIRNAMES = hard-float soft-float
> > +
> > # If you want to build both APCS variants as multilib options this is how
> > # to do it.
> > -#MULTILIB_OPTIONS = mapcs-32/apcs-26
> > -#MULTILIB_DIRNAMES = apcs-32 apcs-26
> > +#MULTILIB_OPTIONS += mapcs-32/mapcs-26
> > +#MULTILIB_DIRNAMES += apcs-32 apcs-26
> > +
> > +EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o
> >
> > LIBGCC = stmp-multilib
> > INSTALL_LIBGCC = install-multilib
> > diff -rupN -x CVS -x RCS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el gcc-2.95.3.orig/gcc/configure.in gcc-2.95.3/gcc/configure.in
> > --- gcc-2.95.3.orig/gcc/configure.in Tue Jan 11 09:21:04 2000
> > +++ gcc-2.95.3/gcc/configure.in Thu Dec 21 12:43:01 2000
> > @@ -756,15 +756,31 @@ changequote([,])dnl
> > tmake_file=arm/t-linux
> > gnu_ld=yes
> > ;;
> > - arm*-*-linux-gnu*) # ARM GNU/Linux with ELF
> > + arm*-*-linux-gnuoldld*) # ARM GNU/Linux with old ELF linker
> > xm_file=arm/xm-linux.h
> > xmake_file=x-linux
> > + tm_file="arm/linux-oldld.h arm/linux-elf.h"
> > case $machine in
> > armv2*-*-*)
> > - tm_file=arm/linux-elf26.h
> > + tm_file="arm/linux-elf26.h $tm_file"
> > + ;;
> > + esac
> > + tmake_file="t-linux arm/t-linux"
> > + extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
> > + gnu_ld=yes
> > + case x${enable_threads} in
> > + x | xyes | xpthreads | xposix)
> > + thread_file='posix'
> > ;;
> > - *)
> > - tm_file=arm/linux-elf.h
> > + esac
> > + ;;
> > + arm*-*-linux-gnu*) # ARM GNU/Linux with ELF
> > + xm_file=arm/xm-linux.h
> > + xmake_file=x-linux
> > + tm_file="arm/linux-elf.h"
> > + case $machine in
> > + armv2*-*-*)
> > + tm_file="arm/linux-elf26.h $tm_file"
> > ;;
> > esac
> > tmake_file="t-linux arm/t-linux"
> > diff -rupN -x CVS -x RCS -x *.o -x *.info* -x *.html* -x *.elc -x *.dvi -x *.orig -x *~ -x version.el gcc-2.95.3.orig/gcc/configure gcc-2.95.3/gcc/configure
> > --- gcc-2.95.3.orig/gcc/configure Sat Jul 8 16:04:38 2000
> > +++ gcc-2.95.3/gcc/configure Thu Dec 21 12:43:01 2000
> > @@ -3194,15 +3194,31 @@ for machine in $build $host $target; do
> > tmake_file=arm/t-linux
> > gnu_ld=yes
> > ;;
> > - arm*-*-linux-gnu*) # ARM GNU/Linux with ELF
> > + arm*-*-linux-gnuoldld*) # ARM GNU/Linux with old ELF linker
> > xm_file=arm/xm-linux.h
> > xmake_file=x-linux
> > + tm_file="arm/linux-oldld.h arm/linux-elf.h"
> > case $machine in
> > armv2*-*-*)
> > - tm_file=arm/linux-elf26.h
> > + tm_file="arm/linux-elf26.h $tm_file"
> > + ;;
> > + esac
> > + tmake_file="t-linux arm/t-linux"
> > + extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
> > + gnu_ld=yes
> > + case x${enable_threads} in
> > + x | xyes | xpthreads | xposix)
> > + thread_file='posix'
> > ;;
> > - *)
> > - tm_file=arm/linux-elf.h
> > + esac
> > + ;;
> > + arm*-*-linux-gnu*) # ARM GNU/Linux with ELF
> > + xm_file=arm/xm-linux.h
> > + xmake_file=x-linux
> > + tm_file="arm/linux-elf.h"
> > + case $machine in
> > + armv2*-*-*)
> > + tm_file="arm/linux-elf26.h $tm_file"
> > ;;
> > esac
> > tmake_file="t-linux arm/t-linux"
> >