Page 1 of 1

Error building GCC

Posted: Wed May 22, 2013 9:02 am
by 0xDani
Hello!

/* Sorry for my english, it isn't my native language */

I'm following this wiki article in order to build GCC 4.6.1, enabling C and C++, but in this step:

Code: Select all

make all-gcc
the compiler throws me some errors:
gcc -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Wold-style-definition -Wc++-compat -DHAVE_CONFIG_H -I. -I. -I../../gcc-4.6.1/gcc -I../../gcc-4.6.1/gcc/. -I../../gcc-4.6.1/gcc/../include -I../../gcc-4.6.1/gcc/../libcpp/include -I../../gcc-4.6.1/gcc/../libdecnumber -I../../gcc-4.6.1/gcc/../libdecnumber/dpd -I../libdecnumber gtype-desc.c -o gtype-desc.o
gtype-desc.c:8868:18: error: el valor del subíndice no es ni matriz ni puntero ni vector
gtype-desc.c:8987:36: error: el valor del subíndice no es ni matriz ni puntero ni vector
gtype-desc.c:9071:31: error: el valor del subíndice no es ni matriz ni puntero ni vector
gtype-desc.c:9092:31: error: el valor del subíndice no es ni matriz ni puntero ni vector
gtype-desc.c:9099:31: error: el valor del subíndice no es ni matriz ni puntero ni vector
gtype-desc.c:9106:31: error: el valor del subíndice no es ni matriz ni puntero ni vector
As you can see, error messages are in Spanish (sorry), here is my translation, that might be incorrect:
error: index value is neither a matrix nor a pointer nor a vector
I actually know C programming, but I'm not gonna get through the whole code to try to fix it.

Could you help me?

Re: Error building GCC

Posted: Wed May 22, 2013 9:15 am
by jnc100
Its a known issue.

Basically, use the patch there or a more modern version of gcc.

Regards,
John.

Re: Error building GCC

Posted: Wed May 22, 2013 11:31 am
by 0xDani
Thanks for the help! I'll download a newer version of GCC.

Re: Error building GCC

Posted: Wed May 22, 2013 2:03 pm
by sortie
Set the LC_ALL=C environmental variable and build your gcc with --disable-nls to be sure to have english error messages. If you don't put in some effort so we have proper error messages, it's harder for us to help you and it'll be be harder to get help.

But yeah, there was a few minor releases of gcc that didn't bootstrap correctly with newer gcc versions, but the later patched versions fixed the problems.

Re: Error building GCC

Posted: Sun May 26, 2013 9:48 am
by 0xDani
Yes, I've built gcc and g++ with --disable-nls in order to get errors in english, as it was recommended in the wiki.

Finally I downloaded the 4.7.0 version and could build it succesfully.

Re: Error building GCC

Posted: Sun May 26, 2013 10:48 am
by sortie
I recommend you use the newest minor version of every major release. For instance, if you wish to use the gcc 4.7.x series, I recommend you use gcc 4.7.3. I normally recommend you use the newest compiler. I just updated the cross-compiler tutorial (http://wiki.osdev.org/GCC_Cross-Compiler) heavily, and added a tutorial if you wish to update your system compiler (http://wiki.osdev.org/Building_GCC).