Added support for machine powerpc-*-haiku. Reorganized things a bit:

The i386-pc-haiku no longer uses the BeOS BFD target emulation, but
its own. A few things are shared for both *-*-haiku machines now.
The PowerPC Haiku binutils and gcc build, but I wouldn't expect them
to really produce usable output yet. We'll see...


git-svn-id: file:///srv/svn/repos/haiku/buildtools/trunk@15381 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2005-12-06 22:39:47 +00:00
parent 59eda489cd
commit 8c840510db
13 changed files with 236 additions and 97 deletions

View File

@ -1024,6 +1024,9 @@ case "${targ}" in
targ_selvecs="mach_o_be_vec mach_o_le_vec mach_o_fat_vec pef_vec pef_xlib_vec sym_vec"
targ_archs="bfd_powerpc_arch bfd_rs6000_arch bfd_i386_arch"
;;
powerpc-*-haiku*)
targ_defvec=bfd_elf32_powerpc_vec
;;
powerpc-*-macos*)
targ_defvec=pmac_xcoff_vec
;;

View File

@ -189,7 +189,9 @@ ALL_EMULATIONS = \
eelf_i386_be.o \
eelf_i386_chaos.o \
eelf_i386_fbsd.o \
eelf_i386_haiku.o \
eelf_i386_ldso.o \
eelf_ppc_haiku.o \
eelf_s390.o \
egld960.o \
egld960coff.o \
@ -861,9 +863,15 @@ eelf_i386_fbsd.c: $(srcdir)/emulparams/elf_i386_fbsd.sh \
$(srcdir)/emulparams/elf_i386.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_i386_fbsd "$(tdir_elf_i386_fbsd)"
eelf_i386_haiku.c: $(srcdir)/emulparams/elf_i386_haiku.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_i386_haiku "$(tdir_elf_i386_haiku)"
eelf_i386_ldso.c: $(srcdir)/emulparams/elf_i386_ldso.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_i386_ldso "$(tdir_elf_i386_ldso)"
eelf_ppc_haiku.c: $(srcdir)/emulparams/elf_ppc_haiku.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_ppc_haiku "$(tdir_elf_ppc_haiku)"
eelf_s390.c: $(srcdir)/emulparams/elf_s390.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_s390 "$(tdir_elf_s390)"

View File

@ -314,7 +314,9 @@ ALL_EMULATIONS = \
eelf_i386_be.o \
eelf_i386_chaos.o \
eelf_i386_fbsd.o \
eelf_i386_haiku.o \
eelf_i386_ldso.o \
eelf_ppc_haiku.o \
eelf_s390.o \
egld960.o \
egld960coff.o \
@ -1598,9 +1600,15 @@ eelf_i386_fbsd.c: $(srcdir)/emulparams/elf_i386_fbsd.sh \
$(srcdir)/emulparams/elf_i386.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_i386_fbsd "$(tdir_elf_i386_fbsd)"
eelf_i386_haiku.c: $(srcdir)/emulparams/elf_i386_haiku.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_i386_haiku "$(tdir_elf_i386_haiku)"
eelf_i386_ldso.c: $(srcdir)/emulparams/elf_i386_ldso.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_i386_ldso "$(tdir_elf_i386_ldso)"
eelf_ppc_haiku.c: $(srcdir)/emulparams/elf_ppc_haiku.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_ppc_haiku "$(tdir_elf_ppc_haiku)"
eelf_s390.c: $(srcdir)/emulparams/elf_s390.sh \
$(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
${GENSCRIPTS} elf_s390 "$(tdir_elf_s390)"

View File

@ -233,7 +233,7 @@ i[3-7]86-*-interix*) targ_emul=i386pe_posix;
targ_extra_ofiles="deffilep.o pe-dll.o" ;;
i[3-7]86-*-beospe*) targ_emul=i386beos ;;
i[3-7]86-*-beos*) targ_emul=elf_i386_be ;;
i[3-7]86-*-haiku*) targ_emul=elf_i386_be ;;
i[3-7]86-*-haiku*) targ_emul=elf_i386_haiku ;;
i[3-7]86-*-vxworks*) targ_emul=elf_i386 ;;
i[3-7]86-*-chaos) targ_emul=elf_i386_chaos ;;
m8*-*-*) targ_emul=m88kbcs ;;
@ -542,6 +542,7 @@ powerpcle-*-cygwin*) targ_emul=ppcpe ;;
powerpc-*-aix5*) targ_emul=aix5ppc ;;
powerpc-*-aix*) targ_emul=aixppc ;;
powerpc-*-beos*) targ_emul=aixppc ;;
powerpc-*-haiku*) targ_emul=elf_ppc_haiku ;;
powerpc-*-windiss*) targ_emul=elf32ppcwindiss ;;
powerpc-*-lynxos*) targ_emul=ppclynx ;;
rs6000-*-aix5*) targ_emul=aix5rs6 ;;

