LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-07-2017, 08:14 AM   #16
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,564
Blog Entries: 19

Rep: Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446

No, you have to start again from the beginning, from Chapter 5. Make a completely new toolkit using the correct shell.
 
Old 04-07-2017, 12:47 PM   #17
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,564
Blog Entries: 19

Rep: Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446
I've noticed something else which might be relevant to your problem. Both binutils and gcc are to be built "--with-system-zlib". This means that the package's internal zlib doesn't get built. Apparently libisl is needed for building it as well as for building graphite. Please check that you included this essential parameter in your gcc build, and that zlib has actually been built and installed.

Last edited by hazel; 04-07-2017 at 12:58 PM.
 
1 members found this post helpful.
Old 04-09-2017, 04:28 AM   #18
bahjat93
LQ Newbie
 
Registered: Apr 2017
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by hazel View Post
I've noticed something else which might be relevant to your problem. Both binutils and gcc are to be built "--with-system-zlib". This means that the package's internal zlib doesn't get built. Apparently libisl is needed for building it as well as for building graphite. Please check that you included this essential parameter in your gcc build, and that zlib has actually been built and installed.

I downloaded the zlib package and successfully installed it. I also added the argument "--with-system-zlib" into my command binutilis and gcc but got the same error.
When i feed my system the following commands
Code:
for file in gcc-6.3.0/config/{linux,i386/linux{,64}}.h
do
cp -uv $file{,.orig}
sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' \
-e 's@/usr@/tools@g' $file.orig > $file
echo '
#undef STANDARD_STARTFILE_PREFIX_1
#undef STANDARD_STARTFILE_PREFIX_2
#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"
#define STANDARD_STARTFILE_PREFIX_2 ""' >> $file
touch $file.orig
done
I get the following output

Code:
cp: cannot stat 'gcc-6.3.0/config/i386/linux.h': No such file or directory
-bash: gcc-6.3.0/config/i386/linux.h: No such file or directory
-bash: gcc-6.3.0/config/i386/linux.h: No such file or directory
touch: cannot touch 'gcc-6.3.0/config/i386/linux.h.orig': No such file or directory
cp: cannot stat 'gcc-6.3.0/config/i386/linux64.h': No such file or directory
-bash: gcc-6.3.0/config/i386/linux64.h: No such file or directory
-bash: gcc-6.3.0/config/i386/linux64.h: No such file or directory
touch: cannot touch 'gcc-6.3.0/config/i386/linux64.h.orig': No such file or directory
i checked in my config folder and i don't have an i386 folder, any ideas on how i can resolve this? I thought when i extracted my gcc.tar folder all the necessary libraries would be created for me.
Also i'm running an x86_64 machine. From research on the Internet it looks like the i386 is for 32bit machines, i could be wrong.
 
Old 04-09-2017, 05:39 AM   #19
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #18.
Quote:
I downloaded the zlib package and successfully installed it.
? Why ? The Ubuntu system zlib is completed with : sudo apt install zlib1g-dev
 
Old 04-09-2017, 05:48 AM   #20
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,564
Blog Entries: 19

Rep: Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446
Quote:
Originally Posted by knudfl View Post
Re #18.

? Why ? The Ubuntu system zlib is completed with : sudo apt install zlib1g-dev
Some misunderstanding here! We are talking about building Linux From Scratch. Ubuntu is merely the build host and, by this stage of the proceedings, should be providing only the kernel and dynamic directories. All the userland software is on the new partition, either in the /tools tree or in the standard locations. And the build should not be asking for headers for this library.
 
Old 04-09-2017, 05:59 AM   #21
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,564
Blog Entries: 19

Rep: Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446Reputation: 4446
Quote:
Originally Posted by bahjat93 View Post
I downloaded the zlib package and successfully installed it.
When? It needs to be installed in the correct sequence, i.e. before binutils.
Quote:
I also added the argument "--with-system-zlib" into my command binutilis and gcc but got the same error.
When i feed my system the following commands
Code:
for file in gcc-6.3.0/config/{linux,i386/linux{,64}}.h
do
cp -uv $file{,.orig}
sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' \
-e 's@/usr@/tools@g' $file.orig > $file
echo '
#undef STANDARD_STARTFILE_PREFIX_1
#undef STANDARD_STARTFILE_PREFIX_2
#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"
#define STANDARD_STARTFILE_PREFIX_2 ""' >> $file
touch $file.orig
done
I get the following output

Code:
cp: cannot stat 'gcc-6.3.0/config/i386/linux.h': No such file or directory
-bash: gcc-6.3.0/config/i386/linux.h: No such file or directory
-bash: gcc-6.3.0/config/i386/linux.h: No such file or directory
touch: cannot touch 'gcc-6.3.0/config/i386/linux.h.orig': No such file or directory
cp: cannot stat 'gcc-6.3.0/config/i386/linux64.h': No such file or directory
-bash: gcc-6.3.0/config/i386/linux64.h: No such file or directory
-bash: gcc-6.3.0/config/i386/linux64.h: No such file or directory
touch: cannot touch 'gcc-6.3.0/config/i386/linux64.h.orig': No such file or directory
That's a chapter 5 sequence. I thought we were on chapter 6 now.
Quote:
i checked in my config folder and i don't have an i386 folder, any ideas on how i can resolve this? I thought when i extracted my gcc.tar folder all the necessary libraries would be created for me.
Also i'm running an x86_64 machine. From research on the Internet it looks like the i386 is for 32bit machines, i could be wrong.
Well, this is a mix-up. You really do need to scrub everything and start again. One of the most basic requirements for building LFS is to know what your system architecture is.

The fact that your computer is 64-bit is not conclusive; what matters is the architecture of your host system. A 32-bit computer only runs 32-bit code (and yes, i386 (or i686) is the symbol for that). A 64-bit computer can run both 32-bit and 64-bit systems. Almost certainly your Ubuntu is 64-bit because most people run that now. LFS must follow the architecture of your host.

The command uname -r run in Ubuntu will tell you what architecture you have.

Scrub all the $LFS directories except /sources and start again at chapter 5. Put it down to experience!
 
  


Reply

Tags
lfs



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
unrecognized command line option ‘-r8’ sryzdn Linux - Newbie 7 05-28-2013 11:23 AM
cc: error: unrecognized command line option ‘-m-L../lib’ shumbamajachani Linux - Software 6 02-09-2013 12:05 PM
use gcc command to compile a *.c file error:unrecognized option '--eh-frame-hdr' just2012 Linux - Software 2 06-30-2011 10:19 AM
cc1: error: unrecognized command line option "-mapcs-32" vengat Linux - Hardware 0 04-29-2008 02:18 AM
gcc-giving error as as: unrecognized option `-Qy' nidhimittal Linux - Newbie 4 03-27-2008 05:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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