LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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-31-2017, 10:40 PM   #1
archerisedgy
LQ Newbie
 
Registered: Jul 2017
Distribution: Arch, and Gentoo.
Posts: 3

Rep: Reputation: Disabled
Angry GCC Errors


Currently building a LFS system on my Arch host.
I ran into a error, spent some time googling it and have not found a solution.
After trying to compile GCC I was given this error.
Code:
../../gcc/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]
       || xloc.file == '\0' || xloc.file[0] == '\xff'
                       ^~~~
make[2]: *** [Makefile:1085: ubsan.o] Error 1
make[2]: Leaving directory '/mnt/lfs/sources/gcc-6.3.0/build/gcc'
make[1]: *** [Makefile:4119: all-gcc] Error 2
make[1]: Leaving directory '/mnt/lfs/sources/gcc-6.3.0/build'
make: *** [Makefile:864: all] Error 2
 
Old 07-31-2017, 10:56 PM   #2
Rustman
LQ Newbie
 
Registered: Jul 2017
Posts: 10

Rep: Reputation: Disabled
Quote:
Originally Posted by archerisedgy View Post
Currently building a LFS system on my Arch host.
I ran into a error, spent some time googling it and have not found a solution.
After trying to compile GCC I was given this error.
Code:
../../gcc/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]
       || xloc.file == '\0' || xloc.file[0] == '\xff'
                       ^~~~
make[2]: *** [Makefile:1085: ubsan.o] Error 1
make[2]: Leaving directory '/mnt/lfs/sources/gcc-6.3.0/build/gcc'
make[1]: *** [Makefile:4119: all-gcc] Error 2
make[1]: Leaving directory '/mnt/lfs/sources/gcc-6.3.0/build'
make: *** [Makefile:864: all] Error 2
This is just a shot in the dark, but, if your host is ArchLinux, your GCC version is likely 7.1.0.

LFS 8.0 only guarantees a host GCC version of between 4.7 and 6.3.0. (See Section 2.2, GCC-4.7)(http://www.linuxfromscratch.org/lfs/.../hostreqs.html)

There have been others that have gotten it to work, but others have not. (http://www.linuxquestions.org/questi...-a-4175610123/)

My recommendation is to change to a different host and try it again. I have gotten a solid LFS build put together within the last week with slackware.
 
Old 07-31-2017, 11:11 PM   #3
Rustman
LQ Newbie
 
Registered: Jul 2017
Posts: 10

Rep: Reputation: Disabled
This is just a shot in the dark, but, if your host is ArchLinux, your GCC version is likely 7.1.0.

LFS 8.0 only guarantees a host GCC version of between 4.7 and 6.3.0. (See LFS 8.0, Section 2.2)

There have been some that have gotten it to work, but others have not.

My recommendation is to change to a different host and try it again. I have gotten a solid LFS build put together within the last week with slackware.

(Note: I had originally posted this with links to sources for all that stuff, but apparently this forum doesn't like that so it need moderator approval. If this message posts two, three, four times... that's why)

Last edited by Rustman; 07-31-2017 at 11:15 PM.
 
Old 07-31-2017, 11:28 PM   #4
archerisedgy
LQ Newbie
 
Registered: Jul 2017
Distribution: Arch, and Gentoo.
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks for the info Rustman. I'm not sure if I resolved my issue or not. I moved the build dirrectory from the gcc folder to the sources folder. After generating the make file even though it finished with a Error2 and installed with a error 2, I was able to install it I think?
In the directory /tools/libs there is a gcc folder.
Inside gcc is a folder called xf86_46-linux-gnu.
 
Old 07-31-2017, 11:34 PM   #5
Rustman
LQ Newbie
 
Registered: Jul 2017
Posts: 10

Rep: Reputation: Disabled
Quote:
Originally Posted by archerisedgy View Post
Thanks for the info Rustman. I'm not sure if I resolved my issue or not. I moved the build dirrectory from the gcc folder to the sources folder. After generating the make file even though it finished with a Error2 and installed with a error 2, I was able to install it I think?
In the directory /tools/libs there is a gcc folder.
Inside gcc is a folder called xf86_46-linux-gnu.
Maybe? Worst case scenario is you have to scrap it and start over, which is kind of expected anyway. I had to scrap my build twice before I got it to work to completion the first time. Give it a try and see what happens.
 
Old 08-01-2017, 01:36 AM   #6
hendrickxm
Member
 
Registered: Feb 2014
Posts: 344

Rep: Reputation: Disabled
I suggest you retry with gcc-6.4.0 or change host.
The newer gcc-version on your archlinux is probably the reason it fails.
Calculate Linux has great live CD's that work out of the box to build lfs.
I myself successfully build lfs-8.0 with gcc-6.4.0 on fedora 26, you need to install m4 and gcc-c++ (7.1.1).
 
Old 08-01-2017, 09:24 AM   #7
norobro
Member
 
Registered: Feb 2006
Distribution: Debian Sid
Posts: 792

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
There's a simple patch for that error if you want to try it: https://github.com/gcc-mirror/gcc/co...7970a3ad4L1474
 
Old 08-01-2017, 02:33 PM   #8
archerisedgy
LQ Newbie
 
Registered: Jul 2017
Distribution: Arch, and Gentoo.
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks for the replys everyone.
It seems it will just be better to change the host.
Thanks hendrickxm for recommending Calculate linux.
Ill give format the partions and give Calculate a try.
I'm a bit worried about my partion setup. Does this seem okay?
I have never manually had to make a extended partion till now.
Code:
                                                    Disk: /dev/sda
                                Size: 298.1 GiB, 320072933376 bytes, 625142448 sectors
                                          Label: dos, identifier: 0x364f383e

    Device           Boot               Start            End        Sectors       Size     Id Type
>>  /dev/sda1        *                   2048         978943         976896       477M     83 Linux                   
    /dev/sda2                          978944      378961919      377982976     180.2G     83 Linux
    /dev/sda3                       602861568      625142447       22280880      10.6G     82 Linux swap / Solaris
    /dev/sda4                       378961920      602861567      223899648     106.8G      5 Extended
    |-/dev/sda5      *              378963968      379940863         976896       477M     83 Linux
    `-/dev/sda6                     379942912      602861567      222918656     106.3G     83 Linux
sda1, sda2, and sda3 are for my Arch install.
The rest are for LFS.
 
  


Reply



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
errors compiling gcc 4.2.1 bio71 Linux - Software 2 02-17-2008 04:04 PM
gcc compiler errors rm_dash_rf_star Slackware 4 01-30-2008 12:40 AM
gcc errors gloomz Linux - Newbie 13 02-01-2007 10:02 AM
gcc errors? rlprofessional Linux - Newbie 1 06-13-2006 12:33 PM
gcc errors?? or are they? Rito Linux From Scratch 1 01-06-2003 04:54 PM

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

All times are GMT -5. The time now is 09:12 PM.

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