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

Error while building gcc-6.3.0/gcc/ubsan.c:1474:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] #992

Closed
archcomp opened this Issue Jun 18, 2018 · 8 comments

Comments

Projects
None yet
5 participants
@archcomp

archcomp commented Jun 18, 2018

Using crosstool-NG 1.23.0 with Ubuntu 18.04 LTS.
When Building, it gives error

[INFO ] Installing pass-1 core C gcc compiler
[EXTRA] Configuring core C gcc compiler
[EXTRA] Building gcc
[ERROR] /home/mv/crosstool-ng/.build/src/gcc-6.3.0/gcc/ubsan.c:1474:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
[ERROR] make[2]: *** [ubsan.o] Error 1
[ERROR] make[2]: *** Waiting for unfinished jobs....
[ERROR] make[1]: *** [all-gcc] Error 2
[ERROR]
[ERROR] >>
[ERROR] >> Build failed in step 'Installing pass-1 core C gcc compiler'
[ERROR] >> called in step '(top-level)'
[ERROR] >>
[ERROR] >> Error happened in: CT_DoExecLog[scripts/functions@338]
[ERROR] >> called from: do_gcc_core_backend[scripts/build/cc/100-gcc.sh@674]
[ERROR] >> called from: do_gcc_core_pass_1[scripts/build/cc/100-gcc.sh@227]
[ERROR] >> called from: do_cc_core_pass_1[scripts/build/cc.sh@35]
[ERROR] >> called from: main[scripts/crosstool-NG.sh@653]
[ERROR] >>
[ERROR] >> For more info on this error, look at the file: 'build.log'
[ERROR] >> There is a list of known issues, some with workarounds, in:
[ERROR] >> 'docs/B - Known issues.txt'
Build Log file attached.
build.log

@gmac80

This comment has been minimized.

gmac80 commented Jul 2, 2018

Hi,
When compiling using pages 3 and 5 of Bootlin's instructions on Ubuntu 18.04 LTS, I had the same issue, but was able to compile once I inserted a (const char*) cast:
if (xloc.file == NULL || strncmp (xloc.file, "\1", 2) == 0 || xloc.file == (const char*)'\0' || xloc.file[0] == '\xff' || xloc.file[1] == '\xff')

Please could a maintainer verify that this is the correct solution.

@tpetazzoni

This comment has been minimized.

Contributor

tpetazzoni commented Jul 3, 2018

This issue is a duplicate of #735, i.e the problem exists in CT-NG 1.23.0 but not in later versions.

@halilgithub

This comment has been minimized.

halilgithub commented Jul 16, 2018

@gmac80

In which file did you do the fix ?

@stilor

This comment has been minimized.

Contributor

stilor commented Sep 28, 2018

The fix was in one of the patches in the packages/gcc; AFAIR it is fixed in the current GCC6 release upstream (6.4).

@stilor stilor closed this Sep 28, 2018

@stilor

This comment has been minimized.

Contributor

stilor commented Sep 28, 2018

@gmac80 No, your fix was not correct: your check is equivalent to the 1st condition (xloc.file == NULL). It should've been xloc.file[0] == '\0'.

@gmac80

This comment has been minimized.

gmac80 commented Sep 28, 2018

@gmac80

This comment has been minimized.

gmac80 commented Sep 28, 2018

@stilor

This comment has been minimized.

Contributor

stilor commented Sep 29, 2018

@gmac80 The source is that the code was invalid, but older compilers failed to detect it. When the host OS switched to newer compiler, that code started to err out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment