embox / crosstool

Script to build toolchain for various architectures
0 stars 2 forks source link

Build fails #2

Open sikmir opened 8 years ago

sikmir commented 8 years ago

Host gcc 6.2.1.

In file included from ../../gcc-4.9.2/gcc/cp/except.c:1013:0:
cfns.gperf: In function ‘const char* libc_name_p(const char*, unsigned int)’:
cfns.gperf:101:1: error: ‘const char* libc_name_p(const char*, unsigned int)’ redeclared inline with ‘gnu_inline’ attribute
cfns.gperf:26:14: note: ‘const char* libc_name_p(const char*, unsigned int)’ previously declared here
cfns.gperf: At global scope:
cfns.gperf:26:14: warning: inline function ‘const char* libc_name_p(const char*, unsigned int)’ used but never defined
make[1]: *** [Makefile:1057: cp/except.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/home/sikmir/projects/crosstool/build-microblaze/build-gcc/gcc'
make: *** [Makefile:3976: all-gcc] Error 2
Building gcc failed
AntonKozlov commented 7 years ago

Hi!

I faced same issue. As far as I can see, it's not an warning that treated as error (like -werror), but a real error detected only by newer gcc.

What is your host OS? You can use prebuilt toolchain in case you're on linux: https://github.com/embox/crosstool/releases/tag/current

anton-bondarev commented 7 years ago

Please try in #4 I update all tools version

sikmir commented 6 years ago
$ gcc -v
<...>
gcc version 8.1.1 20180531 (GCC)
$ ./crosstool.sh i386
<...>
../../gcc-6.3.0/gcc/ubsan.c: In function ‘bool ubsan_use_new_style_p(location_t)’:
../../gcc-6.3.0/gcc/ubsan.c:1474:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
       || xloc.file == '\0' || xloc.file[0] == '\xff'
                       ^~~~
make[1]: *** [Makefile:1085: ubsan.o] Error 1
make[1]: Leaving directory '/home/sikmir/Projects/crosstool/build-i386/build-gcc/gcc'
make: *** [Makefile:4135: all-gcc] Error 2
Building gcc failed
AntonKozlov commented 6 years ago

I can confirm the error. It's obviously because gcc 6.3 bug is detected by recent gcc's. The filename (ubsan) hints that the bug is not in the core but in utilities, so there is no rush to update gcc version.

I can assume several options:

  1. Use prebuilt toolchain. Will that suit for you, i.e. is your host OS is Linux?
  2. Update to more recent gcc. I personally would not prefer this, it's hard to predict what other issues we'll face during update and later while using new toolchain.