View File

@ -0,0 +1,11 @@
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-i386"
TEXT_START_ADDR=0x200000
NONPAGED_TEXT_START_ADDR=0x200000
MAXPAGESIZE=0x1000
ARCH=i386
MACHINE=
NOP=0x90909090
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
NO_SMALL_DATA=yes

View File

@ -0,0 +1,11 @@
SCRIPT_NAME=elf
OUTPUT_FORMAT="elf32-powerpc"
TEXT_START_ADDR=0x200000
NONPAGED_TEXT_START_ADDR=0x200000
MAXPAGESIZE=0x1000
ARCH=powerpc
MACHINE=
NOP=0x60000000
TEMPLATE_NAME=elf32
GENERATE_SHLIB_SCRIPT=yes
NO_SMALL_DATA=yes

12
gcc/configure vendored
View File

@ -1088,12 +1088,12 @@ case "${host}" in
i[3456789]86-*-beos*)
noconfigdirs="$noconfigdirs tk itcl libgui gdb"
;;
i[3456789]86-*-haiku*)
noconfigdirs="$noconfigdirs tk itcl libgui gdb"
;;
*-*-cygwin*)
noconfigdirs="$noconfigdirs autoconf automake send-pr rcs guile perl"
;;
*-*-haiku*)
noconfigdirs="$noconfigdirs tk itcl libgui gdb"
;;
*-*-netbsd*)
noconfigdirs="$noconfigdirs rcs"
;;
@ -1438,9 +1438,6 @@ case "${target}" in
i[3456789]86-*-beos*)
noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
;;
i[3456789]86-*-haiku*)
noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
;;
m32r-*-*)
noconfigdirs="$noconfigdirs ${libgcj}"
;;
@ -1587,6 +1584,9 @@ case "${target}" in
ip2k-*-*)
noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}"
;;
*-*-haiku*)
noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
;;
*-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu)
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;;

View File

@ -304,7 +304,7 @@ case "${host}" in
*-*-cygwin*)
noconfigdirs="$noconfigdirs autoconf automake send-pr rcs guile perl"
;;
i[[3456789]]86-*-haiku*)
*-*-haiku*)
noconfigdirs="$noconfigdirs tk itcl libgui gdb"
;;
*-*-netbsd*)
@ -641,9 +641,6 @@ case "${target}" in
i[[3456789]]86-*-beos*)
noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
;;
i[[3456789]]86-*-haiku*)
noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
;;
m32r-*-*)
noconfigdirs="$noconfigdirs ${libgcj}"
;;
@ -790,6 +787,9 @@ case "${target}" in
ip2k-*-*)
noconfigdirs="$noconfigdirs target-libiberty target-libstdc++-v3 ${libgcj}"
;;
*-*-haiku*)
noconfigdirs="$noconfigdirs gdb target-newlib target-libgloss ${libgcj}"
;;
*-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu)
noconfigdirs="$noconfigdirs target-newlib target-libgloss"
;;

View File

@ -970,8 +970,8 @@ x86_64-*-freebsd*)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h"
;;
i[34567]86-*-haiku*)
tmake_file='i386/t-haiku i386/t-crtpic'
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h i386/haiku-elf.h"
tmake_file='t-haiku i386/t-crtpic'
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h svr4.h haiku.h i386/haiku.h"
extra_parts='crtbegin.o crtend.o'
;;
i[34567]86-*-netbsdelf*)
@ -1640,6 +1640,11 @@ powerpc-*-eabi*)
tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h"
tmake_file="rs6000/t-fprules rs6000/t-ppcgas rs6000/t-ppccomm"
;;
powerpc-*-haiku*)
tmake_file="rs6000/t-fprules rs6000/t-ppcos rs6000/t-ppccomm t-haiku"
tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h haiku.h rs6000/haiku-ppc.h"
extra_parts='crtbegin.o crtend.o'
;;
powerpc-*-rtems*)
tm_file="${tm_file} dbxelf.h elfos.h svr4.h freebsd-spec.h rs6000/sysv4.h rs6000/eabi.h rs6000/rtems.h rtems.h"
tmake_file="rs6000/t-fprules rs6000/t-rtems t-rtems rs6000/t-ppccomm"

View File

