parallaxinc / propgcc

A Port of GCC to the Parallax Propeller
Other
36 stars 17 forks source link

Compilation with current version of GCC and texinfo fails #75

Open maribu opened 8 years ago

maribu commented 8 years ago

Hi, there!

I couldn't compile this project with current version of gcc and texinfo. Some of this problems seem to be already addressed with the patches at the end of https://github.com/parallaxinc/propgcc/issues/61

Here is what it took me to get it compiling again:

I think all problems have bin fixed upstream. As I've never worked with texinfo (and do not plan to gain any knowledge about texinfo) and I've not checked the output of texinfo, the generated documentation might be totally f***ed up. You've been warned ;-)

Here are the patches:

binutils-disable-werror.patch:

Disables the CFLAG -Werror when compiling binutils, because compiling with
current version of GCC will fail otherwise
--- Makefile.old    2015-10-15 10:20:01.937014677 +0200
+++ Makefile    2015-10-15 10:20:09.446973993 +0200
@@ -167,7 +167,7 @@ $(BUILD)/binutils/binutils-built:   $(BUIL

 $(BUILD)/binutils/binutils-configured: $(BUILD)/binutils/binutils-created
    @$(ECHO) Configuring binutils
-   @$(CD) $(BUILD)/binutils; $(ROOT)/binutils/configure --target=propeller-elf --prefix=$(PREFIX) --disable-nls --disable-shared $(CONFIG_OPTIONS)
+   @$(CD) $(BUILD)/binutils; $(ROOT)/binutils/configure --target=propeller-elf --prefix=$(PREFIX) --disable-nls --disable-shared $(CONFIG_OPTIONS) --disable-werror
    @$(TOUCH) $@

 #######

gdb-disable-werror.patch

This patch disables the CFLAG -Werror to allow compilation with current GCC
versions
--- Makefile.old    2015-10-15 14:38:46.906242032 +0200
+++ Makefile    2015-10-15 14:45:28.427400139 +0200
@@ -233,7 +233,7 @@ $(BUILD)/gdb/gdb-built: binutils gcc $(B

 $(BUILD)/gdb/gdb-configured:   $(BUILD)/gdb/gdb-created
    @$(ECHO) Configuring gdb
-   @$(CD) $(BUILD)/gdb; $(ROOT)/gdb/configure $(CFGCROSS) --target=propeller-elf --prefix=$(PREFIX) --with-system-gdbinit=$(PREFIX)/lib/gdb/gdbinit $(WITH_CURSES)
+   @$(CD) $(BUILD)/gdb; $(ROOT)/gdb/configure $(CFGCROSS) --target=propeller-elf --prefix=$(PREFIX) --with-system-gdbinit=$(PREFIX)/lib/gdb/gdbinit $(WITH_CURSES) --disable-werror
    @$(TOUCH) $@

 ###########

binutils-texinfo-5.x.patch

Changing the documentation of binutils to compile with texinfo in version 5.x.
(I mostly reused patches from the upstream version control system)
diff -urp binutils-old/bfd/doc/bfd.texinfo binutils/bfd/doc/bfd.texinfo
--- binutils-old/bfd/doc/bfd.texinfo    2015-10-15 10:19:42.843784781 +0200
+++ binutils/bfd/doc/bfd.texinfo    2015-10-15 10:20:55.953388712 +0200
@@ -322,7 +322,7 @@ All of BFD lives in one directory.
 @printindex cp

 @tex
-% I think something like @colophon should be in texinfo.  In the
+% I think something like @@colophon should be in texinfo.  In the
 % meantime:
 \long\def\colophon{\hbox to0pt{}\vfill
 \centerline{The body of this manual is set in}
@@ -333,7 +333,7 @@ All of BFD lives in one directory.
 \centerline{{\sl\fontname\tensl\/}}
 \centerline{are used for emphasis.}\vfill}
 \page\colophon
-% Blame: doc@cygnus.com, 28mar91.
+% Blame: doc@@cygnus.com, 28mar91.
 @end tex

 @bye
diff -urp binutils-old/gas/doc/c-arc.texi binutils/gas/doc/c-arc.texi
--- binutils-old/gas/doc/c-arc.texi 2015-10-15 10:19:42.953784185 +0200
+++ binutils/gas/doc/c-arc.texi 2015-10-15 10:20:55.953388712 +0200
@@ -1,4 +1,4 @@
-@c Copyright 2000, 2001, 2005, 2006, 2007, 2011 Free Software Foundation, Inc.
+@c Copyright 2000-2013 Free Software Foundation, Inc.
 @c This is part of the GAS manual.
 @c For copying conditions, see the file as.texinfo.

@@ -220,7 +220,7 @@ The extension instructions are not macro
 encodings for use of these instructions according to the specification
 by the user.  The parameters are:

-@table @bullet
+@table @code
 @item @var{name}
 Name of the extension instruction 

diff -urp binutils-old/gas/doc/c-arm.texi binutils/gas/doc/c-arm.texi
--- binutils-old/gas/doc/c-arm.texi 2015-10-15 10:19:42.953784185 +0200
+++ binutils/gas/doc/c-arm.texi 2015-10-15 10:20:55.953388712 +0200
@@ -1,5 +1,4 @@
-@c Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-@c 2006, 2007, 2008, 2009, 2010, 2011  Free Software Foundation, Inc.
+@c Copyright 1996-2013 Free Software Foundation, Inc.
 @c This is part of the GAS manual.
 @c For copying conditions, see the file as.texinfo.

@@ -388,29 +387,29 @@ ARM and THUMB instructions had their own
 @code{unified} syntax, which can be selected via the @code{.syntax}
 directive, and has the following main features:

-@table @bullet
-@item
+@table @code
+@item 1
 Immediate operands do not require a @code{#} prefix.

-@item
+@item 2
 The @code{IT} instruction may appear, and if it does it is validated
 against subsequent conditional affixes.  In ARM mode it does not
 generate machine code, in THUMB mode it does.

-@item
+@item 3
 For ARM instructions the conditional affixes always appear at the end
 of the instruction.  For THUMB instructions conditional affixes can be
 used, but only inside the scope of an @code{IT} instruction.

-@item
+@item 4
 All of the instructions new to the V6T2 architecture (and later) are
 available.  (Only a few such instructions can be written in the
 @code{divided} syntax).

-@item
+@item 5
 The @code{.N} and @code{.W} suffixes are recognized and honored.

-@item
+@item 6
 All instructions set the flags if and only if they have an @code{s}
 affix.
 @end table
@@ -449,28 +448,6 @@ Either @samp{#} or @samp{$} can be used
 @cindex register names, ARM
 *TODO* Explain about ARM register naming, and the predefined names.

-@node ARM-Neon-Alignment
-@subsection NEON Alignment Specifiers
-
-@cindex alignment for NEON instructions
-Some NEON load/store instructions allow an optional address
-alignment qualifier.
-The ARM documentation specifies that this is indicated by
-@samp{@@ @var{align}}. However GAS already interprets
-the @samp{@@} character as a "line comment" start,
-so @samp{: @var{align}} is used instead.  For example:
-
-@smallexample
-        vld1.8 @{q0@}, [r0, :128]
-@end smallexample
-
-@node ARM Floating Point
-@section Floating Point
-
-@cindex floating point, ARM (@sc{ieee})
-@cindex ARM floating point (@sc{ieee})
-The ARM family uses @sc{ieee} floating-point numbers.
-
 @node ARM-Relocations
 @subsection ARM relocation generation

@@ -517,6 +494,28 @@ respectively.  For example to load the 3
         MOVT r0, #:upper16:foo
 @end smallexample

+@node ARM-Neon-Alignment
+@subsection NEON Alignment Specifiers
+
+@cindex alignment for NEON instructions
+Some NEON load/store instructions allow an optional address
+alignment qualifier.
+The ARM documentation specifies that this is indicated by
+@samp{@@ @var{align}}. However GAS already interprets
+the @samp{@@} character as a "line comment" start,
+so @samp{: @var{align}} is used instead.  For example:
+
+@smallexample
+        vld1.8 @{q0@}, [r0, :128]
+@end smallexample
+
+@node ARM Floating Point
+@section Floating Point
+
+@cindex floating point, ARM (@sc{ieee})
+@cindex ARM floating point (@sc{ieee})
+The ARM family uses @sc{ieee} floating-point numbers.
+
 @node ARM Directives
 @section ARM Machine Directives

diff -urp binutils-old/gas/doc/c-cr16.texi binutils/gas/doc/c-cr16.texi
--- binutils-old/gas/doc/c-cr16.texi    2015-10-15 10:19:42.953784185 +0200
+++ binutils/gas/doc/c-cr16.texi    2015-10-15 10:20:55.953388712 +0200
@@ -1,4 +1,4 @@
-@c Copyright 2007, 2008, 2011 Free Software Foundation, Inc.
+@c Copyright 2007-2013 Free Software Foundation, Inc.
 @c This is part of the GAS manual.
 @c For copying conditions, see the file as.texinfo.

diff -urp binutils-old/gas/doc/c-mips.texi binutils/gas/doc/c-mips.texi
--- binutils-old/gas/doc/c-mips.texi    2015-10-15 10:19:42.953784185 +0200
+++ binutils/gas/doc/c-mips.texi    2015-10-15 10:20:55.956722028 +0200
@@ -234,7 +234,7 @@ the @samp{mad} and @samp{madu} instructi
 instructions around accesses to the @samp{HI} and @samp{LO} registers.
 @samp{-no-m4650} turns off this option.

-@itemx -m3900
+@item -m3900
 @itemx -no-m3900
 @itemx -m4100
 @itemx -no-m4100
diff -urp binutils-old/gas/doc/c-score.texi binutils/gas/doc/c-score.texi
--- binutils-old/gas/doc/c-score.texi   2015-10-15 10:19:42.957117500 +0200
+++ binutils/gas/doc/c-score.texi   2015-10-15 10:20:55.956722028 +0200
@@ -37,7 +37,7 @@ implicitly with the @code{gp} register.
 @item -EB
 Assemble code for a big-endian cpu

-@itemx -EL
+@item -EL
 Assemble code for a little-endian cpu

 @item -FIXDD 
@@ -49,13 +49,13 @@ Assemble code for no warning message for
 @item -SCORE5
 Assemble code for target is SCORE5

-@itemx -SCORE5U
+@item -SCORE5U
 Assemble code for target is SCORE5U

-@itemx -SCORE7
+@item -SCORE7
 Assemble code for target is SCORE7, this is default setting

-@itemx -SCORE3
+@item -SCORE3
 Assemble code for target is SCORE3

 @item -march=score7
diff -urp binutils-old/gas/doc/c-tic54x.texi binutils/gas/doc/c-tic54x.texi
--- binutils-old/gas/doc/c-tic54x.texi  2015-10-15 10:19:42.953784185 +0200
+++ binutils/gas/doc/c-tic54x.texi  2015-10-15 10:20:55.956722028 +0200
@@ -1,4 +1,4 @@
-@c Copyright 2000, 2002, 2003, 2006, 2011 Free Software Foundation, Inc.
+@c Copyright 2000-2013 Free Software Foundation, Inc.
 @c This is part of the GAS manual.
 @c For copying conditions, see the file as.texinfo.
 @c TI TMS320C54X description by Timothy Wall, twall@cygnus.com
@@ -109,7 +109,7 @@ In this example, x is replaced with SYM2
 is replaced with x.  At this point, x has already been encountered
 and the substitution stops.

-@smallexample @code
+@smallexample
  .asg   "x",SYM1 
  .asg   "SYM1",SYM2
  .asg   "SYM2",x
@@ -126,14 +126,14 @@ Substitution may be forced in situations
 ambiguous by placing colons on either side of the subsym.  The following
 code: 

-@smallexample @code
+@smallexample
  .eval  "10",x
 LAB:X:  add     #x, a
 @end smallexample

 When assembled becomes:

-@smallexample @code
+@smallexample
 LAB10  add     #10, a
 @end smallexample

@@ -309,7 +309,7 @@ The @code{LDX} pseudo-op is provided for
 of a label or address.  For example, if an address @code{_label} resides
 in extended program memory, the value of @code{_label} may be loaded as
 follows:
-@smallexample @code
+@smallexample
  ldx     #_label,16,a    ; loads extended bits of _label
  or      #_label,a       ; loads lower 16 bits of _label
  bacc    a               ; full address is in accumulator A
@@ -345,7 +345,7 @@ Assign @var{name} the string @var{string
 performed on @var{string} before assignment.

 @cindex @code{eval} directive, TIC54X
-@itemx .eval @var{string}, @var{name}
+@item .eval @var{string}, @var{name}
 Evaluate the contents of string @var{string} and assign the result as a
 string to the subsym @var{name}.  String replacement is performed on
 @var{string} before assignment. 
diff -urp binutils-old/ld/ld.texinfo binutils/ld/ld.texinfo
--- binutils-old/ld/ld.texinfo  2015-10-15 10:19:43.277115767 +0200
+++ binutils/ld/ld.texinfo  2015-10-15 10:20:55.960055343 +0200
@@ -7856,7 +7856,7 @@ If you have more than one @code{SECT} st
 @printindex cp

 @tex
-% I think something like @colophon should be in texinfo.  In the
+% I think something like @@colophon should be in texinfo.  In the
 % meantime:
 \long\def\colophon{\hbox to0pt{}\vfill
 \centerline{The body of this manual is set in}
@@ -7867,7 +7867,7 @@ If you have more than one @code{SECT} st
 \centerline{{\sl\fontname\tensl\/}}
 \centerline{are used for emphasis.}\vfill}
 \page\colophon
-% Blame: doc@cygnus.com, 28mar91.
+% Blame: doc@@cygnus.com, 28mar91.
 @end tex

 @bye

gcc-gnu_inline.patch

See https://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg116582.html
diff -urp gcc-old/gcc/cp/cfns.gperf gcc/gcc/cp/cfns.gperf
--- gcc-old/gcc/cp/cfns.gperf   2015-10-15 10:19:50.573742904 +0200
+++ gcc/gcc/cp/cfns.gperf   2015-10-15 10:22:19.376270105 +0200
@@ -22,6 +22,9 @@ __inline
 static unsigned int hash (const char *, unsigned int);
 #ifdef __GNUC__
 __inline
+#ifdef __GNUC_STDC_INLINE__
+__attribute__ ((__gnu_inline__))
+#endif
 #endif
 const char * libc_name_p (const char *, unsigned int);
 %}
diff -urp gcc-old/gcc/cp/cfns.h gcc/gcc/cp/cfns.h
--- gcc-old/gcc/cp/cfns.h   2015-10-15 10:19:50.573742904 +0200
+++ gcc/gcc/cp/cfns.h   2015-10-15 10:22:19.376270105 +0200
@@ -53,6 +53,9 @@ __inline
 static unsigned int hash (const char *, unsigned int);
 #ifdef __GNUC__
 __inline
+#ifdef __GNUC_STDC_INLINE__
+__attribute__ ((__gnu_inline__))
+#endif
 #endif
 const char * libc_name_p (const char *, unsigned int);
 /* maximum key range = 391, duplicates = 0 */

gcc-texinfo-5.x.patch

I updated the documentation to work with texinfo in version 5.x. I mostly
changed @itemx to @item for each error message and also included some patches
from upstream.
diff -urp gcc-old/gcc/doc/cppopts.texi gcc/gcc/doc/cppopts.texi
--- gcc-old/gcc/doc/cppopts.texi    2015-10-15 14:46:37.987023302 +0200
+++ gcc/gcc/doc/cppopts.texi    2015-10-15 14:46:49.486961001 +0200
@@ -769,8 +769,8 @@ Replacement:      [    ]    @{    @}
 Enable special code to work around file systems which only permit very
 short file names, such as MS-DOS@.

-@itemx --help
-@itemx --target-help
+@item --help
+@item --target-help
 @opindex help
 @opindex target-help
 Print text describing all the command line options instead of
diff -urp gcc-old/gcc/doc/generic.texi gcc/gcc/doc/generic.texi
--- gcc-old/gcc/doc/generic.texi    2015-10-15 14:46:37.987023302 +0200
+++ gcc/gcc/doc/generic.texi    2015-10-15 14:46:59.306907802 +0200
@@ -1415,13 +1415,13 @@ generate these expressions anyhow, if it
 not matter.  The type of the operands and that of the result are
 always of @code{BOOLEAN_TYPE} or @code{INTEGER_TYPE}.

-@itemx POINTER_PLUS_EXPR
+@item POINTER_PLUS_EXPR
 This node represents pointer arithmetic.  The first operand is always
 a pointer/reference type.  The second operand is always an unsigned
 integer type compatible with sizetype.  This is the only binary
 arithmetic operand that can operate on pointer types.

-@itemx PLUS_EXPR
+@item PLUS_EXPR
 @itemx MINUS_EXPR
 @itemx MULT_EXPR
 These nodes represent various binary arithmetic operations.
diff -urp gcc-old/gcc/doc/invoke.texi gcc/gcc/doc/invoke.texi
--- gcc-old/gcc/doc/invoke.texi 2015-10-15 14:46:37.987023302 +0200
+++ gcc/gcc/doc/invoke.texi 2015-10-15 14:46:54.703599407 +0200
@@ -165,7 +165,7 @@ in the following sections.
 -pipe  -pass-exit-codes  @gol
 -x @var{language}  -v  -###  --help@r{[}=@var{class}@r{[},@dots{}@r{]]}  --target-help  @gol
 --version -wrapper @@@var{file} -fplugin=@var{file} -fplugin-arg-@var{name}=@var{arg}  @gol
--fdump-ada-spec@r{[}-slim@r{]}} -fdump-go-spec=@var{file}
+-fdump-ada-spec@r{[}-slim@r{]} -fdump-go-spec=@var{file}}

 @item C Language Options
 @xref{C Dialect Options,,Options Controlling C Dialect}.
@@ -5089,11 +5089,11 @@ Dump after duplicating the computed goto
 @option{-fdump-rtl-ce3} enable dumping after the three
 if conversion passes.

-@itemx -fdump-rtl-cprop_hardreg
+@item -fdump-rtl-cprop_hardreg
 @opindex fdump-rtl-cprop_hardreg
 Dump after hard register copy propagation.

-@itemx -fdump-rtl-csa
+@item -fdump-rtl-csa
 @opindex fdump-rtl-csa
 Dump after combining stack adjustments.

@@ -5104,11 +5104,11 @@ Dump after combining stack adjustments.
 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
 the two common sub-expression elimination passes.

-@itemx -fdump-rtl-dce
+@item -fdump-rtl-dce
 @opindex fdump-rtl-dce
 Dump after the standalone dead code elimination passes.

-@itemx -fdump-rtl-dbr
+@item -fdump-rtl-dbr
 @opindex fdump-rtl-dbr
 Dump after delayed branch scheduling.

@@ -5153,7 +5153,7 @@ Dump after the initialization of the reg
 @opindex fdump-rtl-initvals
 Dump after the computation of the initial value sets.

-@itemx -fdump-rtl-into_cfglayout
+@item -fdump-rtl-into_cfglayout
 @opindex fdump-rtl-into_cfglayout
 Dump after converting to cfglayout mode.

@@ -5183,7 +5183,7 @@ Dump after removing redundant mode switc
 @opindex fdump-rtl-rnreg
 Dump after register renumbering.

-@itemx -fdump-rtl-outof_cfglayout
+@item -fdump-rtl-outof_cfglayout
 @opindex fdump-rtl-outof_cfglayout
 Dump after converting from cfglayout mode.

@@ -5195,7 +5195,7 @@ Dump after the peephole pass.
 @opindex fdump-rtl-postreload
 Dump after post-reload optimizations.

-@itemx -fdump-rtl-pro_and_epilogue
+@item -fdump-rtl-pro_and_epilogue
 @opindex fdump-rtl-pro_and_epilogue
 Dump after generating the function pro and epilogues.

gdb-texinfo-5.x.patch

I updated the gdb info to run with texinfo in version 5.x
diff -urp gdb-old/bfd/doc/bfd.texinfo gdb/bfd/doc/bfd.texinfo
--- gdb-old/bfd/doc/bfd.texinfo 2015-10-15 14:34:16.111042389 +0200
+++ gdb/bfd/doc/bfd.texinfo 2015-10-15 14:35:09.934084138 +0200
@@ -322,7 +322,7 @@ All of BFD lives in one directory.
 @printindex cp

 @tex
-% I think something like @colophon should be in texinfo.  In the
+% I think something like @@colophon should be in texinfo.  In the
 % meantime:
 \long\def\colophon{\hbox to0pt{}\vfill
 \centerline{The body of this manual is set in}
@@ -333,7 +333,7 @@ All of BFD lives in one directory.
 \centerline{{\sl\fontname\tensl\/}}
 \centerline{are used for emphasis.}\vfill}
 \page\colophon
-% Blame: doc@cygnus.com, 28mar91.
+% Blame: doc@@cygnus.com, 28mar91.
 @end tex

 @bye

Regards, maribu