LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux From Scratch (https://www.linuxquestions.org/questions/linux-from-scratch-13/)
-   -   Error while compiling GCC 6.3.0 (LFS 8.0) on Arch Linux with GCC 7.1.0 (https://www.linuxquestions.org/questions/linux-from-scratch-13/error-while-compiling-gcc-6-3-0-lfs-8-0-on-arch-linux-with-gcc-7-1-0-a-4175610123/)

nonick721 07-18-2017 02:41 PM

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

Keith Hedger 07-18-2017 07:03 PM

post the output of the version script so we can check your host is complient

Laserbeak 07-18-2017 08:20 PM

It looks like you're comparing pointers with text, which doesn't make sense.

rtmistler 07-19-2017 10:14 AM

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.

Krejzi 07-19-2017 01:40 PM

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.

nonick721 07-20-2017 01:29 PM

Well, I tested GCC-7.1.0 now, it works fine.

hendrickxm 07-27-2017 04:26 PM

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.