summaryrefslogtreecommitdiff
path: root/m68k-unknown-amigaos/recipes/files/gcc/gcc/config
diff options
context:
space:
mode:
Diffstat (limited to 'm68k-unknown-amigaos/recipes/files/gcc/gcc/config')
-rw-r--r--m68k-unknown-amigaos/recipes/files/gcc/gcc/config/m68k/amigaos-protos.h45
-rw-r--r--m68k-unknown-amigaos/recipes/files/gcc/gcc/config/m68k/amigaos.c726
-rw-r--r--m68k-unknown-amigaos/recipes/files/gcc/gcc/config/m68k/amigaos.h698
-rw-r--r--m68k-unknown-amigaos/recipes/files/gcc/gcc/config/m68k/host-amigaos.c42
-rw-r--r--m68k-unknown-amigaos/recipes/files/gcc/gcc/config/m68k/t-amigaos36
-rw-r--r--m68k-unknown-amigaos/recipes/files/gcc/gcc/config/m68k/x-amigaos104
-rw-r--r--m68k-unknown-amigaos/recipes/files/gcc/gcc/config/m68k/xm-amigaos.h64
7 files changed, 1715 insertions, 0 deletions
diff --git a/m68k-unknown-amigaos/recipes/files/gcc/gcc/config/m68k/amigaos-protos.h b/m68k-unknown-amigaos/recipes/files/gcc/gcc/config/m68k/amigaos-protos.h
new file mode 100644
index 0000000..f7f7e97
--- /dev/null
+++ b/m68k-unknown-amigaos/recipes/files/gcc/gcc/config/m68k/amigaos-protos.h
@@ -0,0 +1,45 @@
+/* Configuration for GNU C-compiler for m68k Amiga, running AmigaOS.
+ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2003
+ Free Software Foundation, Inc.
+ Contributed by Markus M. Wild (wild@amiga.physik.unizh.ch).
+ Heavily modified by Kamil Iskra (iskra@student.uci.agh.edu.pl).
+
+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. */
+
+extern int amigaos_restore_a4 (void);
+#ifdef RTX_CODE
+extern int read_only_operand (rtx);
+extern void amigaos_select_section (tree, int, unsigned HOST_WIDE_INT);
+extern void amigaos_encode_section_info (tree, rtx, int);
+extern void amigaos_alternate_pic_setup (FILE *);
+extern void amigaos_prologue_begin_hook (FILE *, int);
+extern void amigaos_alternate_frame_setup_f (FILE *, int);
+extern void amigaos_alternate_frame_setup (FILE *, int);
+extern struct rtx_def* gen_stack_cleanup_call (rtx, rtx);
+extern void amigaos_alternate_allocate_stack (rtx *);
+#ifdef TREE_CODE
+extern void amigaos_init_cumulative_args (CUMULATIVE_ARGS *, tree);
+/* extern void amigaos_function_arg_advance (CUMULATIVE_ARGS *); */
+extern struct rtx_def *amigaos_function_arg (CUMULATIVE_ARGS *, enum machine_mode, tree);
+#endif
+#endif
+#ifdef TREE_CODE
+extern tree amigaos_handle_decl_attribute (tree *, tree, tree, int, bool *);
+extern tree amigaos_handle_type_attribute (tree *, tree, tree, int, bool *);
+extern int amigaos_comp_type_attributes (tree, tree);
+#endif
diff --git a/m68k-unknown-amigaos/recipes/files/gcc/gcc/config/m68k/amigaos.c b/m68k-unknown-amigaos/recipes/files/gcc/gcc/config/m68k/amigaos.c
new file mode 100644
index 0000000..3b1782c
--- /dev/null
+++ b/m68k-unknown-amigaos/recipes/files/gcc/gcc/config/m68k/amigaos.c
@@ -0,0 +1,726 @@
+/* Configuration for GNU C-compiler for m68k Amiga, running AmigaOS.
+ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2003
+ Free Software Foundation, Inc.
+ Contributed by Markus M. Wild (wild@amiga.physik.unizh.ch).
+ Heavily modified by Kamil Iskra (iskra@student.uci.agh.edu.pl).
+
+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. */
+
+//work without flag_writable_strings which is not in GCC4
+//#include "config/m68k/amigaos.h"
+#define REGPARMS_68K 1
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "rtl.h"
+#include "output.h"
+#include "tree.h"
+#include "flags.h"
+#include "expr.h"
+#include "toplev.h"
+#include "tm_p.h"
+
+static int amigaos_put_in_text (tree);
+static rtx gen_stack_management_call (rtx, rtx, const char *);
+int m68k_regparm;
+/* Baserel support. */
+
+/* Does operand (which is a symbolic_operand) live in text space? If
+ so SYMBOL_REF_FLAG, which is set by ENCODE_SECTION_INFO, will be true.
+
+ This function is used in base relative code generation. */
+
+int
+read_only_operand (rtx operand)
+{
+ if (GET_CODE (operand) == CONST)
+ operand = XEXP (XEXP (operand, 0), 0);
+ if (GET_CODE (operand) == SYMBOL_REF)
+ return SYMBOL_REF_FLAG (operand) || CONSTANT_POOL_ADDRESS_P (operand);
+ return 1;
+}
+
+/* Choose the section to use for DECL. RELOC is true if its value contains
+ any relocatable expression. */
+
+void
+amigaos_select_section (tree decl, int reloc,
+ unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED)
+{
+ // if (TREE_CODE (decl) == STRING_CST)
+// {
+//// flag_writable_strings /data_section not in gcc4,
+////make life easy and put to same section
+//// if (! flag_writable_strings)
+//// readonly_data_section ();
+//// else
+// //data_section ();
+// }
+// else if (TREE_CODE (decl) == VAR_DECL)
+// {
+// if (TREE_READONLY (decl)
+// && ! TREE_THIS_VOLATILE (decl)
+// && DECL_INITIAL (decl)
+// && (DECL_INITIAL (decl) == error_mark_node
+// || TREE_CONSTANT (DECL_INITIAL (decl)))
+// && (!flag_pic || (flag_pic<3 && !reloc)
+// || SYMBOL_REF_FLAG (XEXP (DECL_RTL (decl), 0))))
+// readonly_data_section ();
+// else
+// data_section ();
+// }
+// else if ((!flag_pic || (flag_pic<3 && !reloc)) && DECL_P(decl)
+// && SYMBOL_REF_FLAG (XEXP (DECL_RTL (decl), 0)))
+// readonly_data_section ();
+// else
+ //data_section ();
+}
+
+/* This function is used while generating a base relative code.
+ It returns 1 if a decl is not relocatable, i. e., if it can be put
+ in the text section.
+ Currently, it's very primitive: it just checks if the object size
+ is less than 4 bytes (i. e., if it can hold a pointer). It also
+ supports arrays and floating point types. */
+
+static int
+amigaos_put_in_text (tree decl)
+{
+ tree type = TREE_TYPE (decl);
+ if (TREE_CODE (type) == ARRAY_TYPE)
+ type = TREE_TYPE (type);
+ return (TREE_INT_CST_HIGH (TYPE_SIZE (type)) == 0
+ && TREE_INT_CST_LOW (TYPE_SIZE (type)) < 32)
+ || FLOAT_TYPE_P (type);
+}
+
+/* Record properties of a DECL into the associated SYMBOL_REF. */
+
+void
+amigaos_encode_section_info (tree decl, rtx rtl, int first)
+{
+ default_encode_section_info (decl, rtl, first);
+
+
+ SYMBOL_REF_FLAG (XEXP (rtl, 0)) = 1;
+ //if (TREE_CODE (decl) == FUNCTION_DECL) // huh seem do same. not in gcc4 flag_writable_strings
+// SYMBOL_REF_FLAG (XEXP (rtl, 0)) = 1;
+// else
+// {
+// if ((RTX_UNCHANGING_P (rtl) && !MEM_VOLATILE_P (rtl)
+// && (flag_pic<3 || (TREE_CODE (decl) == STRING_CST
+// && !flag_writable_strings)
+// || amigaos_put_in_text (decl)))
+// || (TREE_CODE (decl) == VAR_DECL
+// && DECL_SECTION_NAME (decl) != NULL_TREE))
+// SYMBOL_REF_FLAG (XEXP (rtl, 0)) = 1;
+// }
+}
+
+/* Common routine used to check if a4 should be preserved/restored. */
+
+int
+amigaos_restore_a4 (void)
+{
+ return (flag_pic >= 3 &&
+ (TARGET_RESTORE_A4 || TARGET_ALWAYS_RESTORE_A4
+ || lookup_attribute ("saveds",
+ TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl)))));
+}
+
+void
+amigaos_alternate_pic_setup (FILE *stream)
+{
+ if (TARGET_RESTORE_A4 || TARGET_ALWAYS_RESTORE_A4)
+ asm_fprintf (stream, "\tjbsr %U__restore_a4\n");
+ else if (lookup_attribute ("saveds",
+ TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl))))
+ asm_fprintf (stream, "\tlea %U__a4_init,%Ra4\n");
+}
+
+/* Attributes support. */
+
+#define AMIGA_CHIP_SECTION_NAME ".datachip"
+
+/* Handle a "chip" attribute;
+ arguments as in struct attribute_spec.handler. */
+
+tree
+amigaos_handle_decl_attribute (tree *node, tree name,
+ tree args ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED,
+ bool *no_add_attrs)
+{
+ if (TREE_CODE (*node) == VAR_DECL)
+ {
+ if (is_attribute_p ("chip", name))
+#ifdef TARGET_ASM_NAMED_SECTION
+ {
+ if (! TREE_STATIC (*node) && ! DECL_EXTERNAL (*node))
+ error ("`chip' attribute cannot be specified for local variables");
+ else
+ {
+ /* The decl may have already been given a section attribute from
+ a previous declaration. Ensure they match. */
+ if (DECL_SECTION_NAME (*node) == NULL_TREE)
+ DECL_SECTION_NAME (*node) =
+ build_string (strlen (AMIGA_CHIP_SECTION_NAME) + 1,
+ AMIGA_CHIP_SECTION_NAME);
+ else if (strcmp (TREE_STRING_POINTER (DECL_SECTION_NAME (*node)),
+ AMIGA_CHIP_SECTION_NAME) != 0)
+ {
+ error_with_decl (*node,
+ "`chip' for `%s' conflicts with previous declaration");
+ }
+ }
+ }
+#else
+ error ("`chip' attribute is not supported for this target");
+#endif
+ }
+ else
+ {
+ warning ("`%s' attribute only applies to variables",
+ IDENTIFIER_POINTER (name));
+ *no_add_attrs = true;
+ }
+
+ return NULL_TREE;
+}
+
+//----- from 68k.c start
+
+
+
+
+
+/* Handle a "regparm" or "stkparm" attribute;
+ arguments as in struct attribute_spec.handler. */
+
+
+static tree
+m68k_handle_type_attribute (tree *node, tree name, tree args,
+ int flags ATTRIBUTE_UNUSED, bool *no_add_attrs)
+{
+
+ if (TREE_CODE (*node) == FUNCTION_TYPE || TREE_CODE (*node) == METHOD_TYPE)
+ {
+ /* 'regparm' accepts one optional argument - number of registers in
+ single class that should be used to pass arguments. */
+ if (is_attribute_p ("regparm_x", name))
+ {
+ if (lookup_attribute ("stkparm_x", TYPE_ATTRIBUTES(*node)))
+ {
+ error ("`regparm' and `stkparm' are mutually exclusive");
+ }
+ if (args && TREE_CODE (args) == TREE_LIST)
+ {
+ tree numofregs = TREE_VALUE (args);
+ if (numofregs)
+ if (TREE_CODE (numofregs) != INTEGER_CST
+/*
+ || compare_tree_int(numofregs, 1) < 0
+ || compare_tree_int(numofregs, M68K_MAX_REGPARM) > 0)
+*/
+ || TREE_INT_CST_HIGH (numofregs)
+ || TREE_INT_CST_LOW (numofregs) < 1
+ || TREE_INT_CST_LOW (numofregs) > M68K_MAX_REGPARM)
+ {
+ error ("invalid argument to `regparm' attribute");
+ }
+ }
+ }
+ else if (is_attribute_p ("stkparm_x", name))
+ {
+ if (lookup_attribute ("regparm_x", TYPE_ATTRIBUTES(*node)))
+ {
+ error ("`regparm' and `stkparm' are mutually exclusive");
+ }
+ }
+ }
+ else
+ {
+ warning ("`%s' attribute only applies to functions",
+ IDENTIFIER_POINTER (name));
+ *no_add_attrs = true;
+ }
+
+ return NULL_TREE;
+}
+
+/* Return zero if the attributes on TYPE1 and TYPE2 are incompatible,
+ one if they are compatible, and two if they are nearly compatible
+ (which causes a warning to be generated). */
+
+static int
+m68k_comp_type_attributes (tree type1, tree type2)
+{
+
+ /* Functions or methods are incompatible if they specify mutually
+ exclusive ways of passing arguments. */
+ if (TREE_CODE (type1) == FUNCTION_TYPE || TREE_CODE (type1) == METHOD_TYPE)
+ {
+ tree arg1, arg2;
+ if (!! lookup_attribute ("stkparm_x", TYPE_ATTRIBUTES (type1)) !=
+ !! lookup_attribute ("stkparm_x", TYPE_ATTRIBUTES (type2))
+ || !! lookup_attribute ("regparm_x", TYPE_ATTRIBUTES (type1)) !=
+ !! lookup_attribute ("regparm_x", TYPE_ATTRIBUTES (type2)))
+ return 0; /* 'regparm' and 'stkparm' are mutually exclusive. */
+
+ arg1 = lookup_attribute ("regparm_x", TYPE_ATTRIBUTES (type1));
+ arg2 = lookup_attribute ("regparm_x", TYPE_ATTRIBUTES (type2));
+ if (arg1 && arg2)
+ {
+ int num1 = 0, num2 = 0;
+ if (TREE_VALUE (arg1) && TREE_CODE (TREE_VALUE (arg1)) == TREE_LIST)
+ {
+ tree numofregs = TREE_VALUE (TREE_VALUE (arg1));
+ if (numofregs)
+ num1 = TREE_INT_CST_LOW (numofregs);
+ }
+ if (TREE_VALUE (arg2) && TREE_CODE (TREE_VALUE (arg2)) == TREE_LIST)
+ {
+ tree numofregs = TREE_VALUE (TREE_VALUE (arg2));
+ if (numofregs)
+ num2 = TREE_INT_CST_LOW (numofregs);
+ }
+ if (num1 != num2)
+ return 0; /* Different numbers, or no number in one type. */
+ }
+ }
+#ifdef TARGET_AMIGAOS
+ return amigaos_comp_type_attributes(type1, type2);
+#else
+ return 1;
+#endif
+}
+
+/* Argument-passing support functions. */
+
+/* Initialize a variable CUM of type CUMULATIVE_ARGS
+ for a call to a function whose data type is FNTYPE.
+ For a library call, FNTYPE is 0. */
+
+void
+m68k_init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype)
+{
+ cum->last_arg_reg = -1;
+ cum->regs_already_used = 0;
+ if (fntype)
+ {
+ if (lookup_attribute ("stkparm_x", TYPE_ATTRIBUTES (fntype)))
+ cum->num_of_regs = 0;
+ else
+ {
+ tree ratree = lookup_attribute ("regparm_x", TYPE_ATTRIBUTES (fntype));
+ if (ratree)
+ {
+ cum->num_of_regs = m68k_regparm ? m68k_regparm
+ : M68K_DEFAULT_REGPARM;
+ if (TREE_VALUE (ratree)
+ && TREE_CODE (TREE_VALUE (ratree)) == TREE_LIST)
+ {
+ tree num_of_regs = TREE_VALUE (TREE_VALUE (ratree));
+ cum->num_of_regs =
+ num_of_regs ? TREE_INT_CST_LOW (num_of_regs) :
+ (m68k_regparm ? m68k_regparm : M68K_DEFAULT_REGPARM);
+ }
+ }
+ else
+ cum->num_of_regs = m68k_regparm;
+ }
+ }
+ else /* Libcall. */
+ cum->num_of_regs = 0;
+
+ if (cum->num_of_regs)
+ {
+ /* If this is a vararg call, put all arguments on stack. */
+ tree param, next_param;
+ for (param = TYPE_ARG_TYPES (fntype); param; param = next_param)
+ {
+ next_param = TREE_CHAIN (param);
+ if (!next_param && TREE_VALUE (param) != void_type_node)
+ cum->num_of_regs = 0;
+ }
+ }
+
+#if ! defined (PCC_STATIC_STRUCT_RETURN) && defined (M68K_STRUCT_VALUE_REGNUM)
+ /* If return value is a structure, and we pass the buffer address in a
+ register, we can't use this register for our own purposes.
+ FIXME: Something similar would be useful for static chain. */
+ if (fntype && aggregate_value_p (TREE_TYPE (fntype), fntype))
+ cum->regs_already_used |= (1 << M68K_STRUCT_VALUE_REGNUM);
+#endif
+}
+
+/* Update the data in CUM to advance over an argument. */
+
+void
+m68k_function_arg_advance (CUMULATIVE_ARGS *cum)
+{
+ if (cum->last_arg_reg != -1)
+ {
+ int count;
+ for (count = 0; count < cum->last_arg_len; count++)
+ cum->regs_already_used |= (1 << (cum->last_arg_reg + count));
+ cum->last_arg_reg = -1;
+ }
+}
+
+/* Define where to put the arguments to a function.
+ Value is zero to push the argument on the stack,
+ or a hard register in which to store the argument.
+
+ MODE is the argument's machine mode.
+ TYPE is the data type of the argument (as a tree).
+ This is null for libcalls where that information may
+ not be available.
+ CUM is a variable of type CUMULATIVE_ARGS which gives info about
+ the preceding args and about the function being called. */
+
+struct rtx_def *
+m68k_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type)
+{
+ if (cum->num_of_regs)
+ {
+ int regbegin = -1, altregbegin = -1, len;
+
+ /* FIXME: The last condition below is a workaround for a bug. */
+ if (TARGET_68881 && FLOAT_MODE_P (mode) &&
+ GET_MODE_UNIT_SIZE (mode) <= 12 &&
+ (GET_MODE_CLASS (mode) != MODE_COMPLEX_FLOAT || mode == SCmode))
+ {
+ regbegin = 16; /* FPx */
+ len = GET_MODE_NUNITS (mode);
+ }
+ /* FIXME: Two last conditions below are workarounds for bugs. */
+ else if (INTEGRAL_MODE_P (mode) && mode !=CQImode && mode != CHImode)
+ {
+ if (POINTER_TYPE_P (type))
+ regbegin = 8; /* Ax */
+ else
+ regbegin = 0; /* Dx */
+ altregbegin = 8 - regbegin;
+ len = (GET_MODE_SIZE (mode) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD;
+ }
+
+ if (regbegin != -1)
+ {
+ int reg;
+ long mask;
+
+look_for_reg:
+ mask = 1 << regbegin;
+ for (reg = 0; reg < cum->num_of_regs; reg++, mask <<= 1)
+ if (!(cum->regs_already_used & mask))
+ {
+ int end;
+ for (end = reg; end < cum->num_of_regs && end < reg + len;
+ end++, mask <<= 1)
+ if (cum->regs_already_used & mask)
+ break;
+ if (end == reg + len)
+ {
+ cum->last_arg_reg = reg + regbegin;
+ cum->last_arg_len = len;
+ break;
+ }
+ }
+
+ if (reg == cum->num_of_regs && altregbegin != -1)
+ {
+ regbegin = altregbegin;
+ altregbegin = -1;
+ goto look_for_reg;
+ }
+ }
+
+ if (cum->last_arg_reg != -1)
+ return gen_rtx_REG (mode, cum->last_arg_reg);
+ }
+ return 0;
+}
+
+// end from 68k.h diff
+
+/* Handle a "stackext", "interrupt" or "saveds" attribute;
++ arguments as in struct attribute_spec.handler. */
+
+tree
+amigaos_handle_type_attribute (tree *node, tree name,
+ tree args ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED,
+ bool *no_add_attrs)
+{
+ if (TREE_CODE (*node) == FUNCTION_TYPE || TREE_CODE (*node) == METHOD_TYPE)
+ {
+ if (is_attribute_p ("stackext", name))
+ {
+ if (lookup_attribute ("interrupt", TYPE_ATTRIBUTES(*node)))
+ {
+ error ("`stackext' and `interrupt' are mutually exclusive");
+ }
+ }
+ else if (is_attribute_p ("interrupt", name))
+ {
+ if (lookup_attribute ("stackext", TYPE_ATTRIBUTES(*node)))
+ {
+ error ("`stackext' and `interrupt' are mutually exclusive");
+ }
+ }
+ else if (is_attribute_p ("saveds", name))
+ {
+ }
+ }
+ else
+ {
+ warning ("`%s' attribute only applies to functions",
+ IDENTIFIER_POINTER (name));
+ *no_add_attrs = true;
+ }
+
+ return NULL_TREE;
+}
+
+/* Stack checking and automatic extension support. */
+
+void
+amigaos_prologue_begin_hook (FILE *stream, int fsize)
+{
+ if (TARGET_STACKCHECK)
+ {
+ if (fsize < 256)
+ asm_fprintf (stream, "\tcmpl %s,%Rsp\n"
+ "\tjcc 0f\n"
+ "\tjra %U__stkovf\n"
+ "\t0:\n",
+ (flag_pic == 3 ? "a4@(___stk_limit:W)" :
+ (flag_pic == 4 ? "a4@(___stk_limit:L)" :
+ "___stk_limit")));
+ else
+ asm_fprintf (stream, "\tmovel %I%d,%Rd0\n\tjbsr %U__stkchk_d0\n",
+ fsize);
+ }
+}
+
+void
+amigaos_alternate_frame_setup_f (FILE *stream, int fsize)
+{
+ if (fsize < 128)
+ asm_fprintf (stream, "\tcmpl %s,%Rsp\n"
+ "\tjcc 0f\n"
+ "\tmoveq %I%d,%Rd0\n"
+ "\tmoveq %I0,%Rd1\n"
+ "\tjbsr %U__stkext_f\n"
+ "0:\tlink %Ra5,%I%d:W\n",
+ (flag_pic == 3 ? "a4@(___stk_limit:W)" :
+ (flag_pic == 4 ? "a4@(___stk_limit:L)" :
+ "___stk_limit")),
+ fsize, -fsize);
+ else
+ asm_fprintf (stream, "\tmovel %I%d,%Rd0\n\tjbsr %U__link_a5_d0_f\n",
+ fsize);
+}
+
+void
+amigaos_alternate_frame_setup (FILE *stream, int fsize)
+{
+ if (!fsize)
+ asm_fprintf (stream, "\tcmpl %s,%Rsp\n"
+ "\tjcc 0f\n"
+ "\tmoveq %I0,%Rd0\n"
+ "\tmoveq %I0,%Rd1\n"
+ "\tjbsr %U__stkext_f\n"
+ "0:\n",
+ (flag_pic == 3 ? "a4@(___stk_limit:W)" :
+ (flag_pic == 4 ? "a4@(___stk_limit:L)" :
+ "___stk_limit")));
+ else if (fsize < 128)
+ asm_fprintf (stream, "\tcmpl %s,%Rsp\n"
+ "\tjcc 0f\n"
+ "\tmoveq %I%d,%Rd0\n"
+ "\tmoveq %I0,%Rd1\n"
+ "\tjbsr %U__stkext_f\n"
+ "0:\taddw %I%d,%Rsp\n",
+ (flag_pic == 3 ? "a4@(___stk_limit:W)" :
+ (flag_pic == 4 ? "a4@(___stk_limit:L)" :
+ "___stk_limit")),
+ fsize, -fsize);
+ else
+ asm_fprintf (stream, "\tmovel %I%d,%Rd0\n\tjbsr %U__sub_d0_sp_f\n",
+ fsize);
+}
+
+//static rtx
+//gen_stack_management_call (rtx stack_pointer, rtx arg, const char *func)
+//{
+// rtx call_insn, call, seq, name;
+// start_sequence ();
+//
+// /* Move arg to d0. */
+// emit_move_insn (gen_rtx_REG (SImode, 0), arg);
+//
+// /* Generate the function reference. */
+// name = gen_rtx_SYMBOL_REF (Pmode, func);
+// SYMBOL_REF_FLAG (name) = 1;
+// /* If optimizing, put it in a psedo so that several loads can be merged
+// into one. */
+// if (optimize && ! flag_no_function_cse)
+// name = copy_to_reg (name);
+//
+// /* Generate the function call. */
+// call = gen_rtx_CALL (VOIDmode, gen_rtx_MEM (FUNCTION_MODE, name),
+// const0_rtx);
+// /* If we are doing stack extension, notify about the sp change. */
+// if (stack_pointer)
+// call = gen_rtx_SET (VOIDmode, stack_pointer, call);
+//
+// /* Generate the call instruction. */
+// call_insn = emit_call_insn (call);
+// /* Stack extension does not change memory in an unpredictable way. */
+// RTL_CONST_OR_PURE_CALL_P (call_insn) = 1;
+// /* We pass an argument in d0. */
+// CALL_INSN_FUNCTION_USAGE (call_insn) = gen_rtx_EXPR_LIST (VOIDmode,
+// gen_rtx_USE (VOIDmode, gen_rtx_REG (SImode, 0)), 0);
+//
+// seq = get_insns ();
+// end_sequence ();
+// return seq;
+//}
+//
+//rtx
+//gen_stack_cleanup_call (rtx stack_pointer, rtx sa)
+//{
+// return gen_stack_management_call (stack_pointer, sa, "__move_d0_sp");
+//}
+//
+//void
+//amigaos_alternate_allocate_stack (rtx *operands)
+//{
+// if (TARGET_STACKEXTEND)
+// emit_insn (gen_stack_management_call (stack_pointer_rtx, operands[1],
+// "__sub_d0_sp"));
+// else
+// {
+// if (TARGET_STACKCHECK)
+// emit_insn (gen_stack_management_call (0, operands[1], "__stkchk_d0"));
+// anti_adjust_stack (operands[1]);
+// }
+// emit_move_insn (operands[0], virtual_stack_dynamic_rtx);
+//}
+
+/* begin-GG-local: explicit register specification for parameters */
+
+/* Initialize a variable CUM of type CUMULATIVE_ARGS
+ for a call to a function whose data type is FNTYPE.
+ For a library call, FNTYPE is 0. */
+
+void
+amigaos_init_cumulative_args(CUMULATIVE_ARGS *cum, tree fntype)
+{
+ m68k_init_cumulative_args(cum, fntype);
+
+ if (fntype)
+ cum->formal_type=TYPE_ARG_TYPES(fntype);
+ else /* Call to compiler-support function. */
+ cum->formal_type=0;
+}
+
+/* Update the data in CUM to advance over an argument. */
+
+void
+amigaos_function_arg_advance(CUMULATIVE_ARGS *cum)
+{
+ m68k_function_arg_advance(cum);
+
+ if (cum->formal_type)
+ cum->formal_type=TREE_CHAIN((tree)cum->formal_type);
+}
+
+/* A C expression that controls whether a function argument is passed
+ in a register, and which register. */
+
+struct rtx_def *
+amigaos_function_arg(CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type)
+{
+ tree asmtree;
+ return m68k_function_arg(cum, mode, type); // use old routine
+ if (cum->formal_type && TREE_VALUE((tree)cum->formal_type)
+ && (asmtree=lookup_attribute("asm_x",
+ TYPE_ATTRIBUTES(TREE_VALUE((tree)cum->formal_type)))))
+ {
+ int i;
+#if 0
+ /* See c-decl.c/push_parm_decl for an explanation why this doesn't work.
+ */
+ cum->last_arg_reg=TREE_INT_CST_LOW(TREE_VALUE(TREE_VALUE(asmtree)));
+#else
+ cum->last_arg_reg=TREE_INT_CST_LOW(TREE_VALUE(asmtree));
+#endif
+ cum->last_arg_len=HARD_REGNO_NREGS(cum->last_arg_reg, mode);
+
+ for (i=0; i<cum->last_arg_len; i++)
+ if (cum->regs_already_used & (1 << cum->last_arg_reg+i))
+ {
+ error("two parameters allocated for one register");
+ break;
+ }
+ return gen_rtx_REG (mode, cum->last_arg_reg);
+ }
+ else
+ return m68k_function_arg(cum, mode, type);
+}
+
+/* Return zero if the attributes on TYPE1 and TYPE2 are incompatible,
+ one if they are compatible, and two if they are nearly compatible
+ (which causes a warning to be generated). */
+
+int
+amigaos_comp_type_attributes (tree type1, tree type2)
+{
+ /* Functions or methods are incompatible if they specify mutually exclusive
+ ways of passing arguments. */
+ if (TREE_CODE(type1)==FUNCTION_TYPE || TREE_CODE(type1)==METHOD_TYPE)
+ {
+ tree arg1, arg2;
+ arg1=TYPE_ARG_TYPES(type1);
+ arg2=TYPE_ARG_TYPES(type2);
+ for (; arg1 && arg2; arg1=TREE_CHAIN(arg1), arg2=TREE_CHAIN(arg2))
+ if (TREE_VALUE(arg1) && TREE_VALUE(arg2))
+ {
+ tree asm1, asm2;
+ asm1=lookup_attribute("asm_x", TYPE_ATTRIBUTES(TREE_VALUE(arg1)));
+ asm2=lookup_attribute("asm_x", TYPE_ATTRIBUTES(TREE_VALUE(arg2)));
+ if (asm1 && asm2)
+ {
+ if (TREE_INT_CST_LOW(TREE_VALUE(asm1))!=
+ TREE_INT_CST_LOW(TREE_VALUE(asm2)))
+ return 0; /* Two different registers specified. */
+ }
+ else
+ if (asm1 || asm2)
+ return 0; /* "asm" used in only one type. */
+ }
+ }
+ return 1;
+}
+
+/* end-GG-local */
diff --git a/m68k-unknown-amigaos/recipes/files/gcc/gcc/config/m68k/amigaos.h b/m68k-unknown-amigaos/recipes/files/gcc/gcc/config/m68k/amigaos.h
new file mode 100644
index 0000000..9ea6ec7
--- /dev/null
+++ b/m68k-unknown-amigaos/recipes/files/gcc/gcc/config/m68k/amigaos.h
@@ -0,0 +1,698 @@
+/* Configuration for GNU C-compiler for m68k Amiga, running AmigaOS.
+ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2003
+ Free Software Foundation, Inc.
+ Contributed by Markus M. Wild (wild@amiga.physik.unizh.ch).
+ Heavily modified by Kamil Iskra (iskra@student.uci.agh.edu.pl).
+
+
+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. */
+
+/* use the motorola syntax, other mode is broken. */
+
+#undef TARGET_VERSION
+#define TARGET_VERSION fprintf (stderr, " (68k, Motorola syntax)")
+
+#undef MOTOROLA
+#define MOTOROLA 1
+
+/* #define IRA_COVER_CLASSES */
+
+/* disable 80 bit and 128 bit floats, dont work in libgcc */
+
+#undef LIBGCC2_HAS_XF_MODE
+#define LIBGCC2_HAS_XF_MODE 0
+
+#undef LIBGCC2_HAS_TF_MODE
+#define LIBGCC2_HAS_TF_MODE 0
+
+/* The function name __transfer_from_trampoline is not actually used.
+ The function definition just permits use of asm with operands"
+ (though the operand list is empty). */
+
+#undef TRANSFER_FROM_TRAMPOLINE
+
+
+/* Compile using the first 'm68k_regparm' data, address and float
+ registers for arguments passing. */
+/*#define SUBTARGET_OPTIONS { "regparm=", &m68k_regparm_string, \
+ N_("Use this register count to pass arguments"), 0},*/
+
+
+
+/* Nonzero if we need to generate special stack-allocating insns.
+ On most systems they are not needed.
+ When they are needed, also define ALTERNATE_ALLOCATE_STACK (see m68k.md)
+ to perform the necessary actions. */
+/* #undef TARGET_ALTERNATE_ALLOCATE_STACK
+#define TARGET_ALTERNATE_ALLOCATE_STACK 0 */
+
+
+/* Specs, switches. */
+
+/* amiga/amigaos are the new "standard" defines for the Amiga.
+ MCH_AMIGA, AMIGA, __chip etc. are used in other compilers and are
+ provided for compatibility reasons.
+ When creating shared libraries, use different 'errno'. */
+
+
+
+#undef TARGET_OS_CPP_BUILTINS
+#define TARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ builtin_define ("__chip=__attribute__((__chip__))"); \
+ builtin_define ("__saveds=__attribute__((__saveds__))"); \
+ builtin_define ("__interrupt=__attribute__((__interrupt__))"); \
+ builtin_define ("__stackext=__attribute__((__stackext__))"); \
+ builtin_define ("__regargs_x=__attribute__((__regparm__))"); \
+ builtin_define ("__stdargs_x=__attribute__((__stkparm__))"); \
+ builtin_define ("__aligned=__attribute__((__aligned__(4)))"); \
+ if (target_flags & (MASK_RESTORE_A4|MASK_ALWAYS_RESTORE_A4)) \
+ builtin_define ("errno=(*ixemul_errno)"); \
+ builtin_define_std ("amiga"); \
+ builtin_define_std ("amigaos"); \
+ builtin_define_std ("AMIGA"); \
+ builtin_define_std ("MCH_AMIGA"); \
+ builtin_assert ("system=amigaos"); \
+ } \
+ while (0)
+
+/* Inform the program which CPU we compile for. */
+
+/* #undef TARGET_CPU_CPP_BUILTINS */
+/*
+ use --with-cpu=mc68040 etc.. instead on config. code was after #define TARGET_CPU_CPP_BUILTINS()
+ if (TARGET_68040_ONLY) \
+ { \
+ if (TARGET_68060) \
+ builtin_define_std ("mc68060"); \
+ else \
+ builtin_define_std ("mc68040"); \
+ } \
+ else if (TARGET_68030 && !TARGET_68040) \
+ builtin_define_std ("mc68030"); \
+ else if (TARGET_68020) \
+ builtin_define_std ("mc68020"); \
+ builtin_define_std ("mc68000"); \
+*/
+/*
+#define TARGET_CPU_CPP_BUILTINS() \
+ do \
+ { \
+ builtin_define_std ("mc68040"); \
+ if (flag_pic > 2) \
+ { \
+ builtin_define ("__pic__"); \
+ if (flag_pic > 3) \
+ builtin_define ("__PIC__"); \
+ } \
+ builtin_assert ("cpu=m68k"); \
+ builtin_assert ("machine=m68k"); \
+ } \
+ while (0)
+*/
+/* Define __HAVE_68881__ in preprocessor according to the -m flags.
+ This will control the use of inline 68881 insns in certain macros.
+ Note: it should be set in TARGET_CPU_CPP_BUILTINS but TARGET_68881
+ isn't the same -m68881 since its also true for -m680[46]0 ...
+ Differentiate between libnix and ixemul. */
+
+#define CPP_SPEC \
+ "%{m68881:-D__HAVE_68881__}"
+/*
+ "%{noixemul:%{!ansi:%{!std=*:-Dlibnix}%{std=gnu*:-Dlibnix}} -D__libnix -D__libnix__} " \
+ "%{!noixemul:%{!ansi:%{!std=*:-Dixemul}%{std=gnu*:-Dixemul}} -D__ixemul -D__ixemul__}"
+*/
+
+/* Translate '-resident' to '-fbaserel' (they differ in linking stage only).
+ Don't put function addresses in registers for PC-relative code. */
+
+/*
+#define CC1_SPEC \
+ "%{resident:-fbaserel} " \
+ "%{resident32:-fbaserel32} " \
+ "%{msmall-code:-fno-function-cse}"
+*/
+
+/* Various -m flags require special flags to the assembler. */
+
+#undef ASM_SPEC
+#define ASM_SPEC \
+ "%(asm_cpu) %(asm_cpu_default)"
+/* %{msmall-code:-sc}" */
+
+#undef ASM_CPU_SPEC
+#define ASM_CPU_SPEC \
+ "%{m68000|mc68000:-m68010} " \
+ "%{m6802*|mc68020:-m68020} " \
+ "%{m68030} " \
+ "%{m68040} " \
+ "%{m68060}"
+
+#define ASM_CPU_DEFAULT_SPEC \
+ "%{!m680*:%{!mc680*:-m68040}}"
+
+/* If debugging, tell the linker to output amiga-hunk symbols *and* a BSD
+ compatible debug hunk.
+ Also, pass appropriate linker flavours depending on user-supplied
+ commandline options. */
+
+#define LINK_SPEC \
+ "%{g:-amiga-debug-hunk} " \
+ "%(link_cpu)"
+
+/*
+ "%{resident*:-amiga-datadata-reloc} " \
+ "%{resident|fbaserel:-m amiga_bss -fl libb} " \
+ "%{resident32|fbaserel32:-m amiga_bss -fl libb32} " \
+ "%{g:-amiga-debug-hunk} " \
+ "%(link_cpu)"
+ "%{noixemul:-fl libnix} "
+*/
+
+#define LINK_CPU_SPEC \
+ "%{m6802*|mc68020|m68030|m68040|m68060:-fl libm020} " \
+ "%{m68881:-fl libm881}"
+
+/* Choose the right startup file, depending on whether we use base relative
+ code, base relative code with automatic relocation (-resident), their
+ 32-bit versions, libnix, profiling or plain crt0.o. */
+
+#define STARTFILE_SPEC \
+ "ncrt0.o%s"
+/*
+ "%{!noixemul:" \
+ "%{fbaserel:%{!resident:bcrt0.o%s}}" \
+ "%{resident:rcrt0.o%s}" \
+ "%{fbaserel32:%{!resident32:lcrt0.o%s}}" \
+ "%{resident32:scrt0.o%s}" \
+ "%{!resident:%{!fbaserel:%{!resident32:%{!fbaserel32:" \
+ "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}}}}}" \
+ "%{noixemul:" \
+ "%{resident:libnix/nrcrt0.o%s} " \
+ "%{!resident:%{fbaserel:libnix/nbcrt0.o%s}%{!fbaserel:libnix/ncrt0.o%s}}}"
+*/
+
+/*
+#define ENDFILE_SPEC \
+ "%{noixemul:-lstubs}"
+*/
+
+/* put return values in FPU build in FP0 Reg */
+#undef FUNCTION_VALUE_REGNO_P
+#define FUNCTION_VALUE_REGNO_P(N) \
+ ((N) == D0_REG || (N) == A0_REG || (TARGET_68881 && (N) == FP0_REG))
+
+
+/* Automatically search libamiga.a for AmigaOS specific functions. Note
+ that we first search the standard C library to resolve as much as
+ possible from there, since it has names that are duplicated in libamiga.a
+ which we *don't* want from there. Then search libamiga.a for any calls
+ that were not generated inline, and finally search the standard C library
+ again to resolve any references that libamiga.a might have generated.
+ This may only be a temporary solution since it might be better to simply
+ remove the things from libamiga.a that should be pulled in from libc.a
+ instead, which would eliminate the first reference to libc.a. Note that
+ if we don't search it automatically, it is very easy for the user to try
+ to put in a -lamiga himself and get it in the wrong place, so that (for
+ example) calls like sprintf come from -lamiga rather than -lc. */
+
+#define LIB_SPEC \
+ "%{!nostdlib:-lc -lamiga -lm -lc}"
+/* "%{!noixemul:" \
+ "%{p|pg:-lc_p}" \
+ "%{!p:%{!pg:-lc -lamiga -lc}}}" \
+ "%{noixemul:" \
+ "-lnixmain -lnix -lamiga %{mstackcheck|mstackextend:-lstack}}"
+*/
+
+/* This macro defines names of additional specifications to put in the specs
+ that can be used in various specifications like CC1_SPEC. Its definition
+ is an initializer with a subgrouping for each command option.
+
+ Each subgrouping contains a string constant, that defines the
+ specification name, and a string constant that used by the GCC driver
+ program.
+
+ Do not define this macro if it does not need to do anything. */
+#undef EXTRA_SPECS
+#define EXTRA_SPECS \
+ { "asm_cpu", ASM_CPU_SPEC }, \
+ { "asm_cpu_default", ASM_CPU_DEFAULT_SPEC }, \
+ { "link_cpu", LINK_CPU_SPEC }
+
+/* Compile with stack extension. */
+
+#define MASK_STACKEXTEND 0x40000000 /* 1 << 30 */
+#define TARGET_STACKEXTEND (((target_flags & MASK_STACKEXTEND) \
+ && !lookup_attribute ("interrupt", \
+ TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl)))) \
+ || lookup_attribute ("stackext", \
+ TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl))))
+
+/* Compile with stack checking. */
+
+#define MASK_STACKCHECK 0x20000000 /* 1 << 29 */
+#define TARGET_STACKCHECK ((target_flags & MASK_STACKCHECK) \
+ && !(target_flags & MASK_STACKEXTEND) \
+ && !lookup_attribute ("interrupt", \
+ TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl))) \
+ && !lookup_attribute ("stackext", \
+ TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl))))
+
+/* Compile with a4 restoring in public functions. */
+
+#define MASK_RESTORE_A4 0x10000000 /* 1 << 28 */
+#define TARGET_RESTORE_A4 \
+ ((target_flags & MASK_RESTORE_A4) && TREE_PUBLIC (current_function_decl))
+
+/* Compile with a4 restoring in all functions. */
+
+#define MASK_ALWAYS_RESTORE_A4 0x8000000 /* 1 << 27 */
+#define TARGET_ALWAYS_RESTORE_A4 (target_flags & MASK_ALWAYS_RESTORE_A4)
+
+/* Provide a dummy entry for the '-msmall-code' switch. This is used by
+ the assembler and '*_SPEC'. */
+
+#undef SUBTARGET_SWITCHES
+#define SUBTARGET_SWITCHES \
+ { "small-code", 0, \
+ "" /* Undocumented. */ }, \
+ { "stackcheck", MASK_STACKCHECK, \
+ N_("Generate stack-check code") }, \
+ { "no-stackcheck", - MASK_STACKCHECK, \
+ N_("Do not generate stack-check code") }, \
+ { "stackextend", MASK_STACKEXTEND, \
+ N_("Generate stack-extension code") }, \
+ { "no-stackextend", - MASK_STACKEXTEND, \
+ N_("Do not generate stack-extension code") }, \
+ { "fixedstack", - (MASK_STACKCHECK|MASK_STACKEXTEND), \
+ N_("Do not generate stack-check/stack-extension code") }, \
+ { "restore-a4", MASK_RESTORE_A4, \
+ N_("Restore a4 in public functions") }, \
+ { "no-restore-a4", - MASK_RESTORE_A4, \
+ N_("Do not restore a4 in public functions") }, \
+ { "always-restore-a4", MASK_ALWAYS_RESTORE_A4, \
+ N_("Restore a4 in all functions") }, \
+ { "no-always-restore-a4", - MASK_ALWAYS_RESTORE_A4, \
+ N_("Do not restore a4 in all functions") }, \
+ { "regparm_x", MASK_REGPARM, \
+ N_("Pass arguments through registers") }, \
+ { "no-regparm_x", - MASK_REGPARM, \
+ N_("Don't pass arguments through registers") },
+
+#undef SUBTARGET_OVERRIDE_OPTIONS
+#define SUBTARGET_OVERRIDE_OPTIONS \
+do \
+ { \
+ if (!TARGET_68020 && flag_pic==4) \
+ error ("-fbaserel32 is not supported on the 68000 or 68010\n"); \
+ } \
+while (0)
+
+/* Various ABI issues. */
+
+/* This is (almost;-) BSD, so it wants DBX format. */
+
+#define DBX_DEBUGGING_INFO
+
+/* GDB goes mad if it sees the function end marker. */
+
+#define NO_DBX_FUNCTION_END 1
+
+/* Allow folding division by zero. */
+
+#define REAL_INFINITY
+
+/* Don't try using XFmode since we don't have appropriate runtime software
+ support. */
+#undef LONG_DOUBLE_TYPE_SIZE
+#define LONG_DOUBLE_TYPE_SIZE 64
+
+/* Use A5 as framepointer instead of A6, since the AmigaOS ABI requires A6
+ to be used as a shared library base pointer in direct library calls. */
+
+#undef FRAME_POINTER_REGNUM
+#define FRAME_POINTER_REGNUM 13
+
+/* We use A4 for the PIC pointer, not A5, which is the framepointer. */
+
+#undef PIC_OFFSET_TABLE_REGNUM
+#define PIC_OFFSET_TABLE_REGNUM (flag_pic ? 12 : INVALID_REGNUM)
+
+/* The AmigaOS ABI does not define how structures should be returned, so,
+ contrary to 'm68k.h', we prefer a multithread-safe solution. */
+
+#undef PCC_STATIC_STRUCT_RETURN
+
+/* Setup a default shell return value for those (gazillion..) programs that
+ (inspite of ANSI-C) declare main() to be void (or even VOID...) and thus
+ cause the shell to randomly caugh upon executing such programs (contrary
+ to Unix, AmigaOS scripts are terminated with an error if a program returns
+ with an error code above the `error' or even `failure' level
+ (which is configurable with the FAILAT command)). */
+
+/* +2004-06-24 Ulrich Weigand <uweigand@de.ibm.com>
++
++ * c-decl.c (finish_function): Do not check for DEFAULT_MAIN_RETURN.
++ * system.h (DEFAULT_MAIN_RETURN): Poison.
++ * doc/tm.texi (DEFAULT_MAIN_RETURN): Remove documentation.
++
+
+poison VAR
+#define DEFAULT_MAIN_RETURN c_expand_return (integer_zero_node)
+*/
+
+#undef WCHAR_TYPE
+#define WCHAR_TYPE "unsigned int"
+
+/* XXX: section support */
+#if 0
+/* Support sections in chip memory, currently '.datachip' only. */
+#undef TARGET_ASM_NAMED_SECTION
+#define TARGET_ASM_NAMED_SECTION amiga_named_section
+
+/* We define TARGET_ASM_NAMED_SECTION, but we don't support arbitrary sections,
+ including '.gcc_except_table', so we emulate the standard behaviour. */
+#undef TARGET_ASM_EXCEPTION_SECTION
+#define TARGET_ASM_EXCEPTION_SECTION amiga_exception_section
+
+#undef TARGET_ASM_EH_FRAME_SECTION
+#define TARGET_ASM_EH_FRAME_SECTION amiga_eh_frame_section
+#endif
+
+/* Use sjlj exceptions because dwarf work only on elf targets */
+#undef DWARF2_UNWIND_INFO
+#define DWARF2_UNWIND_INFO 0
+
+
+
+/* GAS supports alignment up to 32768 bytes. */
+#undef ASM_OUTPUT_ALIGN
+#define ASM_OUTPUT_ALIGN(FILE, LOG) \
+do \
+ { \
+ if ((LOG) == 1) \
+ fprintf ((FILE), "\t.even\n"); \
+ else \
+ fprintf ((FILE), "\t.align %d\n", (LOG)); \
+ } \
+while (0)
+
+#define MAX_OFILE_ALIGNMENT ((1 << 15)*BITS_PER_UNIT)
+
+/* Call __flush_cache() after building the trampoline: it will call
+ an appropriate OS cache-clearing routine. */
+
+#undef FINALIZE_TRAMPOLINE
+#define FINALIZE_TRAMPOLINE(TRAMP) \
+ emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__flush_cache"), \
+ 0, VOIDmode, 2, (TRAMP), Pmode, \
+ GEN_INT (TRAMPOLINE_SIZE), SImode)
+
+/* Baserel support. */
+
+/* Given that symbolic_operand(X), return TRUE if no special
+ base relative relocation is necessary */
+
+#define LEGITIMATE_BASEREL_OPERAND_P(X) \
+ (flag_pic >= 3 && read_only_operand (X))
+
+#undef LEGITIMATE_PIC_OPERAND_P
+#define LEGITIMATE_PIC_OPERAND_P(X) \
+ (! symbolic_operand (X, VOIDmode) || LEGITIMATE_BASEREL_OPERAND_P (X))
+
+/* Define this macro if references to a symbol must be treated
+ differently depending on something about the variable or
+ function named by the symbol (such as what section it is in).
+
+ The macro definition, if any, is executed immediately after the
+ rtl for DECL or other node is created.
+ The value of the rtl will be a `mem' whose address is a
+ `symbol_ref'.
+
+ The usual thing for this macro to do is to a flag in the
+ `symbol_ref' (such as `SYMBOL_REF_FLAG') or to store a modified
+ name string in the `symbol_ref' (if one bit is not enough
+ information).
+
+ On the Amiga we use this to indicate if references to a symbol should be
+ absolute or base relative. */
+
+#undef TARGET_ENCODE_SECTION_INFO
+#define TARGET_ENCODE_SECTION_INFO amigaos_encode_section_info
+
+#define LIBCALL_ENCODE_SECTION_INFO(FUN) \
+do \
+ { \
+ if (flag_pic >= 3) \
+ SYMBOL_REF_FLAG (FUN) = 1; \
+ } \
+while (0)
+
+/* Select and switch to a section for EXP. */
+
+/* #undef TARGET_ASM_SELECT_SECTION
+#define TARGET_ASM_SELECT_SECTION amigaos_select_section */
+
+/* Preserve A4 for baserel code if necessary. */
+
+#define EXTRA_SAVE_REG(REGNO) \
+do { \
+ if (flag_pic && flag_pic >= 3 && REGNO == PIC_OFFSET_TABLE_REGNUM \
+ && amigaos_restore_a4()) \
+ return true; \
+} while (0)
+
+/* Predicate for ALTERNATE_PIC_SETUP. */
+
+#define HAVE_ALTERNATE_PIC_SETUP (flag_pic >= 3)
+
+/* Make a4 point at data hunk. */
+
+#define ALTERNATE_PIC_SETUP(STREAM) \
+ (amigaos_alternate_pic_setup (STREAM))
+
+/* Attribute support. */
+
+/* Generate the test of d0 before return to set cc register in 'interrupt'
+ function. */
+
+#define EPILOGUE_END_HOOK(STREAM) \
+do \
+ { \
+ if (lookup_attribute ("interrupt", \
+ TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl)))) \
+ asm_fprintf ((STREAM), "\ttstl %Rd0\n"); \
+ } \
+while (0)
+
+/* begin-GG-local: explicit register specification for parameters */
+
+/* Note: this is an extension of m68k_args */
+
+
+/* A C type for declaring a variable that is used as the first
+ argument of `FUNCTION_ARG' and other related values. */
+/* Max. number of data, address and float registers to be used for passing
+ integer, pointer and float arguments when TARGET_REGPARM.
+ It's 4, so d0-d3, a0-a3 and fp0-fp3 can be used. */
+#undef M68K_MAX_REGPARM
+#define M68K_MAX_REGPARM 4
+
+/* The default number of data, address and float registers to use when
+ user specified '-mregparm' switch, not '-mregparm=<value>' option. */
+#undef M68K_DEFAULT_REGPARM
+#define M68K_DEFAULT_REGPARM 2
+
+#undef FUNCTION_ARG_ADVANCE
+#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
+ (m68k_function_arg_advance (&(CUM)))
+
+#undef FUNCTION_ARG
+#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
+ (m68k_function_arg (&(CUM), (MODE), (TYPE)))
+
+#undef INIT_CUMULATIVE_ARGS
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
+ (m68k_init_cumulative_args (&(CUM), (FNTYPE)))
+
+
+#define MASK_REGPARM (1<<24)
+#define TARGET_REGPARM (target_flags & MASK_REGPARM)
+
+#undef CLASS_MAX_NREGS
+#define CLASS_MAX_NREGS(CLASS, MODE) \
+ ((CLASS) == FP_REGS ? GET_MODE_NUNITS (MODE) \
+ : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
+
+/* 1 if N is a possible register number for function argument passing. */
+#undef FUNCTION_ARG_REGNO_P
+#define FUNCTION_ARG_REGNO_P(N) \
+ ((((int)N) >= 0 && (N) < M68K_MAX_REGPARM) \
+ || ((N) >= 8 && (N) < 8 + M68K_MAX_REGPARM) \
+ || (TARGET_68881 && (N) >= 16 && (N) < 16 + M68K_MAX_REGPARM))
+
+/*
+ On the m68k, this is a structure:
+ num_of_regs: number of data, address and float registers to use for
+ arguments passing (if it's 2, than pass arguments in d0, d1, a0, a1,
+ fp0 and fp1). 0 - pass everything on stack. vararg calls are
+ always passed entirely on stack.
+ regs_already_used: bitmask of the already used registers.
+ last_arg_reg - register number of the most recently passed argument.
+ -1 if passed on stack.
+ last_arg_len - number of registers used by the most recently passed
+ argument.
+*/
+
+struct m68k_args
+{
+ int num_of_regs;
+ long regs_already_used;
+ int last_arg_reg;
+ int last_arg_len;
+};
+#undef CUMULATIVE_ARGS
+#define CUMULATIVE_ARGS struct m68k_args
+
+struct amigaos_args
+{
+ int num_of_regs;
+ long regs_already_used;
+ int last_arg_reg;
+ int last_arg_len;
+ void *formal_type; /* New field: formal type of the current argument. */
+};
+#undef CUMULATIVE_ARGS
+#define CUMULATIVE_ARGS struct amigaos_args
+
+/* Initialize a variable CUM of type CUMULATIVE_ARGS
+ for a call to a function whose data type is FNTYPE.
+ For a library call, FNTYPE is 0. */
+
+#undef INIT_CUMULATIVE_ARGS
+#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT, N_NAMED_ARGS) \
+ (amigaos_init_cumulative_args(&(CUM), (FNTYPE)))
+
+/* Update the data in CUM to advance over an argument
+ of mode MODE and data type TYPE.
+ (TYPE is null for libcalls where that information may not be available.) */
+
+#undef FUNCTION_ARG_ADVANCE
+#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
+ (amigaos_function_arg_advance (&(CUM)))
+
+/* A C expression that controls whether a function argument is passed
+ in a register, and which register. */
+
+#undef FUNCTION_ARG
+#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
+ (amigaos_function_arg (&(CUM), (MODE), (TYPE)))
+/* end-GG-local */
+
+/* Stack checking and automatic extension support. */
+
+#define PROLOGUE_BEGIN_HOOK(STREAM, FSIZE) \
+ (amigaos_prologue_begin_hook ((STREAM), (FSIZE)))
+
+#define HAVE_ALTERNATE_FRAME_SETUP_F(FSIZE) TARGET_STACKEXTEND
+
+#define ALTERNATE_FRAME_SETUP_F(STREAM, FSIZE) \
+ (amigaos_alternate_frame_setup_f ((STREAM), (FSIZE)))
+
+#define HAVE_ALTERNATE_FRAME_SETUP(FSIZE) TARGET_STACKEXTEND
+
+#define ALTERNATE_FRAME_SETUP(STREAM, FSIZE) \
+ (amigaos_alternate_frame_setup ((STREAM), (FSIZE)))
+
+#define HAVE_ALTERNATE_FRAME_DESTR_F(FSIZE) \
+ (TARGET_STACKEXTEND && current_function_calls_alloca)
+
+#define ALTERNATE_FRAME_DESTR_F(STREAM, FSIZE) \
+ (asm_fprintf ((STREAM), "\tjra %U__unlk_a5_rts\n"))
+
+#define HAVE_ALTERNATE_RETURN \
+ (TARGET_STACKEXTEND && frame_pointer_needed && \
+ current_function_calls_alloca)
+
+#define ALTERNATE_RETURN(STREAM)
+
+/*
+#define HAVE_restore_stack_nonlocal TARGET_STACKEXTEND
+#define gen_restore_stack_nonlocal gen_stack_cleanup_call
+
+#define HAVE_restore_stack_function TARGET_STACKEXTEND
+#define gen_restore_stack_function gen_stack_cleanup_call
+
+#define HAVE_restore_stack_block TARGET_STACKEXTEND
+#define gen_restore_stack_block gen_stack_cleanup_call
+
+#undef TARGET_ALTERNATE_ALLOCATE_STACK
+#define TARGET_ALTERNATE_ALLOCATE_STACK 1
+
+#define ALTERNATE_ALLOCATE_STACK(OPERANDS) \
+do \
+ { \
+ amigaos_alternate_allocate_stack (OPERANDS); \
+ DONE; \
+ } \
+while (0)
+*/
+
+/* begin-GG-local: dynamic libraries */
+
+extern int amigaos_do_collecting (void);
+extern void amigaos_gccopts_hook (const char *);
+extern void amigaos_libname_hook (const char* arg);
+extern void amigaos_collect2_cleanup (void);
+extern void amigaos_prelink_hook (const char **, int *);
+extern void amigaos_postlink_hook (const char *);
+
+/* This macro is used to check if all collect2 facilities should be used.
+ We need a few special ones, like stripping after linking. */
+
+#define DO_COLLECTING (do_collecting || amigaos_do_collecting())
+#define COLLECT2_POSTLINK_HOOK(OUTPUT_FILE) amigaos_postlink_hook(OUTPUT_FILE) /* new */
+
+/* This macro is called in collect2 for every GCC argument name.
+ ARG is a part of commandline (without '\0' at the end). */
+
+#define COLLECT2_GCC_OPTIONS_HOOK(ARG) amigaos_gccopts_hook(ARG)
+
+/* This macro is called in collect2 for every ld's "-l" or "*.o" or "*.a"
+ argument. ARG is a complete argument, with '\0' at the end. */
+
+#define COLLECT2_LIBNAME_HOOK(ARG) amigaos_libname_hook(ARG)
+
+/* This macro is called at collect2 exit, to clean everything up. */
+
+#define COLLECT2_EXTRA_CLEANUP amigaos_collect2_cleanup
+
+/* This macro is called just before the first linker invocation.
+ LD1_ARGV is "char** argv", which will be passed to "ld". STRIP is an
+ *address* of "strip_flag" variable. */
+
+#define COLLECT2_PRELINK_HOOK(LD1_ARGV, STRIP) \
+amigaos_prelink_hook((const char **)(LD1_ARGV), (STRIP))
+
+/* This macro is called just after the first linker invocation, in place of
+ "nm" and "ldd". OUTPUT_FILE is the executable's filename. */
+
+#define COLLECT2_POSTLINK_HOOK(OUTPUT_FILE) amigaos_postlink_hook(OUTPUT_FILE)
+/* end-GG-local */
diff --git a/m68k-unknown-amigaos/recipes/files/gcc/gcc/config/m68k/host-amigaos.c b/m68k-unknown-amigaos/recipes/files/gcc/gcc/config/m68k/host-amigaos.c
new file mode 100644
index 0000000..8c72d51
--- /dev/null
+++ b/m68k-unknown-amigaos/recipes/files/gcc/gcc/config/m68k/host-amigaos.c
@@ -0,0 +1,42 @@
+/* AmigaOS/m68k host-specific hook definitions.
+ 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, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA. */
+
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "hosthooks.h"
+#include "hosthooks-def.h"
+#include "toplev.h"
+
+static void * amigaos_m68k_gt_pch_get_address (size_t);
+
+/* Return the address of the PCH address space, if the PCH will fit in it. */
+
+static void *
+amigaos_m68k_gt_pch_get_address (size_t sz ATTRIBUTE_UNUSED)
+{
+ fatal_error ("PCH not supported\n");
+}
+
+#undef HOST_HOOKS_GT_PCH_GET_ADDRESS
+#define HOST_HOOKS_GT_PCH_GET_ADDRESS amigaos_m68k_gt_pch_get_address
+
+const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER; \ No newline at end of file
diff --git a/m68k-unknown-amigaos/recipes/files/gcc/gcc/config/m68k/t-amigaos b/m68k-unknown-amigaos/recipes/files/gcc/gcc/config/m68k/t-amigaos
new file mode 100644
index 0000000..3b2d16f
--- /dev/null
+++ b/m68k-unknown-amigaos/recipes/files/gcc/gcc/config/m68k/t-amigaos
@@ -0,0 +1,36 @@
+# Makefile fragment for AmigaOS target.
+
+# Extra object file linked to the cc1* executables.
+amigaos.o: $(srcdir)/config/m68k/amigaos.c $(CONFIG_H)
+ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
+
+# Additional target dependent options for compiling libgcc.a. This just
+# ensures that we don't compile libgcc* with anything other than a
+# fixed stack.
+
+#TARGET_LIBGCC2_CFLAGS = -mfixedstack
+
+# Support for building multiple version of libgcc.
+
+LIBGCC_MULTI = .; \
+ libb;@fbaserel \
+ libm020;@m68020 \
+ libb/libm020;@fbaserel@m68020 \
+ libb32/libm020;@fbaserel32@m68020
+
+### begin-GG-local: dynamic libraries
+# Extra objects that get compiled and linked to collect2
+
+#EXTRA_COLLECT2_OBJS = amigacollect2.o
+
+# Build supplimentary AmigaOS target support file for collect2
+#amigacollect2.o: amigacollect2.c
+# $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
+# -DA2IXDIR_PREFIX=\"$(prefix)/share/a2ixlibrary\" $< $(OUTPUT_OPTION)
+### end-GG-local
+
+# Prevent fixincludes clobbering our limits.h
+LIMITS_H_TEST = true
+
+# Prevent installation of GCC's limits.h
+INSTALL_LIMITS_H = false
diff --git a/m68k-unknown-amigaos/recipes/files/gcc/gcc/config/m68k/x-amigaos b/m68k-unknown-amigaos/recipes/files/gcc/gcc/config/m68k/x-amigaos
new file mode 100644
index 0000000..a8f60b8
--- /dev/null
+++ b/m68k-unknown-amigaos/recipes/files/gcc/gcc/config/m68k/x-amigaos
@@ -0,0 +1,104 @@
+# Makefile fragment for AmigaOS host
+
+# Each compilation environment (Manx, Dice, GCC, SAS/C, etc) provides its
+# own equivalent of the UNIX /usr/include tree. For gcc, the standard headers
+# are in /gg/include and system specific headers are in /gg/os-include.
+# Use these paths for fixincludes.
+
+SYSTEM_HEADER_DIR = $(prefix)/include
+
+# Uncomment the following macro to get a resident GCC. We don't do it
+# by default, since we want to support users with mc68000.
+# WARNING! If you uncomment this, you MUST add the same flags to the
+# libiberty's Makefile (libiberty is now linked into GCC executables).
+
+#RESIDENT = -m68020 -resident32
+
+# Additional host flags that are not used when compiling with GCC_FOR_TARGET,
+# such as when compiling the libgcc* runtime archives. GCC uses stack
+# a lot, and since AmigaOS provides processes with a small, fixed size
+# stack, we have to generate code that will extend it whenever necessary.
+
+XCFLAGS = -mstackextend $(RESIDENT)
+
+# AmigaOS supports "AmigaGuide(R)" hypertext files. For GCC, these are
+# build with a custom "makeinfo".
+
+# Arrange for guides to be build with GCC, in the build directory.
+
+### begin-GG-local: gcc-amigaos
+#EXTRA_DOC_TARGETS = guide gcc-amigaos-doc
+### end-GG-local
+
+# Actually build guides
+
+guide:: doc/cpp.guide doc/gcc.guide doc/gccint.guide \
+ doc/gccinstall.guide doc/cppinternals.guide
+
+doc/cpp.guide: $(TEXI_CPP_FILES)
+doc/gcc.guide: $(TEXI_GCC_FILES)
+doc/gccint.guide: $(TEXI_GCCINT_FILES)
+doc/cppinternals.guide: $(TEXI_CPPINT_FILES)
+
+doc/%.guide: %.texi
+ if [ x$(BUILD_INFO) = xinfo ]; then \
+ $(MAKEINFO) --amiga $(MAKEINFOFLAGS) -I $(docdir) \
+ -I $(docdir)/include -o $@ $<; \
+ fi
+
+# Duplicate entry to handle renaming of gccinstall.guide
+doc/gccinstall.guide: $(TEXI_GCCINSTALL_FILES)
+ if [ x$(BUILD_INFO) = xinfo ]; then \
+ $(MAKEINFO) --amiga $(MAKEINFOFLAGS) -I $(docdir) \
+ -I $(docdir)/include -o $@ install.texi; \
+ fi
+
+# Arrange for guides to be installed with GCC.
+
+### begin-GG-local: gcc-amigaos
+#EXTRA_INSTALL_TARGETS = install-guide install-gcc-amigaos-doc
+### end-GG-local
+
+# Where the guide files go
+
+guidedir = $(prefix)/guide
+
+# Actually install guides.
+
+installdirs-guide:
+ $(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(guidedir)
+
+install-guide: doc installdirs-guide \
+ $(DESTDIR)$(guidedir)/cpp.guide \
+ $(DESTDIR)$(guidedir)/gcc.guide \
+ $(DESTDIR)$(guidedir)/cppinternals.guide \
+ $(DESTDIR)$(guidedir)/gccinstall.guide \
+ $(DESTDIR)$(guidedir)/gccint.guide
+
+$(DESTDIR)$(guidedir)/%.guide: doc/%.guide installdirs-guide
+ rm -f $@
+ if [ -f $< ]; then \
+ for f in $(<)*; do \
+ realfile=`echo $$f | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
+ $(INSTALL_DATA) $$f $(DESTDIR)$(guidedir)/$$realfile; \
+ chmod a-x $(DESTDIR)$(guidedir)/$$realfile; \
+ done; \
+ else true; fi
+
+### begin-GG-local: gcc-amigaos
+# Build and install gcc-amigaos.guide - documentation specific to the
+# AmigaOS port of GCC.
+
+gcc-amigaos-doc:: doc/gcc-amigaos.info doc/gcc-amigaos.guide
+
+doc/gcc-amigaos.info doc/gcc-amigaos.guide: gcc-amigaos.texi
+
+install-gcc-amigaos-doc: doc installdirs installdirs-guide \
+ $(DESTDIR)$(infodir)/gcc-amigaos.info \
+ $(DESTDIR)$(guidedir)/gcc-amigaos.guide
+### end-GG-local
+
+host-amigaos.o : $(srcdir)/config/m68k/host-amigaos.c $(CONFIG_H) $(SYSTEM_H) \
+ coretypes.h hosthooks.h hosthooks-def.h toplev.h diagnostic.h
+ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
+ $(srcdir)/config/m68k/host-amigaos.c
diff --git a/m68k-unknown-amigaos/recipes/files/gcc/gcc/config/m68k/xm-amigaos.h b/m68k-unknown-amigaos/recipes/files/gcc/gcc/config/m68k/xm-amigaos.h
new file mode 100644
index 0000000..bb571ba
--- /dev/null
+++ b/m68k-unknown-amigaos/recipes/files/gcc/gcc/config/m68k/xm-amigaos.h
@@ -0,0 +1,64 @@
+/* Configuration for GNU C-compiler for m68k Amiga, running AmigaOS.
+ Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2003
+ Free Software Foundation, Inc.
+ Contributed by Markus M. Wild (wild@amiga.physik.unizh.ch).
+
+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. */
+
+#ifndef _FCNTL_H_
+#include <fcntl.h>
+#endif
+
+/* AmigaOS specific headers, such as from the Native Developer Update kits,
+ go in SYSTEM_INCLUDE_DIR. STANDARD_INCLUDE_DIR is the equivalent of
+ Unix "/usr/include". All other include paths are set in Makefile. */
+
+#define SYSTEM_INCLUDE_DIR "/gg/os-include"
+#define STANDARD_INCLUDE_DIR "/gg/include"
+
+#define STANDARD_EXEC_PREFIX_1 "/gg/libexec/gcc/"
+#define STANDARD_EXEC_PREFIX_2 "/gg/lib/gcc/"
+#define STANDARD_STARTFILE_PREFIX_1 "/gg/lib/"
+#define STANDARD_STARTFILE_PREFIX_2 "/gg/lib/"
+
+/* The AmigaOS stores file names with regard to upper/lower case, but actions
+ on existing files are case independent on the standard filesystems.
+
+ A good example of where this causes problems is the conflict between the C
+ include file <string.h> and the C++ include file <String.h>, where the C++
+ include file dir is searched first and thus causes includes of <string.h>
+ to include <String.h> instead.
+
+ In order to solve this problem we define the macro OPEN_CASE_SENSITIVE as
+ the name of the function that takes the same args as open() and does case
+ dependent opens. */
+
+#define OPEN_CASE_SENSITIVE(NAME, FLAGS, MODE) open ((NAME), (FLAGS) | O_CASE, (MODE))
+
+/* On the AmigaOS, there are two pathname separators, '/' (DIR_SEPARATOR)
+ and ':' (VOL_SEPARATOR). DIR_SEPARATOR defaults to the correct
+ character, so we don't have to explicitly set it. */
+
+#define DIR_SEPARATOR '/'
+#define VOL_SEPARATOR ':'
+#define DIR_SEPARATOR_2 VOL_SEPARATOR
+
+/* Zap PREFIX_INCLUDE_DIR, since with the AmigaOS port it is the same as
+ STANDARD_INCLUDE_DIR. */
+
+#undef PREFIX_INCLUDE_DIR