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

When compiling toolchain with buildroot - gcc ubsan compilation error: 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] #4

Open
XVilka opened this issue Jul 16, 2018 · 3 comments

Comments

@XVilka
Copy link

XVilka commented Jul 16, 2018

Compiling on Gentoo, gcc 7.3.0:

/usr/x86_64-pc-linux-gnu/gcc-bin/7.3.0/g++ -fno-PIE -c   -O2 -I/home/xvilka/radare/competition/csky/buildroot/output/host/include -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/home/xvilka/radare/competition/csky/buildroot/output/host/include -I/home/xvilka/radare/competition/csky/buildroot/output/host/include 
-I/home/xvilka/radare/competition/csky/buildroot/output/host/include  -I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc/../libbacktrace   -o 
tree-call-cdce.o -MT tree-call-cdce.o -MMD -MP -MF ./.deps/tree-call-cdce.TPo ../../gcc/tree-call-cdce.c
In file included from ./tm.h:32:0,
                 from ../../gcc/backend.h:28,
                 from ../../gcc/tree-call-cdce.c:24:
../../gcc/config/csky/abiv1_csky.h:866:0: warning: "ASM_APP_ON" redefined
 #define ASM_APP_ON "// inline asm begin\n"
 
In file included from ./tm.h:29:0,
                 from ../../gcc/backend.h:28,
                 from ../../gcc/tree-call-cdce.c:24:
../../gcc/config/gnu-user.h:33:0: note: this is the location of the previous definition
 #define ASM_APP_ON "#APP\n"
 
In file included from ./tm.h:32:0,
                 from ../../gcc/backend.h:28,
                 from ../../gcc/tree-call-cdce.c:24:
../../gcc/config/csky/abiv1_csky.h:867:0: warning: "ASM_APP_OFF" redefined
 #define ASM_APP_OFF "// inline asm end\n"
 
In file included from ./tm.h:29:0,
                 from ../../gcc/backend.h:28,
                 from ../../gcc/tree-call-cdce.c:24:
../../gcc/config/gnu-user.h:36:0: note: this is the location of the previous definition
 #define ASM_APP_OFF "#NO_APP\n"
 
../../gcc/1
       || xloc.file == '\0' || xloc.file[0] == '\xff'
                       ^~~~
make[2]: *** [Makefile:1085: ubsan.o] Error 1
make[2]: *** Waiting for unfinished jobs....
rm gcov-tool.pod cpp.pod gcov.pod gpl.pod gfdl.pod fsf-funding.pod gcc.pod
make[2]: Leaving directory '/home/xvilka/radare/competition/csky/buildroot/output/build/host-gcc-initial-080eee5e337301372ee587b8e7938629fe5e3fb8/build/gcc'
make[1]: *** [Makefile:4113: all-gcc] Error 2
make[1]: Leaving directory '/home/xvilka/radare/competition/csky/buildroot/output/build/host-gcc-initial-080eee5e337301372ee587b8e7938629fe5e3fb8/build'
make: *** [package/pkg-generic.mk:251: /home/xvilka/radare/competition/csky/buildroot/output/build/host-gcc-initial-080eee5e337301372ee587b8e7938629fe5e3fb8/.stamp_built] Error 2
@guoren83
Copy link
Member

The problem is from gcc7.3 compile gcc6.3 it's not a C-SKY issue.
Please try in ubuntu 16.04.
You also can download pre-built toolchain from https://gitlab.com/c-sky/buildroot/pipelines

@XVilka
Copy link
Author

XVilka commented Jul 19, 2018

They fixed it in the later 6.x versions, can you please rebase your code on top of them? https://github.com/gcc-mirror/gcc/blob/gcc-6-branch/gcc/ubsan.c#L1477

@guoren83
Copy link
Member

guoren83 commented Dec 8, 2018

Good idea, I'll push our toolchain guys.

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