Problems using gcc version 4.8.2 to build 4.6.2?

Started by PLawler, May 05, 2014, 01:54:31 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

PLawler

Hi!
I'm trying to build ML using Fedora 20 using the 'summons-arm' script and have stumbled across a problem. I believe this is because Fedora 20 uses gcc 4.8.2

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.2/gcc -I../../gcc-4.6.2/gcc/. -I../../gcc-4.6.2/gcc/../include -I../../gcc-4.6.2/gcc/../libcpp/include  -I../../gcc-4.6.2/gcc/../libdecnumber -I../../gcc-4.6.2/gcc/../libdecnumber/dpd -I../libdecnumber    gtype-desc.c -o gtype-desc.o
In file included from gtype-desc.c:30:0:
../../gcc-4.6.2/gcc/tree.h:3130:11: warning: identifier 'thread_local' conflicts with C++ keyword [-Wc++-compat]
  unsigned thread_local : 1;
           ^
gtype-desc.c:8829:18: error: subscripted value is neither array nor pointer nor vector
     sizeof (x_rtl[0]),
                  ^
gtype-desc.c:8948:36: error: subscripted value is neither array nor pointer nor vector
     sizeof (default_target_libfuncs[0]),
                                    ^
gtype-desc.c:9032:31: error: subscripted value is neither array nor pointer nor vector
     sizeof (default_target_rtl[0]),
                               ^
gtype-desc.c:9053:31: error: subscripted value is neither array nor pointer nor vector
     sizeof (default_target_rtl[0]),
                               ^
gtype-desc.c:9060:31: error: subscripted value is neither array nor pointer nor vector
     sizeof (default_target_rtl[0]),
                               ^
gtype-desc.c:9067:31: error: subscripted value is neither array nor pointer nor vector
     sizeof (default_target_rtl[0]),




The problem looks suspiciously (ie, the error is exactly the same and the line numbers nearly match...) like this GCC bug
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51969
Quote"[4.6 regression] trunk gcc unable to build gcc 4.6"
gcc-4.7 doesn't build gcc-4.6 anymore:

gtype-desc.c:8893:18: error: subscripted value is neither array nor pointer nor vector
gtype-desc.c:9012:36: error: subscripted value is neither array nor pointer nor vector
gtype-desc.c:9096:31: error: subscripted value is neither array nor pointer nor vector
gtype-desc.c:9117:31: error: subscripted value is neither array nor pointer nor vector
gtype-desc.c:9124:31: error: subscripted value is neither array nor pointer nor vector
gtype-desc.c:9131:31: error: subscripted value is neither array nor pointer nor vector
make[3]: *** [gtype-desc.o] Error 1


Fixed in 4.6.3

I've bumped my 'summons-arm' to pull 4.6.3 down (because lazy and instead of applying patch in that bug report, figure I'll try and avoid any other regression bugs for now in 4.6.2 ;), and while it's churning away just thought I'd post here to see if:
a) anyone else has experienced this
b) anyone knows if ML builds with 4.6.3
c) anyone has patched this by itself and have had a successful build out the other side
d) any other thoughts/comments

Marsu42

Quote from: PLawler on May 05, 2014, 01:54:31 AM
I'm trying to build ML using Fedora 20 using the 'summons-arm' script and have stumbled across a problem.

Just don't, use the arm toolchain from launchpad or you'll run into no ends of tiny problems and always wonder when some problem occurs if ML or your custom compiler is the cause.

https://launchpad.net/gcc-arm-embedded/+download

PLawler

Quote from: Marsu42 on May 05, 2014, 08:06:24 AM
Just don't, use the arm toolchain from launchpad or you'll run into no ends of tiny problems and always wonder when some problem occurs if ML or your custom compiler is the cause.
Ah, thanks.

Hmm should the 'summon-arm' script be changed, or something noted in it at least? I'm happy to file a bug report or something...

draekko

I was having this problem compiling the toolchain for compiling the 400plus code, i created a build script for use on Ubuntu (what i use) available at https://github.com/draekko/arm-462-toolchain-400plus with replacement summon-arm and relevant patches. Enjoy.