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 11-28-2020, 04:16 AM   #1
fiajm
LQ Newbie
 
Registered: Nov 2020
Distribution: Debian
Posts: 4

Rep: Reputation: Disabled
LFS v10 - gcc compile pass 1 - error 77 & error 2 (Early stage 2 failure)


Hi! I started with Debian 9 to workaround with LFS v10 for first time few days ago. I had stucked in (5.3) the first pass of GCC with the subject error [1] and decided to read ALL (without exceptions) the relevant literature, whether in the form of forums' messages, emails, bug's forms, manuals... because asking for help is for cowards.

So I read that a big difference between the host's GCC version and the target one could cause problems and I uninstalled gcc-6 and compiled gcc-11. Also is more common than it should be written to read that use -j1 would avoid some issues. Is true that provide another message error[1] but in a rational way. To see the behavior I try to make the gcc disabling also zlib and/or libiberty and/or other flags combinations using host provided libs without success, don't know why, maybe actually matter. I also tried other flags combinations, being unable to pass beyond the point when using --with-sysroot=$LFS

Well, my problem is the same as the described in [2] and other threads solved with the same logic. At the end of writing this message I'm working with last Debian testing and GCC-10

Please, ask me for more information about host or whatever. [3] Here is the last version check output. TIA

[1] https://pastebin.com/K9DkjRNN

[2] https://www.linuxquestions.org/quest...ll-4175653682/ - Not deserve visiting

[3] https://pastebin.com/SB8Ek55W
 
Old 11-29-2020, 04:23 AM   #2
hendrickxm
Member
 
Registered: Feb 2014
Posts: 344

Rep: Reputation: Disabled
The gcc (compiler) on the host should not be newer than the one you will compile in LFS. There are host requirements specified in the LFS book, if you meet those, you should be safe.
I compiled a custom LFS-10 (with gcc-9.3.0) on a host with gcc-6.4.0, it was a custom LFS-8.0 I used in a chroot.
I always recommend using either a live distro, something like calculate linux works perfect, or a chroot. One easy way to set up a chroot is using a stage3 gentoo tarball.
The first link points to a compiler not working, the last to another issue.
Most likely you made an error in copy/pasting the commands in earlier chapters.

Last edited by hendrickxm; 11-29-2020 at 04:24 AM.
 
Old 11-29-2020, 06:33 AM   #3
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,597
Blog Entries: 19

Rep: Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455
You will need to make some adjustments to your host system. Debian by default uses dash as its system shell and mawk as its awk. LFS requires bash and gawk. Did you fix that?

The general rules for host software versions are:

1) Never use an earlier version than the minimum given in the Book.
2) For gcc and binutils, don't use a later version either. They are untested.
 
Old 11-29-2020, 06:39 AM   #4
fiajm
LQ Newbie
 
Registered: Nov 2020
Distribution: Debian
Posts: 4

Original Poster
Rep: Reputation: Disabled
First of all thank you for your answer and tips, is a good one.

Second is not a typing issue because I've typed different times with the same error.

Is true that I changed some values like PS1. Things I changed shouldn't affect the result and specially I also tried with the original book's values/scripts. The truth is that I don't like to copy scripts with out understanding (it's not like running them)

I understand the live-gentoo tip (and may be the one that let me go on) but i think LFS should be build in any system with the precise adaptations, so it will be my last choice. I'm thinking in focus this as a gcc problem instead of a LFS issue.

I've ran some commands [1] exploring the host for anyone with privileged eyes. It shows the configuration flags.

Answering to hendrickxm the error with gcc-6, gcc-10 and gcc-11 have been the same.

Quote:
Originally Posted by hendrickxm View Post
The first link points to a compiler not working, the last to another issue.
I've found more threads with exactly the same error with no solution and post an example.

Quote:
Originally Posted by hendrickxm View Post
stage3 gentoo tarball
Got a link?

[1] https://pastebin.com/uhb3z0Ek

TIA

Last edited by fiajm; 11-29-2020 at 06:43 AM.
 
Old 11-29-2020, 06:41 AM   #5
fiajm
LQ Newbie
 
Registered: Nov 2020
Distribution: Debian
Posts: 4

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by hazel View Post
You will need to make some adjustments to your host system. Debian by default uses dash as its system shell and mawk as its awk. LFS requires bash and gawk. Did you fix that?

The general rules for host software versions are:

1) Never use an earlier version than the minimum given in the Book.
2) For gcc and binutils, don't use a later version either. They are untested.
dash) checked
awk) checked
1) checked
2) checked

TIA

Last edited by fiajm; 11-29-2020 at 07:15 AM.
 
Old 11-29-2020, 09:02 AM   #6
hendrickxm
Member
 
Registered: Feb 2014
Posts: 344

Rep: Reputation: Disabled
You can find the installation manual and links to all files in the official manual: https://wiki.gentoo.org/wiki/Handboo...allation/Stage
When you build in a chroot, you can't blindly follow the LFS-book. One advantage is that if you are inside the stage3 or any other chroot, you cannot screw up your host installation.
 
  


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
[SOLVED] lfs version 10 - gcc compile pass 1 - error 77 & error 2 dns2887 Linux From Scratch 6 11-14-2020 11:02 PM
[SOLVED] LFS: Error during GCC-4.7.1-Pass 1 (LFS 7.2, Section 5.5) erkant Linux From Scratch 7 11-28-2012 06:03 AM
malloc(): memory corruption: in first stage compile of gcc for lfs 6.3 Skazi Linux From Scratch 1 11-03-2007 12:36 AM
SUSE v10.0 ?= OpenSUSE v10.0 swiadek SUSE / openSUSE 11 02-09-2006 05:32 AM
Gentoo: Stage 1, Stage 2, or Stage 3 skorpi0wn Linux - Distributions 3 03-01-2005 07:47 PM

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

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