public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* cannot build gcc 3.2.3 in Suse 10.3 (gcc 4.2.1)
@ 2008-01-05 22:42 Matteo Rama
  2008-01-05 23:13 ` Andrew Haley
  0 siblings, 1 reply; 6+ messages in thread
From: Matteo Rama @ 2008-01-05 22:42 UTC (permalink / raw)
  To: gcc-help

hello,
I've installed Suse 10.3, which has gcc version 4.2.1 .
I need also an older version of gcc, for example 3.2.3 but I haven't managed
to install it.

I downloaded gcc-3.2.3.tar.gz (the md5sum check was ok) then:

>tar -zxf gcc-3.2.3.tar.gz
(the dir. gcc-3.2.3 is created)
>mkdir obj
>cd obj
> ../gcc-3.2.3/configure --prefix=/usr/local/gcc/3.2.3
Here is the output:
http://docs.google.com/Doc?id=dgwhbj6q_56mg3db2fd
>make
here the compilation fails. The output I get is here:
http://docs.google.com/Doc?id=dgwhbj6q_57f39sdqcp

Any help in understanding how to fix the problem would be very much appreciated.
Best regards,
  Matteo

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: cannot build gcc 3.2.3 in Suse 10.3 (gcc 4.2.1)
  2008-01-05 22:42 cannot build gcc 3.2.3 in Suse 10.3 (gcc 4.2.1) Matteo Rama
@ 2008-01-05 23:13 ` Andrew Haley
  2008-01-06 10:58   ` Matteo Rama
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Haley @ 2008-01-05 23:13 UTC (permalink / raw)
  To: Matteo Rama; +Cc: gcc-help

Matteo Rama writes:
 > hello,
 > I've installed Suse 10.3, which has gcc version 4.2.1 .
 > I need also an older version of gcc, for example 3.2.3 but I haven't managed
 > to install it.
 > 
 > I downloaded gcc-3.2.3.tar.gz (the md5sum check was ok) then:
 > 
 > >tar -zxf gcc-3.2.3.tar.gz
 > (the dir. gcc-3.2.3 is created)
 > >mkdir obj
 > >cd obj
 > > ../gcc-3.2.3/configure --prefix=/usr/local/gcc/3.2.3
 > Here is the output:
 > http://docs.google.com/Doc?id=dgwhbj6q_56mg3db2fd
 > >make
 > here the compilation fails. The output I get is here:
 > http://docs.google.com/Doc?id=dgwhbj6q_57f39sdqcp
 > 
 > Any help in understanding how to fix the problem would be very much appreciated.

I think it's complaining about an lvalue cast.

It might be as simple as changing that line to

	      obstack_ptr_grow (&vector_stack, read_rtx (infile));

Andrew.

-- 
Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, UK
Registered in England and Wales No. 3798903

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: cannot build gcc 3.2.3 in Suse 10.3 (gcc 4.2.1)
  2008-01-05 23:13 ` Andrew Haley
@ 2008-01-06 10:58   ` Matteo Rama
  2008-01-06 11:11     ` Andrew Haley
  2008-01-06 15:54     ` Tim Prince
  0 siblings, 2 replies; 6+ messages in thread
From: Matteo Rama @ 2008-01-06 10:58 UTC (permalink / raw)
  To: Andrew Haley; +Cc: gcc-help

thanks for the reply. It looks like replacing line 662 of read-rtl.c with
obstack_ptr_grow (&vector_stack, read_rtx (infile));
doesn't fix the problem. The error is still there:
...
../../gcc-3.2.3/gcc/read-rtl.c: In function 'read_rtx':
../../gcc-3.2.3/gcc/read-rtl.c:662: error: lvalue required as increment operand
../../gcc-3.2.3/gcc/read-rtl.c:662:60: warning: C++ style comments are
not allowed in ISO C90
../../gcc-3.2.3/gcc/read-rtl.c:662:60: warning: (this will be reported
only once per input file)
make[1]: *** [read-rtl.o] Error 1
make[1]: Leaving directory `/root/gcc/obj/gcc'
make: *** [all-gcc] Error 2

