Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
EtchedPixels opened this issue Oct 14, 2017 · 6 comments

Comments

@EtchedPixels
Copy link

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
Copy link
Author

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

@tkchia
Copy link

tkchia commented Oct 14, 2017

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
Copy link
Author

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

@tkchia
Copy link

tkchia commented Oct 15, 2017

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
Copy link
Author

EtchedPixels commented Oct 16, 2017

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
Copy link

tkchia commented Oct 17, 2017

Glad to hear it. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants