| 1 | /* Definitions for AMD x86_64 running Haiku with ELF format. |
| 2 | Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 |
| 3 | Free Software Foundation, Inc. |
| 4 | |
| 5 | This file is part of GCC. |
| 6 | |
| 7 | GCC is free software; you can redistribute it and/or modify |
| 8 | it under the terms of the GNU General Public License as published by |
| 9 | the Free Software Foundation; either version 2, or (at your option) |
| 10 | any later version. |
| 11 | |
| 12 | GCC is distributed in the hope that it will be useful, |
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | GNU General Public License for more details. |
| 16 | |
| 17 | You should have received a copy of the GNU General Public License |
| 18 | along with GCC; see the file COPYING. If not, write to |
| 19 | the Free Software Foundation, 59 Temple Place - Suite 330, |
| 20 | Boston, MA 02111-1307, USA. */ |
| 21 | |
| 22 | |
| 23 | #if TARGET_64BIT_DEFAULT |
| 24 | #define TARGET_VERSION fprintf (stderr, " (x86-64 Haiku/ELF)"); |
| 25 | #else |
| 26 | #define TARGET_VERSION fprintf (stderr, " (i386 Haiku/ELF)"); |
| 27 | #endif |
| 28 | |
| 29 | /* The SVR4 ABI for the i386 says that records and unions are returned |
| 30 | * in memory. |
| 31 | * |
| 32 | * TODO: Linux64 doesn't use pcc_struct_return scheme. Does haiku? |
| 33 | * If not this could be removed. |
| 34 | */ |
| 35 | #undef DEFAULT_PCC_STRUCT_RETURN |
| 36 | #define DEFAULT_PCC_STRUCT_RETURN 1 |
| 37 | |
| 38 | #define TARGET_OS_CPP_BUILTINS() \ |
| 39 | do \ |
| 40 | { \ |
| 41 | builtin_define ("__HAIKU__"); \ |
| 42 | builtin_define ("__stdcall=__attribute__((__stdcall__))"); \ |
| 43 | builtin_define ("__cdecl=__attribute__((__cdecl__))"); \ |
| 44 | builtin_assert ("system=haiku"); \ |
| 45 | /* Haiku apparently doesn't support merging of symbols across shared \ |
| 46 | object boundaries. Hence we need to explicitly specify that \ |
| 47 | type_infos are not merged, so that they get compared by name \ |
| 48 | instead of by pointer. */ \ |
| 49 | builtin_define ("__GXX_MERGED_TYPEINFO_NAMES=0"); \ |
| 50 | builtin_define ("__GXX_TYPEINFO_EQUALITY_INLINE=0"); \ |
| 51 | } \ |
| 52 | while (0) |
| 53 | |
| 54 | /* Provide a LINK_SPEC appropriate for Haiku. Here we provide support |
| 55 | for the special GCC options -static and -shared, which allow us to |
| 56 | link things in one of these three modes by applying the appropriate |
| 57 | combinations of options at link-time. */ |
| 58 | |
| 59 | #undef LINK_SPEC |
| 60 | #define LINK_SPEC "-m elf_x86_64_haiku -shared -Bsymbolic %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}" |
| 61 | |