This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: error installing previous gcc version


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]