diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ce5ad94f0da..372c3bf3bea 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2003-09-28 Robert Millan + + * config/i386/kfreebsdgnu.h: New. i386-*-kfreebsd-gnu definitions. + * config/kfreebsdgnu.h: New. *-*-kfreebsd-gnu definitions. + * config/t-kfreebsd-gnu: New. *-*-kfreebsd-gnu tmake_file. + * config.gcc: Add *-*-kfreebsd*-gnu and i[34567]86-*-kfreebsd*-gnu. + 2003-10-21 Eric Botcazou * web.c: Fix various comments. diff --git a/gcc/config.gcc b/gcc/config.gcc index 7e4c820bb11..1446f119712 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -406,6 +406,17 @@ case ${target} in esac fbsd_tm_file="${fbsd_tm_file} freebsd-spec.h freebsd.h" ;; +*-*-kfreebsd*-gnu) + # Must come before *-*-gnu* + xm_defines=POSIX # needed for cross-compiling from FreeBSD? + extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o" + # GNU tools are the only tools. + gas=yes + gnu_ld=yes + case ${enable_threads} in + "" | yes | posix) thread_file='posix' ;; + esac + ;; *-*-linux*libc1* | *-*-linux*aout*) # Avoid the generic linux case. ;; @@ -953,6 +964,12 @@ x86_64-*-linux*) i386/x86-64.h i386/linux64.h" tmake_file="t-slibgcc-elf-ver t-linux i386/t-linux64" ;; +i[34567]86-*-kfreebsd*-gnu) # must be before i[34567]86-*-gnu* + tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h linux.h i386/linux.h kfreebsdgnu.h i386/kfreebsdgnu.h" + tmake_file="t-slibgcc-elf-ver t-kfreebsd-gnu i386/t-crtstuff" + float_format=i386 + use_fixproto=no + ;; i[34567]86-*-gnu*) ;; i[34567]86-pc-msdosdjgpp*) diff --git a/gcc/config/i386/kfreebsdgnu.h b/gcc/config/i386/kfreebsdgnu.h new file mode 100644 index 00000000000..66b231dc809 --- /dev/null +++ b/gcc/config/i386/kfreebsdgnu.h @@ -0,0 +1,35 @@ +/* Definitions for Intel 386 running GNU/KFreeBSD systems with ELF format. + Copyright (C) 2002 Free Software Foundation, Inc. + Contributed by Bruno Haible. + +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. */ + +#undef TARGET_VERSION +#define TARGET_VERSION fprintf (stderr, " (i386 KFreeBSD/ELF)"); + +/* FIXME: Is a KFreeBSD-specific fallback mechanism necessary? */ +#undef MD_FALLBACK_FRAME_STATE_FOR + +#undef LINK_SPEC +#define LINK_SPEC "-m elf_i386_fbsd %{shared:-shared} \ + %{!shared: \ + %{!ibcs: \ + %{!static: \ + %{rdynamic:-export-dynamic} \ + %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \ + %{static:-static}}}" diff --git a/gcc/config/kfreebsdgnu.h b/gcc/config/kfreebsdgnu.h new file mode 100644 index 00000000000..59a68295c2a --- /dev/null +++ b/gcc/config/kfreebsdgnu.h @@ -0,0 +1,41 @@ +/* Definitions for GNU/KFreeBSD systems with ELF format. + Copyright (C) 2002 Free Software Foundation, Inc. + Contributed by Bruno Haible. + +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. */ + +#undef WCHAR_TYPE +#define WCHAR_TYPE "int" + +#undef TARGET_OS_CPP_BUILTINS +#define TARET_OS_CPP_BUILTINS() \ + builtin_define ("__GNU_KFreeBSD__=0"); \ + builtin_define ("__gnu_kfreebsd__=0"); \ + builtin_define ("__FreeBSD_kernel__=5"); \ + builtin_define ("__ELF__"); \ + builtin_define_std ("unix"); \ + builtin_assert ("system=posix"); + +#undef TARGET_CPU_CPP_BUILTINS +#define TARGET_CPU_CPP_BUILTINS() \ + builtin_define ("__i386__"); \ + builtin_define_std ("i386"); \ + builtin_assert ("cpu=i386"); \ + builtin_assert ("machine=i386"); + +/* do {} while (0) */ diff --git a/gcc/config/t-kfreebsd-gnu b/gcc/config/t-kfreebsd-gnu new file mode 100644 index 00000000000..a40dc7a568a --- /dev/null +++ b/gcc/config/t-kfreebsd-gnu @@ -0,0 +1,16 @@ +# glibc provides a limits.h, which must be combined with gcc's limits.h. +LIMITS_H_TEST = true + +# Compile crtbeginS.o and crtendS.o with pic. +CRTSTUFF_T_CFLAGS_S = -fPIC +# Compile libgcc2.a with pic. +TARGET_LIBGCC2_CFLAGS = -fPIC + +# Override t-slibgcc-elf-ver to export some libgcc symbols with +# the symbol versions that glibc used. +SHLIB_MAPFILES += $(srcdir)/config/libgcc-glibc.ver + +# Use unwind-dw2-fde-glibc +LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c \ + $(srcdir)/unwind-sjlj.c +LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c