Error while compiling GCC 6.3.0 (LFS 8.0) on Arch Linux with GCC 7.1.0
Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.