@ -1,5 +1,6 @@
/* Definitions for Intel x86 running Haiku
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004
/* Definitions of target machine for GCC.
Common Haiku definitions for all architectures.
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005
Free Software Foundation, Inc.
This file is part of GCC.
@ -20,67 +21,21 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#define TARGET_VERSION fprintf (stderr, " (i386 Haiku/ELF)");
/* Change debugging to Dwarf2. */
#undef PREFERRED_DEBUGGING_TYPE
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
/* The SVR4 ABI for the i386 says that records and unions are returned
in memory. */
#undef DEFAULT_PCC_STRUCT_RETURN
#define DEFAULT_PCC_STRUCT_RETURN 1
#undef ASM_COMMENT_START
#define ASM_COMMENT_START " #"
#undef DBX_REGISTER_NUMBER
#define DBX_REGISTER_NUMBER(n) \
(TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n])
/* Output assembler code to FILE to increment profiler label # LABELNO
for profiling a function entry. */
#undef MCOUNT_NAME
#define MCOUNT_NAME "mcount"
#undef SIZE_TYPE
#define SIZE_TYPE "long unsigned int"
#undef PTRDIFF_TYPE
#define PTRDIFF_TYPE "long int"
#undef WCHAR_TYPE
#define WCHAR_TYPE "short unsigned int"
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE 16
#define MCOUNT_NAME "_mcount"
#define TARGET_DECLSPEC 1
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
builtin_define ("__BEOS__"); \
builtin_define ("__HAIKU__"); \
builtin_define ("__INTEL__"); \
builtin_define ("_X86_"); \
builtin_define ("__stdcall=__attribute__((__stdcall__))"); \
builtin_define ("__cdecl=__attribute__((__cdecl__))"); \
builtin_assert ("system=haiku"); \
if (flag_pic) \
{ \
builtin_define ("__PIC__"); \
builtin_define ("__pic__"); \
} \
/* Haiku apparently doesn't support merging of symbols across shared \
object boundaries. Hence we need to explicitly specify that \
type_infos are not merged, so that they get compared by name \
instead of by pointer. */ \
builtin_define ("__GXX_MERGED_TYPEINFO_NAMES=0"); \
} \
while (0)
/* Haiku uses lots of multichars, so don't warn about them unless the
user explicitly asks for the warnings with -Wmultichar. Note that
CC1_SPEC is used for both cc1 and cc1plus. */
@ -91,16 +46,6 @@ Boston, MA 02111-1307, USA. */
#undef CC1PLUS_SPEC
#define CC1PLUS_SPEC "%{!Wctor-dtor-privacy:-Wno-ctor-dtor-privacy}"
/* Provide a LINK_SPEC appropriate for Haiku. Here we provide support
for the special GCC options -static and -shared, which allow us to
link things in one of these three modes by applying the appropriate
combinations of options at link-time. */
/* If ELF is the default format, we should not use /lib/elf. */
#undef LINK_SPEC
#define LINK_SPEC "%{!o*:-o %b} -m elf_i386_be -shared -Bsymbolic %{nostart:-e 0}"
/* Provide start and end file specs appropriate to glibc. */
/* LIB_SPEC for Haiku */
@ -113,33 +58,15 @@ Boston, MA 02111-1307, USA. */
#undef LIBGCC_SPEC
#define LIBGCC_SPEC ""
/* Note: There currently is no mcount.o on Haiku. In the BeOS specification
it was i386-mcount.o, but that doesn't exist in gcc 2.95.3 either. */
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "crti.o%s crtbegin.o%s %{!nostart:start_dyn.o%s} init_term_dyn.o%s %{p:i386-mcount.o%s}"
#define STARTFILE_SPEC "crti.o%s crtbegin.o%s %{!nostart:start_dyn.o%s} init_term_dyn.o%s %{p:mcount.o%s}"
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "crtend.o%s crtn.o%s"
/* A C statement (sans semicolon) to output to the stdio stream
FILE the assembler definition of uninitialized global DECL named
NAME whose size is SIZE bytes and alignment is ALIGN bytes.
Try to use asm_output_aligned_bss to implement this macro. */
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
/* A C statement to output to the stdio stream FILE an assembler
command to advance the location counter to a multiple of 1<<LOG
bytes if it is within MAX_SKIP bytes.
This is used to align code labels according to Intel recommendations. */
#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \
if ((LOG)!=0) \
if ((MAX_SKIP)==0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP))
#endif
/* For native compiler, use standard Haiku include file search paths
rooted in /boot/develop/headers. For a cross compiler, don't
expect the host to use the Haiku directory scheme, and instead look
@ -241,6 +168,3 @@ Boston, MA 02111-1307, USA. */
/* Haiku headers are C++-aware (and often use C++). */
#define NO_IMPLICIT_EXTERN_C
#undef EXTRA_SECTIONS
#define EXTRA_SECTIONS in_const, in_ctors, in_dtors, in_drectve

