LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-24-2022, 08:45 AM   #1
yezhengmao
LQ Newbie
 
Registered: Jul 2022
Posts: 2

Rep: Reputation: 0
Unhappy compile error in gcc pass 2


host: ubuntu 20.04
lfs version : 11.1
in section 6.18. GCC-11.2.0 - Pass 2 , compile the gcc failed.
some errors just like this:
Code:
./config.h:361:19: error: multiple types in one declaration
  361 | #define ptrdiff_t int
      |                   ^~~
./config.h:361:19: error: declaration does not declare anything [-fpermissive]
./config.h:361:19: error: multiple types in one declaration
  361 | #define ptrdiff_t int
      |                   ^~~
./config.h:361:19: error: declaration does not declare anything [-fpermissive]
the env:
Code:
PWD={xxx}/lfs/sources/gcc-11.2.0/build
HOME=/home/lfs
TERM=screen
SHLVL=1
PS1=${debian_chroot:+($debian_chroot)}\u@\h:\w\$
LFS_TGT=x86_64-lfs-linux-gnu
LC_ALL=POSIX
LFS={xxx}/lfs/
CONFIG_SITE={xxx}/lfs//usr/share/config.site
PATH={xxx}/lfs//tools/bin:/usr/bin
OLDPWD={xxx}/lfs/sources/gcc-11.2.0
_=/usr/bin/env

Last edited by yezhengmao; 07-24-2022 at 10:57 PM.
 
Old 07-25-2022, 11:35 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,260

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
I take it that's in the make stage, but I don't know.

I'd go back to the beginning of the Binutils package at least (6.17) removing any source dirs and creating new ones. You have to get this right, because everything stands or falls on this. It's also where you find out if you passed over an error in chapters 5 or 6. You have to sort this, and be prepared to go back to the start of chapter 5 to do it.

I can't make much sense of that except that errors shouldn't be there. If it doesn't bale out, let it keep going. It may post warnings & continue. Errors should stop it. Normally when a compile pukes, hit up-arrow & return; it will repeat the make, skip to and show the error, & then bale out. Post that sequence, including your instruction.

Last edited by business_kid; 07-25-2022 at 11:39 AM.
 
Old 11-23-2022, 02:10 AM   #3
xlfs-0.2
Member
 
Registered: Oct 2022
Posts: 207

Rep: Reputation: 44
This is a lark because ubuntu has your (root) password. And you may have auto-update: you haven't said what gcc you are compiling with or even if it's llvm instead.

Did you try CFLAGS="$CFLAGS -Wno-fpermissive" like the message suggested?

You are compiling GCC-11.2.0. I will share my recipe knowlege. I can compile gcc-10.x with 4.x or 10.x without using -Wno-fpermissive, so I think you have something deeper wrong. But that doesn't mean you can't get away with trying some CFLAGS.

But what compiler are you compiling it with? gcc-6? gcc-10? (and are your headers clean if your in ubuntu not building a whole chain from scratch?)

(ps, GCC-12 has a built-in can't remove feature that downloads during compile from unknown source websites. think about it!)
 
Old 11-23-2022, 02:25 AM   #4
xlfs-0.2
Member
 
Registered: Oct 2022
Posts: 207

Rep: Reputation: 44
config.h usally is like "#define HAVE_FOO 1", it doesn't usually do things gcc/include/ does like typedef globally. (i'm not sure on gcc-11.x)

#define ptrdiff_t int

there is a subtly here that ./configure compiles while checking (which sometimes makes compile errors by using malformed tests) that aren't errors for gcc.

You need more of the log posted. Where is config.h?

Did you find it in gcc-11.0-build/ ? Did you attempt building in gcc-11.0 despite it says not to?

sh ./configure 2>&1 >log1 2>&1

and configure keeps it's own log of tests, that should be looked at also

NOW that happened in pass-2 which is not a simple matter. So doubly so you should a build log saying what directory that make(1) is entering and leaving (Q: what part of pass-2).

Last edited by xlfs-0.2; 11-23-2022 at 02:27 AM.
 
Old 11-23-2022, 09:30 AM   #5
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,567
Blog Entries: 19

Rep: Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448
Quote:
Originally Posted by xlfs-0.2 View Post
you haven't said what gcc you are compiling with or even if it's llvm instead.
At this stage in compilation, he'd be using the Pass 1 gcc compiled earlier in chapter 5
Quote:
Did you try CFLAGS="$CFLAGS -Wno-fpermissive" like the message suggested?
I think that's probably bad advice. The recommendation is to follow the Book carefully, at least in your first build. Adding your own flags is usually not a good idea unless you really know what you are doing.

The LFS version being used is slightly out of date but it's only a point release difference so that's unlikely to be the cause of the problem.

Ubuntu isn't considered to be a very good LFS host. Did you ensure before starting that your awk was gawk and not mawk, and your system shell is bash and not dash? All the Debian family use mawk and dash and they aren't recommended. Also, given that Ubuntu is fairly bleeding edge and you are using an older LFS book, did you check that your host compilation tools are not too recent?

Last edited by hazel; 11-23-2022 at 09:34 AM.
 
1 members found this post helpful.
  


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
LFS v10 - gcc compile pass 1 - error 77 & error 2 (Early stage 2 failure) fiajm Linux From Scratch 5 11-29-2020 09:02 AM
[SOLVED] lfs version 10 - gcc compile pass 1 - error 77 & error 2 dns2887 Linux From Scratch 6 11-14-2020 11:02 PM
gcc-4.5.2 - Pass 1 error -gcc command not found ?? adi_30stm Linux From Scratch 20 11-17-2011 12:23 PM
questions on GCC-3.4.3 - Pass 2 and Binutils-2.15.94.0.2.2 - Pass 2 satimis Linux From Scratch 7 12-26-2005 09:23 PM

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

All times are GMT -5. The time now is 09:35 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