regards,
  Matteo


On Jan 5, 2008 2:36 PM, Andrew Haley <aph@redhat.com> wrote:
>
> Matteo Rama writes:
>  > hello,
>  > I've installed Suse 10.3, which has gcc version 4.2.1 .
>  > I need also an older version of gcc, for example 3.2.3 but I haven't managed
>  > to install it.
>  >
>  > I downloaded gcc-3.2.3.tar.gz (the md5sum check was ok) then:
>  >
>  > >tar -zxf gcc-3.2.3.tar.gz
>  > (the dir. gcc-3.2.3 is created)
>  > >mkdir obj
>  > >cd obj
>  > > ../gcc-3.2.3/configure --prefix=/usr/local/gcc/3.2.3
>  > Here is the output:
>  > http://docs.google.com/Doc?id=dgwhbj6q_56mg3db2fd
>  > >make
>  > here the compilation fails. The output I get is here:
>  > http://docs.google.com/Doc?id=dgwhbj6q_57f39sdqcp
>  >
>  > Any help in understanding how to fix the problem would be very much appreciated.
>
> I think it's complaining about an lvalue cast.
>
> It might be as simple as changing that line to
>
>               obstack_ptr_grow (&vector_stack, read_rtx (infile));
>
> Andrew.
>
> --
> Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, UK
> Registered in England and Wales No. 3798903
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: cannot build gcc 3.2.3 in Suse 10.3 (gcc 4.2.1)
  2008-01-06 10:58   ` Matteo Rama
@ 2008-01-06 11:11     ` Andrew Haley
  2008-01-07  5:16       ` Andrew Haley
  2008-01-06 15:54     ` Tim Prince
  1 sibling, 1 reply; 6+ messages in thread
From: Andrew Haley @ 2008-01-06 11:11 UTC (permalink / raw)
  To: Matteo Rama; +Cc: gcc-help

Matteo Rama writes:
 > thanks for the reply. It looks like replacing line 662 of read-rtl.c with
 > obstack_ptr_grow (&vector_stack, read_rtx (infile));
 > doesn't fix the problem. The error is still there:
 > ...
 > ../../gcc-3.2.3/gcc/read-rtl.c: In function 'read_rtx':
 > ../../gcc-3.2.3/gcc/read-rtl.c:662: error: lvalue required as increment operand
 > ../../gcc-3.2.3/gcc/read-rtl.c:662:60: warning: C++ style comments are
 > not allowed in ISO C90
 > ../../gcc-3.2.3/gcc/read-rtl.c:662:60: warning: (this will be reported
 > only once per input file)
 > make[1]: *** [read-rtl.o] Error 1
 > make[1]: Leaving directory `/root/gcc/obj/gcc'
 > make: *** [all-gcc] Error 2

Well, you're going to have to fix the code.  Feel free to ask us, but
we'll need more information, such as the preprocessed source.

Yeah, I suppose I could try building it myself, but it's not a very
interesting thing to do.  I might try a build later.

Andrew.

-- 
Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, UK
Registered in England and Wales No. 3798903

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: cannot build gcc 3.2.3 in Suse 10.3 (gcc 4.2.1)
  2008-01-06 10:58   ` Matteo Rama
  2008-01-06 11:11     ` Andrew Haley
@ 2008-01-06 15:54     ` Tim Prince
  1 sibling, 0 replies; 6+ messages in thread
From: Tim Prince @ 2008-01-06 15:54 UTC (permalink / raw)
  To: Matteo Rama; +Cc: Andrew Haley, gcc-help

