Error while compiling GCC 6.3.0 (LFS 8.0) on Arch Linux with GCC 7.1.0
Hello guys.
I was planning to make my own Linux From Scratch distribution. For that I made myself an Arch Linux Virtual Machine with a virtual hard disk used for LFS, which I then copy on an USB Drive. Anyway, while compiling GCC, at the end I got following error message: [ALL ] /mnt/lfs/sources/gcc-6.3.0: In function 'bool ubsan_use_new_style_p(location_t)': [ERROR] /mnt/lfs/sources/gcc-6.3.0: 1474:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] [ALL ] || xloc.file == '0' || xloc.file[0] == 'xff' [ALL ] ^~~~ I really dont get this error message. I would really appreciate it if someone of you guys could help me. Sincerely, nonick |
post the output of the version script so we can check your host is complient
|
It looks like you're comparing pointers with text, which doesn't make sense.
|
I think line 1474 of whatever file contains the function, "bool ubsan_use_new_style_p(); may have some sort of error. It appears that there is or was line continuation and what the compiler seems to be seeing is a fragmented continuation of an existing if-test clause.
|
Most of the time you can't compile older gcc with newer one. The book specifies that a GCC version higher than one in the current book isn't supported. You can try and use gcc-6.4.0, which most likely has a patch for the issue.
|
Well, I tested GCC-7.1.0 now, it works fine.
|
I have tried building ch5 of lfs-8.0 with gcc-6.4.0 on fedora 26 and it worked for me.
Generally speaking you should not try to build a lfs toolchain that is older then the toolchain from your host. You can boot from a livecd or use a chroot if your host is too new. |
All times are GMT -5. The time now is 08:44 PM. |