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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
12-23-2012, 08:30 PM
|
#1
|
|
LQ Newbie
Registered: Dec 2012
Posts: 7
Rep: 
|
LFS 7.2 GCC First pass: undefined reference to `GNU_USER_TARGET_OS_CPP_BUILTINS'
Hi guys.
When compiling my GCC in first pass follwing the LFS book, I got this error information:
Quote:
c-family/c-cppbuiltin.o: In function `c_cpp_builtins':
/home/sumz/Downloads/sources/gcc-build/gcc/../../gcc-4.7.1/gcc/c-family/c-cppbuiltin.c:918: undefined reference to `GNU_USER_TARGET_OS_CPP_BUILTINS'
collect2: ld returned 1 exit status
make[2]: *** [cc1] Error 1
make[2]: Leaving directory `/home/sumz/Downloads/sources/gcc-build/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/home/sumz/Downloads/sources/gcc-build'
make: *** [all] Error 2
|
Here is my version-check:
Quote:
bash, version 4.2.10(1)-release
/bin/sh -> /bin/bash
Binutils: (GNU Binutils for Ubuntu) 2.21.53.20110810
bison (GNU Bison) 2.4.1
/usr/bin/yacc -> /usr/bin/bison.yacc
bzip2, Version 1.0.5, 10-Dec-2007.
Coreutils: 8.5
diff (GNU diffutils) 3.0
find (GNU findutils) 4.4.2
GNU Awk 3.1.8
/usr/bin/awk -> /usr/bin/gawk
gcc (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1
(Ubuntu EGLIBC 2.13-20ubuntu5) 2.13
grep (GNU grep) 2.9
gzip 1.3.12
Linux version 3.0.0-12-generic (buildd@vernadsky) (gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3) ) #20-Ubuntu SMP Fri Oct 7 14:50:42 UTC 2011
m4 (GNU M4) 1.4.16
GNU Make 3.81
patch 2.6.1
Perl version='5.12.4';
GNU sed version 4.2.1
tar (GNU tar) 1.25
Texinfo: makeinfo (GNU texinfo) 4.13
xz (XZ Utils) 5.0.0
gcc compilation OK
|
Anyone has idea how to solve this problem?
Thanks.
SuMZ
|
|
|
|
12-24-2012, 02:35 AM
|
#2
|
|
LQ Veteran
Registered: Sep 2003
Location: the Netherlands
Distribution: lfs, debian, rhel
Posts: 8,703
|
Although your version-check output looks OK, I do see something that doesn't look right:
Quote:
c-family/c-cppbuiltin.o: In function `c_cpp_builtins':
/home/sumz/Downloads/sources/gcc-build/gcc/../../gcc-4.7.1/gcc/c-family/c-cppbuiltin.c:918: undefined reference to `GNU_USER_TARGET_OS_CPP_BUILTINS'
collect2: ld returned 1 exit status
make[2]: *** [cc1] Error 1
make[2]: Leaving directory `/home/sumz/Downloads/sources/gcc-build/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/home/sumz/Downloads/sources/gcc-build'
make: *** [all] Error 2
|
Why are you building in /home/sumz/Downloads and not /mnt/lfs? It also looks liike you are doing this as user sumz and not as user lfs.
You might want to re-read 1.1. How to Build an LFS System and 2. Preparing a New Partition
Last edited by druuna; 12-24-2012 at 02:38 AM.
|
|
|
|
12-30-2012, 01:20 AM
|
#3
|
|
LQ Newbie
Registered: Dec 2012
Posts: 1
Rep: 
|
I had this problem too. And I found that it was because of gcc/config/linux.h and gcc/config/i386/linux.h and linux64.h didn't work exactly.
The LFS book says "
for file in \
$(find gcc/config -name linux64.h -o -name linux.h -o -name sysv4.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
" so hard to follow.
In my opinion,I do it step by step ,
just
sed -e 's@/lib\(64\)\?\(32\)\?/ld@/tools&@g' -e 's@/usr@/tools@g' those .h and copy display to those .h
then use kwrite to add
#undef STANDARD_STARTFILE_PREFIX_1
#undef STANDARD_STARTFILE_PREFIX_2
#define STANDARD_STARTFILE_PREFIX_1 "/tools/lib/"
#define STANDARD_STARTFILE_PREFIX_2 ""' >> $file
at the end of those .h ,then it worked.
I hope those above could help you.
|
|
|
|
12-30-2012, 07:33 AM
|
#4
|
|
Member
Registered: May 2007
Posts: 288
Rep:
|
Quote:
|
Originally Posted by neariot
I had this problem too. And I found that it was because of gcc/config/linux.h and gcc/config/i386/linux.h and linux64.h didn't work exactly.
|
But it worked okay for me though.
Quote:
|
Originally Posted by neariot
In my opinion,I do it step by step...
|
Well, that's one of the great things about LFS... everybody can do whatever they want. But I recommend future readers just follow the book. The 7.2 book can be considered mature at this point. Many people have built it. The errata do not mention anything about section 5.5.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 06:43 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|