101
gcc/gcc/config/i386/haiku.h Normal file
View File

@ -0,0 +1,101 @@
/* Definitions for Intel x86 running Haiku
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004
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, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#define TARGET_VERSION fprintf (stderr, " (i386 Haiku/ELF)");
/* The SVR4 ABI for the i386 says that records and unions are returned
in memory. */
#undef DEFAULT_PCC_STRUCT_RETURN
#define DEFAULT_PCC_STRUCT_RETURN 1
#undef DBX_REGISTER_NUMBER
#define DBX_REGISTER_NUMBER(n) \
(TARGET_64BIT ? dbx64_register_map[n] : svr4_dbx_register_map[n])
#undef SIZE_TYPE
#define SIZE_TYPE "long unsigned int"
#undef PTRDIFF_TYPE
#define PTRDIFF_TYPE "long int"
#undef WCHAR_TYPE
#define WCHAR_TYPE "short unsigned int"
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE 16
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
builtin_define ("__BEOS__"); \
builtin_define ("__HAIKU__"); \
builtin_define ("__INTEL__"); \
builtin_define ("_X86_"); \
builtin_define ("__stdcall=__attribute__((__stdcall__))"); \
builtin_define ("__cdecl=__attribute__((__cdecl__))"); \
builtin_assert ("system=haiku"); \
if (flag_pic) \
{ \
builtin_define ("__PIC__"); \
builtin_define ("__pic__"); \
} \
/* Haiku apparently doesn't support merging of symbols across shared \
object boundaries. Hence we need to explicitly specify that \
type_infos are not merged, so that they get compared by name \
instead of by pointer. */ \
builtin_define ("__GXX_MERGED_TYPEINFO_NAMES=0"); \
} \
while (0)
/* Provide a LINK_SPEC appropriate for Haiku. Here we provide support
for the special GCC options -static and -shared, which allow us to
link things in one of these three modes by applying the appropriate
combinations of options at link-time. */
/* If ELF is the default format, we should not use /lib/elf. */
#undef LINK_SPEC
#define LINK_SPEC "%{!o*:-o %b} -m elf_i386_haiku -shared -Bsymbolic %{nostart:-e 0}"
/* A C statement (sans semicolon) to output to the stdio stream
FILE the assembler definition of uninitialized global DECL named
NAME whose size is SIZE bytes and alignment is ALIGN bytes.
Try to use asm_output_aligned_bss to implement this macro. */
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
/* A C statement to output to the stdio stream FILE an assembler
command to advance the location counter to a multiple of 1<<LOG
bytes if it is within MAX_SKIP bytes.
This is used to align code labels according to Intel recommendations. */
#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \
if ((LOG)!=0) \
if ((MAX_SKIP)==0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP))
#endif
#undef EXTRA_SECTIONS
#define EXTRA_SECTIONS in_const, in_ctors, in_dtors, in_drectve

View File

@ -0,0 +1,67 @@
/* Definitions for PowerPC running Haiku
Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005
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, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#undef TARGET_VERSION
#define TARGET_VERSION fprintf (stderr, " (PowerPC Haiku/ELF)");
#undef SIZE_TYPE
#define SIZE_TYPE "long unsigned int"
#undef PTRDIFF_TYPE
#define PTRDIFF_TYPE "long int"
#undef WCHAR_TYPE
#define WCHAR_TYPE "short unsigned int"
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE 16
#undef TARGET_OS_CPP_BUILTINS
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
builtin_define ("__BEOS__"); \
builtin_define ("__HAIKU__"); \
builtin_define ("__POWERPC__"); \
builtin_define ("__stdcall=__attribute__((__stdcall__))"); \
builtin_define ("__cdecl=__attribute__((__cdecl__))"); \
builtin_assert ("system=haiku"); \
builtin_assert ("cpu=powerpc"); \
builtin_assert ("machine=powerpc"); \
TARGET_OS_SYSV_CPP_BUILTINS (); \
/* Haiku apparently doesn't support merging of symbols across shared \
object boundaries. Hence we need to explicitly specify that \
type_infos are not merged, so that they get compared by name \
instead of by pointer. */ \
builtin_define ("__GXX_MERGED_TYPEINFO_NAMES=0"); \
} \
while (0)
/* Provide a LINK_SPEC appropriate for Haiku. Here we provide support
for the special GCC options -static and -shared, which allow us to
link things in one of these three modes by applying the appropriate
combinations of options at link-time. */
/* If ELF is the default format, we should not use /lib/elf. */
#undef LINK_SPEC
#define LINK_SPEC "%{!o*:-o %b} -m elf_ppc_haiku -shared -Bsymbolic %{nostart:-e 0}"