Matteo Rama wrote:
> thanks for the reply. It looks like replacing line 662 of read-rtl.c with
> obstack_ptr_grow (&vector_stack, read_rtx (infile));
> doesn't fix the problem. The error is still there:
> ....
> .../../gcc-3.2.3/gcc/read-rtl.c: In function 'read_rtx':
> .../../gcc-3.2.3/gcc/read-rtl.c:662: error: lvalue required as increment operand
> .../../gcc-3.2.3/gcc/read-rtl.c:662:60: warning: C++ style comments are
> not allowed in ISO C90
> .../../gcc-3.2.3/gcc/read-rtl.c:662:60: warning: (this will be reported
> only once per input file)
> make[1]: *** [read-rtl.o] Error 1
> make[1]: Leaving directory `/root/gcc/obj/gcc'
> make: *** [all-gcc] Error 2

I thought the usual suggestion, if you don't want to fix the source
code, was to build one of the earliest gcc versions which has this bug
fixed.  Then you should be able to use this older version to build the
buggy version.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: cannot build gcc 3.2.3 in Suse 10.3 (gcc 4.2.1)
  2008-01-06 11:11     ` Andrew Haley
@ 2008-01-07  5:16       ` Andrew Haley
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Haley @ 2008-01-07  5:16 UTC (permalink / raw)
  To: Matteo Rama, gcc-help

Andrew Haley writes:
 > Matteo Rama writes:
 >  > thanks for the reply. It looks like replacing line 662 of read-rtl.c with
 >  > obstack_ptr_grow (&vector_stack, read_rtx (infile));
 >  > doesn't fix the problem. The error is still there:
 >  > ...
 >  > ../../gcc-3.2.3/gcc/read-rtl.c: In function 'read_rtx':
 >  > ../../gcc-3.2.3/gcc/read-rtl.c:662: error: lvalue required as increment operand
 >  > ../../gcc-3.2.3/gcc/read-rtl.c:662:60: warning: C++ style comments are
 >  > not allowed in ISO C90
 >  > ../../gcc-3.2.3/gcc/read-rtl.c:662:60: warning: (this will be reported
 >  > only once per input file)
 >  > make[1]: *** [read-rtl.o] Error 1
 >  > make[1]: Leaving directory `/root/gcc/obj/gcc'
 >  > make: *** [all-gcc] Error 2
 > 
 > Well, you're going to have to fix the code.  Feel free to ask us, but
 > we'll need more information, such as the preprocessed source.
 > 
 > Yeah, I suppose I could try building it myself, but it's not a very
 > interesting thing to do.  I might try a build later.

OK, I tried it.

Add this patch:

Index: system.h
===================================================================
--- system.h	(revision 131336)
+++ system.h	(working copy)
@@ -578,6 +578,7 @@
 #define really_call_calloc calloc
 #define really_call_realloc realloc
 
+
 #if (GCC_VERSION >= 3000)
 
 /* Note autoconf checks for prototype declarations and includes
@@ -589,7 +590,9 @@
 #undef realloc
 #undef calloc
 #undef strdup
+#if ! (defined(FLEX_SCANNER) || defined(YYBISON) || defined(YYBYACC))
  #pragma GCC poison malloc realloc calloc strdup
+#endif
 
 /* Old target macros that have moved to the target hooks structure.  */
  #pragma GCC poison ASM_OPEN_PAREN ASM_CLOSE_PAREN			\
@@ -628,4 +631,11 @@
 
 #endif /* GCC >= 3.0 */
 
+#if defined(FLEX_SCANNER) || defined(YYBISON) || defined(YYBYACC)
+/* Flex and bison use malloc and realloc.  Yuk.  Note that this means
+   really_call_* cannot be used in a .l or .y file.  */
+#define malloc xmalloc
+#define realloc xrealloc
+#endif
+
 #endif /* ! GCC_SYSTEM_H */


Configure like this:

  CC='gcc -g -ansi -std=c89' /home/aph/gcc/gcc-3_2-branch/configure --enable-languages=c++

Build:

  make bootstrap

Ought to do it.

Andrew.

-- 
Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, UK
Registered in England and Wales No. 3798903

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-01-05 20:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-05 22:42 cannot build gcc 3.2.3 in Suse 10.3 (gcc 4.2.1) Matteo Rama
2008-01-05 23:13 ` Andrew Haley
2008-01-06 10:58   ` Matteo Rama
2008-01-06 11:11     ` Andrew Haley
2008-01-07  5:16       ` Andrew Haley
2008-01-06 15:54     ` Tim Prince

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).