crtc-demos / gcc-ia16

GNU General Public License v2.0
14 stars 2 forks source link

Fails to build with Fedora 26 (gcc version 7.2.1 20170915 (Red Hat 7.2.1-2) (GCC) ) #4

Open EtchedPixels opened 6 years ago

EtchedPixels commented 6 years ago

g++ -fno-PIE -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -I. -I. -I../.././gcc -I../.././gcc/. -I../.././gcc/../include -I../.././gcc/../libcpp/include -I../.././gcc/../libdecnumber -I../.././gcc/../libdecnumber/dpd -I../libdecnumber -I../.././gcc/../libbacktrace -o ubsan.o -MT ubsan.o -MMD -MP -MF ./.deps/ubsan.TPo ../.././gcc/ubsan.c ../.././gcc/ubsan.c: In function ‘bool ubsan_use_new_style_p(location_t)’: ../.././gcc/ubsan.c:1474:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] || xloc.file == '\0' || xloc.file[0] == '\xff' ^~~~ make[2]: *** [Makefile:1084: ubsan.o] Error 1

EtchedPixels commented 6 years ago

I assume it should be xloc.file[0] here ?

tkchia commented 6 years ago

I am not getting this error in my build of gcc-ia16. Indeed, as far as I can tell, the IA-16 port does not have libsanitizer support, so should not (currently) be affected by the glitch in gcc/ubsan.c.

Are you using the build script in build-ia16 to build gcc-ia16? (Alternatively, you might try my fork.) The build script will supply the needed switches to GCC's configure script, and also select the IA-16 target.

E.g. the commands

./fetch.sh ./build.sh binutils isl gcc1 newlib gcc2

will build a stage 1 GCC targeted at IA-16, followed by newlib for IA-16, followed by a stage 2 GCC.

Thank you!

EtchedPixels commented 6 years ago

I did my own build so that's why I hit it.

tkchia commented 6 years ago

You need to give the correct options to GCC's configure -- I will suggest you at least look at what the build-ia16 code does, even if you do not actually run it.

Among other things, I think you need to specify --target=ia16-elf to configure to select the ia16-elf target. Although gcc-ia16 code does add an additional IA-16 back-end, you have to explicitly select it, or else configure will (just like stock GCC) try to target your host platform.

Again, I suggest checking out the build-ia16 code.

EtchedPixels commented 6 years ago

Yeah I've built a few gcc's in my time. With the problem line tweaked I have it built and generating what looks like sane code.

tkchia commented 6 years ago

Glad to hear it. Thank you!