public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* error installing previous gcc version
@ 2007-11-22 21:11 D'arito
  2007-11-23  4:21 ` Tom Browder
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: D'arito @ 2007-11-22 21:11 UTC (permalink / raw)
  To: gcc-help


HI Folks,
I need to "undergrade" my gcc version that comes with openSuse 10.2 . Well
the default version is gcc version 4.1.2 20061115 (prerelease) (SUSE Linux).
I do really need the old version, because my "mentor" told me my code
compiles properly with gcc-3.3.3 ( just I need to compile using a static
library called libESP.a) . So I decided to install a previous version in
order to avoid modify the libESP.a , cause I thought it was harder than
install another compiler version.

After reading in forums, asking buddies, and losing a lot of time( I know
that's the way sometimes) I couldn't install gcc-3.3.3 yet ! It's so
annoying. I just claim for help .

I've achieved to run the configure script in a gcc-build directory, but I
got an error withing the make. :
../../gcc-3.3.3/gcc/read-rtl.c: In function ‘read_rtx’:
../../gcc-3.3.3/gcc/read-rtl.c:653: error: invalid lvalue in increment
make[1]: *** [read-rtl.o] Error 1
make[1]: Leaving directory `/opt/gcc3/gcc-build/gcc'
make: *** [all-gcc] Error 2


I've also tried by using rpms without success too...

Feel free to ask me for important data , kie logs or whatever you need.

I'm able to establish a VNC session if anyone have time to help me online.
thanks a lot , I would appreciate your interest so much !!

Frank
espasapalau at gmail dot com
-- 
View this message in context: http://www.nabble.com/error-installing-previous-gcc-version-tf4857972.html#a13901697
Sent from the gcc - Help mailing list archive at Nabble.com.

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

* Re: error installing previous gcc version
  2007-11-22 21:11 error installing previous gcc version D'arito
@ 2007-11-23  4:21 ` Tom Browder
  2007-11-23  4:33 ` Brian Dessent
  2007-11-23 10:13 ` Andrew Haley
  2 siblings, 0 replies; 5+ messages in thread
From: Tom Browder @ 2007-11-23  4:21 UTC (permalink / raw)
  To: D'arito; +Cc: gcc-help

On Nov 22, 2007 12:54 PM, D'arito <espasapalau@gmail.com> wrote:
>
> HI Folks,
> I need to "undergrade" my gcc version that comes with openSuse 10.2 . Well
> the default version is gcc version 4.1.2 20061115 (prerelease) (SUSE Linux).

I tried to install gcc-3.3.3 with gcc-4.3 and had the same error you
did, and that reinforces my first thought:

My first thought is that gcc-3.3.3 is VERY old (especially for C++)
and you are probably trying to deal with old, non-standard code that
need fixing (including gcc-3.3.3).  I've run into the same kinds of
problems with old C and FORTRAN code and eventually had to bite the
bullet:: fix the old code and bring it into the 21st century.  It
sounds like you're fortunate enough to at least have the original
source code, so you can fix it.

But as a last resort, try to find old 3.3.3 binaries, perhaps even
making a clean installation of Fedora Core 2 (or whichever old FC had
3.3.3 as the default gcc).

LOL.

BTW, I think your "mentor" is not keeping up with the times.

-Tom

Tom Browder
Niceville, Florida
USA

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

* Re: error installing previous gcc version
  2007-11-22 21:11 error installing previous gcc version D'arito
  2007-11-23  4:21 ` Tom Browder
@ 2007-11-23  4:33 ` Brian Dessent
  2007-11-23 10:13 ` Andrew Haley
  2 siblings, 0 replies; 5+ messages in thread
From: Brian Dessent @ 2007-11-23  4:33 UTC (permalink / raw)
  To: D'arito; +Cc: gcc-help

D'arito wrote:

> I've achieved to run the configure script in a gcc-build directory, but I
> got an error withing the make. :
> ../../gcc-3.3.3/gcc/read-rtl.c: In function ‘read_rtx’:
> ../../gcc-3.3.3/gcc/read-rtl.c:653: error: invalid lvalue in increment
> make[1]: *** [read-rtl.o] Error 1
> make[1]: Leaving directory `/opt/gcc3/gcc-build/gcc'
> make: *** [all-gcc] Error 2

The reason this won't compile is that the 3.3 code used a nonstandard
language extension here (lvalue cast) that was deprecated in 3.4 and
then removed in 4.0.

You run into these general sorts of problems when trying to compile
older code with a newer gcc, because gcc tends to get more strict about
rejecting invalid code over time rather than more permissive.

The solution is that you need to build an intermediate version (most
likely 3.4.x) and then use that to build your desired 3.3.3 version.

If you want a shortcut you can try applying the obstack.h changes from
this patch: <http://gcc.gnu.org/viewcvs?view=rev&revision=72826>.  But
beware that there are almost certainly other incompatibilities lurking
in the gcc code base so using an intermediate version is always the
generally correct solution.

Brian

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

* Re: error installing previous gcc version
  2007-11-22 21:11 error installing previous gcc version D'arito
  2007-11-23  4:21 ` Tom Browder
  2007-11-23  4:33 ` Brian Dessent
@ 2007-11-23 10:13 ` Andrew Haley
  2007-11-23 13:16   ` Andrew Haley
  2 siblings, 1 reply; 5+ messages in thread
From: Andrew Haley @ 2007-11-23 10:13 UTC (permalink / raw)
  To: D'arito; +Cc: gcc-help

D'arito writes:
 > 
 > HI Folks,
 > I need to "undergrade" my gcc version that comes with openSuse
 > 10.2. Well the default version is gcc version 4.1.2 20061115
 > (prerelease) (SUSE Linux).  I do really need the old version,
 > because my "mentor" told me my code compiles properly with
 > gcc-3.3.3 ( just I need to compile using a static library called
 > libESP.a) . So I decided to install a previous version in order to
 > avoid modify the libESP.a , cause I thought it was harder than
 > install another compiler version.
 > 
 > After reading in forums, asking buddies, and losing a lot of time(
 > I know that's the way sometimes) I couldn't install gcc-3.3.3 yet !
 > It's so annoying. I just claim for help .
 > 
 > I've achieved to run the configure script in a gcc-build directory, but I
 > got an error withing the make. :
 > ../../gcc-3.3.3/gcc/read-rtl.c: In function ?read_rtx?:
 > ../../gcc-3.3.3/gcc/read-rtl.c:653: error: invalid lvalue in increment
 > make[1]: *** [read-rtl.o] Error 1
 > make[1]: Leaving directory `/opt/gcc3/gcc-build/gcc'
 > make: *** [all-gcc] Error 2
 > 
 > 
 > I've also tried by using rpms without success too...
 > 
 > Feel free to ask me for important data , kie logs or whatever you need.
 > 
 > I'm able to establish a VNC session if anyone have time to help me online.
 > thanks a lot , I would appreciate your interest so much !!

