summaryrefslogtreecommitdiff
path: root/m68k-unknown-amigaos/recipes/patches/gcc/gcc.c-decl.c.p
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2015-01-01 15:15:33 +0000
committerVincent Sanders <vince@kyllikki.org>2015-01-11 12:59:46 +0000
commit6d07d38a48ccb71f55cfacffbe86b83f4c75a28c (patch)
tree11490b607e64a3bc98b22f08625d548e285a39af /m68k-unknown-amigaos/recipes/patches/gcc/gcc.c-decl.c.p
parent786ec473315d6960a65c4efdb64f71774b902f5b (diff)
downloadtoolchains-6d07d38a48ccb71f55cfacffbe86b83f4c75a28c.tar.gz
toolchains-6d07d38a48ccb71f55cfacffbe86b83f4c75a28c.tar.bz2
Use gcc 3.4.6 for m68k-amigaos-toolchain
This changes to using the 3.4 series gcc with patches from github:cahirwpz/m68k-amigaos-toolchain and some other modifications to make it compile. clib2 is currently failing to build with this compiler with the following errors: Compiling unistd_getopt.c [large_data_020:c] /tmp/ccrQcqYy.s: Assembler messages: /tmp/ccrQcqYy.s:36: Error: parse error -- statement `cmpl (sp.0),d0' ignored /tmp/ccrQcqYy.s:58: Error: parse error -- statement `movel (sp.0),a0' ignored /tmp/ccrQcqYy.s:86: Error: parse error -- statement `addql #1,(sp.0)' ignored /tmp/ccrQcqYy.s:89: Error: parse error -- statement `movel (sp.0),a0' ignored /tmp/ccrQcqYy.s:94: Error: parse error -- statement `movel d0,(sp.0)' ignored /tmp/ccrQcqYy.s:104: Error: parse error -- statement `addl (sp.0),a0' ignored /tmp/ccrQcqYy.s:129: Error: parse error -- statement `movel d0,(sp.0)' ignored /tmp/ccrQcqYy.s:139: Error: parse error -- statement `movel d0,(sp.0)' ignored /tmp/ccrQcqYy.s:143: Error: parse error -- statement `addql #1,(sp.0)' ignored /tmp/ccrQcqYy.s:146: Error: parse error -- statement `movel (sp.0),a0' ignored /tmp/ccrQcqYy.s:150: Error: parse error -- statement `movel d0,(sp.0)' ignored make[2]: *** [large_data_020/libc_objs/unistd_getopt.o] Error 1
Diffstat (limited to 'm68k-unknown-amigaos/recipes/patches/gcc/gcc.c-decl.c.p')
-rw-r--r--m68k-unknown-amigaos/recipes/patches/gcc/gcc.c-decl.c.p87
1 files changed, 87 insertions, 0 deletions
diff --git a/m68k-unknown-amigaos/recipes/patches/gcc/gcc.c-decl.c.p b/m68k-unknown-amigaos/recipes/patches/gcc/gcc.c-decl.c.p
new file mode 100644
index 0000000..6e7e353
--- /dev/null
+++ b/m68k-unknown-amigaos/recipes/patches/gcc/gcc.c-decl.c.p
@@ -0,0 +1,87 @@
+--- gcc-3.4.6/gcc/c-decl.c 2013-05-19 20:09:27.000000000 +0200
++++ gcc/c-decl.c 2013-05-19 20:23:32.000000000 +0200
+@@ -2960,7 +2960,7 @@
+ and push that on the current scope. */
+
+ void
+-push_parm_decl (tree parm)
++push_parm_decl (tree parm, tree asmspec)
+ {
+ tree decl;
+ int old_dont_save_pending_sizes_p = 0;
+@@ -2983,6 +2983,75 @@
+ PARM, 0, NULL);
+ decl_attributes (&decl, TREE_VALUE (parm), 0);
+
++ /* begin-GG-local: explicit register specification for parameters */
++ if (asmspec)
++#ifdef TARGET_AMIGAOS
++ {
++ const char *regname=TREE_STRING_POINTER(asmspec);
++ int regnum;
++ if ((regnum=decode_reg_name(regname))>=0)
++ {
++ tree type=TREE_TYPE(decl);
++ if (HARD_REGNO_MODE_OK(regnum, TYPE_MODE(type)))
++ {
++ tree t, attrs;
++ /* Build tree for __attribute__ ((asm(regnum))). */
++#if 0
++ /* This doesn't work well because of a bug in
++ attribute_list_contained(), which passes list of arguments to
++ simple_cst_equal() instead of passing every argument
++ separately. */
++ attrs=tree_cons(get_identifier("asm"), tree_cons(NULL_TREE,
++ build_int_2_wide(regnum, 0), NULL_TREE), NULL_TREE);
++#else
++ attrs=tree_cons(get_identifier("asm"),
++ build_int_2_wide(regnum, 0), NULL_TREE);
++#endif
++#if 0
++ /* build_type_attribute_variant() would seem to be more
++ appropriate here. However, that function does not support
++ attributes for parameters properly. It modifies
++ TYPE_MAIN_VARIANT of a new type. As a result, comptypes()
++ thinks that types of parameters in prototype and definition
++ are different and issues error messages. See also comment
++ below. */
++ type=build_type_attribute_variant(type, attrs);
++#else
++ /* First check whether such a type already exists - if yes, use
++ that one. This is very important, since otherwise
++ common_type() would think that it sees two different
++ types and would try to merge them - this could result in
++ warning messages. */
++ for (t=TYPE_MAIN_VARIANT(type); t; t=TYPE_NEXT_VARIANT(t))
++ if (comptypes(t, type, COMPARE_STRICT)==1
++ && attribute_list_equal(TYPE_ATTRIBUTES(t), attrs))
++ break;
++ if (t)
++ type=t;
++ else
++ {
++ /* Create a new variant, with differing attributes.
++ (Hack! Type with differing attributes should no longer be
++ a variant of its main type. See comment above for
++ explanation why this was necessary). */
++ type=build_type_copy(type);
++ TYPE_ATTRIBUTES(type)=attrs;
++ }
++#endif
++ TREE_TYPE(decl)=type;
++ }
++ else
++ error ("%Jregister specified for '%D' isn't suitable for data type",
++ decl, decl);
++ }
++ else
++ error ("invalid register name `%s'", regname);
++ }
++#else /* !TARGET_AMIGAOS */
++ error("explicit register specification for parameters is not supported for this target");
++#endif /* !TARGET_AMIGAOS */
++ /* end-GG-local */
++
+ decl = pushdecl (decl);
+
+ finish_decl (decl, NULL_TREE, NULL_TREE);