From 4529dbf15fa88a1c2a5a51be43bd74c84bf8ca96 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Thu, 18 Jan 2007 18:33:28 +0000 Subject: [PATCH] /home/richard/patches/freescale/head-submission/uclinux-oldabi.clog From-SVN: r120909 --- gcc/ChangeLog | 7 ++++ gcc/config.gcc | 13 ++++++- gcc/config/m68k/uclinux-oldabi.h | 65 ++++++++++++++++++++++++++++++++ gcc/doc/install.texi | 16 ++++++++ 4 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 gcc/config/m68k/uclinux-oldabi.h diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c54f4a67cbb..286f5f28520 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2007-01-18 Richard Sandiford + + * doc/install.texi: Document m68k-uclinuxoldabi. + * config.gcc (m68k-*-uclinuxoldabi): New configuration. + * config/m68k/uclinux-oldabi.h: New file, copied from + config/m68k/uclinux.h. + 2007-01-18 Kaz Kojima * config/m32r/m32r-protos.h (m32r_expand_epilogue): Declare it. diff --git a/gcc/config.gcc b/gcc/config.gcc index 2f47721f68b..d611a8c2bc2 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1510,7 +1510,18 @@ m68k*-*-openbsd*) # we need collect2 until our bug is fixed... use_collect2=yes ;; -m68k-*-uclinux*) # Motorola m68k/ColdFire running uClinux with uClibc +m68k-*-uclinuxoldabi*) # Motorola m68k/ColdFire running uClinux + # with uClibc, using the original + # m68k-elf-based ABI + default_m68k_cpu=68020 + tm_file="m68k/m68k.h m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h m68k/uclinux-oldabi.h" + tm_defines="${tm_defines} MOTOROLA USE_GAS" + tmake_file=m68k/t-uclinux + use_fixproto=no + ;; +m68k-*-uclinux*) # Motorola m68k/ColdFire running uClinux + # with uClibc, using the new GNU/Linux-style + # ABI. default_m68k_cpu=68020 tm_file="m68k/m68k.h m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h m68k/uclinux.h" tm_defines="${tm_defines} MOTOROLA USE_GAS" diff --git a/gcc/config/m68k/uclinux-oldabi.h b/gcc/config/m68k/uclinux-oldabi.h new file mode 100644 index 00000000000..82124f9619e --- /dev/null +++ b/gcc/config/m68k/uclinux-oldabi.h @@ -0,0 +1,65 @@ +/* Definitions of target machine for GCC. m68k/ColdFire based uClinux system + using ELF objects with special linker post-processing to produce FLAT + executables. + + Copyright (C) 2003 Free Software Foundation, Inc. + +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. */ + + +/* Undo the definition of STARTFILE_SPEC from m68kelf.h so we'll + pick the default from gcc.c (just link crt0.o from multilib dir). */ +#undef STARTFILE_SPEC + +/* Override the default LIB_SPEC from gcc.c. We don't currently support + profiling, or libg.a. */ +#undef LIB_SPEC +#define LIB_SPEC "\ +%{mid-shared-library:-R libc.gdb%s -elf2flt -shared-lib-id 0} -lc \ +" + +/* we don't want a .eh_frame section. */ +#define EH_FRAME_IN_DATA_SECTION + +/* ??? Quick hack to get constructors working. Make this look more like a + COFF target, so the existing dejagnu/libgloss support works. A better + solution would be to make the necessary dejagnu and libgloss changes so + that we can use normal the ELF constructor mechanism. */ +#undef INIT_SECTION_ASM_OP +#undef FINI_SECTION_ASM_OP +#undef ENDFILE_SPEC +#define ENDFILE_SPEC "" + +/* Bring in standard linux defines */ +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define_std ("mc68000"); \ + builtin_define ("__uClinux__"); \ + builtin_define_std ("linux"); \ + builtin_define_std ("unix"); \ + builtin_define ("__gnu_linux__"); \ + builtin_assert ("system=linux"); \ + builtin_assert ("system=unix"); \ + builtin_assert ("system=posix"); \ + if (TARGET_ID_SHARED_LIBRARY) \ + builtin_define ("__ID_SHARED_LIBRARY__"); \ + } \ + while (0) + diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi index 9400a7cb5e2..447c53d6a8a 100644 --- a/gcc/doc/install.texi +++ b/gcc/doc/install.texi @@ -2429,6 +2429,8 @@ information are. @item @uref{#m68k-hp-hpux,,m68k-hp-hpux} @item +@uref{#m68k-uclinux,,m68k-uclinux} +@item @uref{#mips-x-x,,mips-*-*} @item @uref{#mips-sgi-irix5,,mips-sgi-irix5} @@ -3429,6 +3431,9 @@ This @var{target} can either be a @option{-mcpu} argument or one of the following values: @samp{m68000}, @samp{m68010}, @samp{m68020}, @samp{m68030}, @samp{m68040}, @samp{m68060}, @samp{m68020-40} and @samp{m68020-60}. +@html +
+@end html @heading @anchor{m68k-hp-hpux}m68k-hp-hpux HP 9000 series 300 or 400 running HP-UX@. HP-UX version 8.0 has a bug in the assembler that prevents compilation of GCC@. This @@ -3479,6 +3484,17 @@ to look like: #!/bin/ksh @end smallexample +@html +
+@end html +@heading @anchor{m68k-x-uclinux}m68k-*-uclinux +GCC 4.3 changed the uClinux configuration so that it uses the +@samp{m68k-linux-gnu} ABI rather than the @samp{m68k-elf} ABI. +It also added improved support for C++ and flat shared libraries, +both of which were ABI changes. However, you can still use the +original ABI by configuring for @samp{m68k-uclinuxoldabi} or +@samp{m68k-@var{vendor}-uclinuxoldabi}. + @html
@end html