OK.  I can see your problem: you have nonstandard code that gcc won't
compile any more, so you want an old gcc that will compile it.  But the
new gcc won't compile the old gcc either.

I'm guessing that the problem here is that old gcc uses what's known
as an "lvalue cast", which is a language feature that has been removed
from gcc.  It's possible to fix the gcc source so that it doesn't use
an lvalue cast, or it's possible to fix your own code so that it
compiles with a modern gcc.  I'd do the latter.

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] 5+ messages in thread

* Re: error installing previous gcc version
  2007-11-23 10:13 ` Andrew Haley
@ 2007-11-23 13:16   ` Andrew Haley
  0 siblings, 0 replies; 5+ messages in thread
From: Andrew Haley @ 2007-11-23 13:16 UTC (permalink / raw)
  To: D'arito, gcc-help

Andrew Haley writes:
 > D'arito writes:
 >  > 
 >  > HI Folks,
 >  > I need to "undergrade" my gcc version that comes with openSuse
 >  > 10.2. Well the default version is gcc version 4.1.2 20061115
 >  > (prerelease) (SUSE Linux).  I do really need the old version,
 >  > because my "mentor" told me my code compiles properly with
 >  > gcc-3.3.3 ( just I need to compile using a static library called
 >  > libESP.a) . So I decided to install a previous version in order to
 >  > avoid modify the libESP.a , cause I thought it was harder than
 >  > install another compiler version.
 >  > 
 >  > After reading in forums, asking buddies, and losing a lot of time(
 >  > I know that's the way sometimes) I couldn't install gcc-3.3.3 yet !
 >  > It's so annoying. I just claim for help .
 >  > 
 >  > I've achieved to run the configure script in a gcc-build directory, but I
 >  > got an error withing the make. :
 >  > ../../gcc-3.3.3/gcc/read-rtl.c: In function ?read_rtx?:
 >  > ../../gcc-3.3.3/gcc/read-rtl.c:653: error: invalid lvalue in increment
 >  > make[1]: *** [read-rtl.o] Error 1
 >  > make[1]: Leaving directory `/opt/gcc3/gcc-build/gcc'
 >  > make: *** [all-gcc] Error 2
 >  > 
 >  > 
 >  > I've also tried by using rpms without success too...
 >  > 
 >  > Feel free to ask me for important data , kie logs or whatever you need.
 >  > 
 >  > I'm able to establish a VNC session if anyone have time to help me online.
 >  > thanks a lot , I would appreciate your interest so much !!
 > 
 > OK.  I can see your problem: you have nonstandard code that gcc won't
 > compile any more, so you want an old gcc that will compile it.  But the
 > new gcc won't compile the old gcc either.
 > 
 > I'm guessing that the problem here is that old gcc uses what's known
 > as an "lvalue cast", which is a language feature that has been removed
 > from gcc.  It's possible to fix the gcc source so that it doesn't use
 > an lvalue cast, or it's possible to fix your own code so that it
 > compiles with a modern gcc.  I'd do the latter.

If you want to fix the lvalue cast in obstack.h you can just do
something like this:

# define obstack_ptr_grow(OBSTACK,datum)			\
__extension__							\
({ struct obstack *__o = (OBSTACK);				\
   if (__o->next_free + sizeof (void *) > __o->chunk_limit)	\
     _obstack_newchunk (__o, sizeof (void *));			\
   void **__tmp = (void**)__o->next_free;			\
   *__tmp++ = ((void *)datum);					\
   __o->next_free = (char*)__tmp;				\
   /* *((void **)__o->next_free)++ = ((void *)datum); */	\
   (void) 0; })

This might be all you need, but I wouldn't guarantee it.  You must
make gcc-3.3.3 with "make bootstrap".

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] 5+ messages in thread

end of thread, other threads:[~2007-11-23 10:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-22 21:11 error installing previous gcc version D'arito
2007-11-23  4:21 ` Tom Browder
2007-11-23  4:33 ` Brian Dessent
2007-11-23 10:13 ` Andrew Haley
2007-11-23 13:16   ` Andrew Haley

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).