cyphunk
Joined: 09 Mar 2009 Posts: 6
|
Posted: Mon Mar 09, 2009 11:44 pm Post subject: solution to errors installing gcc-3.2.2 on host with >gcc |
|
|
Ran into two erros when installing the gcc version recommended on the bladox site (3.3.2) with my linux host which has gcc 4.1.2.
Error 1:
Quote: | ./read-rtl.c:653: error: invalid lvalue in increment |
Solution:
This is a problem relating to casting and required editing two lines as suggested here:
diff -u -r1.1.1.1 obstack.h
Code: | --- obstack.h 23 Jul 2003 02:42:35 -0000 1.1.1.1
+++ obstack.h 22 Jan 2006 12:41:15 -0000
@@ -423,7 +423,8 @@
({ struct obstack *__o = (OBSTACK); \
if (__o->next_free + sizeof (void *) > __o->chunk_limit) \
_obstack_newchunk (__o, sizeof (void *)); \
- *((void **)__o->next_free)++ = ((void *)datum); \
+ *((void **)__o->next_free) = ((void *)datum); \
+ __o->next_free += sizeof(void *); \
(void) 0; }) |
Error 2:
Quote: | config/avr/libgcc.S: Assembler messages:
config/avr/libgcc.S:72: Error: suffix or operands invalid for `clr'
config/avr/libgcc.S:72: Error: no such instruction: `clear result'
config/avr/libgcc.S:74: Error: no such instruction: `sbrc r24,0'
config/avr/libgcc.S:75: Error: too many memory references for `add' |
Solution:
The xgcc compiler had trouble finding the avr-binutils. Running strace on the failed compile shows it looks for it in <builddir>/gcc/avr/3.3.2/. I'm sure there is a smarter way to solve this but instead of reading man pages I linked /usr/local/bin/avr-as to <builddir>/gcc/avr/3.3.2/as along with the other avr functions in the /usr/local/bin directory.
after this GCC compiled just fine. |
|