LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This 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


Reply
  Search this Thread
Old 07-18-2017, 02:41 PM   #1
nonick721
LQ Newbie
 
Registered: Jul 2017
Posts: 3

Rep: Reputation: Disabled
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
 
Old 07-18-2017, 07:03 PM   #2
Keith Hedger
Senior Member
 
Registered: Jun 2010
Location: Wiltshire, UK
Distribution: Linux From Scratch, Slackware64, Partedmagic
Posts: 3,137

Rep: Reputation: 855Reputation: 855Reputation: 855Reputation: 855Reputation: 855Reputation: 855Reputation: 855
post the output of the version script so we can check your host is complient
 
Old 07-18-2017, 08:20 PM   #3
Laserbeak
Member
 
Registered: Jan 2017
Location: Manhattan, NYC NY
Distribution: Mac OS X, iOS, Solaris
Posts: 508

Rep: Reputation: 143Reputation: 143
It looks like you're comparing pointers with text, which doesn't make sense.
 
Old 07-19-2017, 10:14 AM   #4
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,877
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
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.
 
Old 07-19-2017, 01:40 PM   #5
Krejzi
Member
 
Registered: Jan 2015
Posts: 215

Rep: Reputation: Disabled
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.
 
Old 07-20-2017, 01:29 PM   #6
nonick721
LQ Newbie
 
Registered: Jul 2017
Posts: 3

Original Poster
Rep: Reputation: Disabled
Well, I tested GCC-7.1.0 now, it works fine.
 
Old 07-27-2017, 04:26 PM   #7
hendrickxm
Member
 
Registered: Feb 2014
Posts: 344

Rep: Reputation: Disabled
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
error using lfs while compiling lfs book's 6.12 (gcc-4.1.2) section aditya_gpch Linux From Scratch 3 04-24-2008 04:23 PM
GCC error when compiling it for LFS safrout Linux From Scratch 1 06-14-2003 06:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 07:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration