GCC Pass1 - undefined reference to `GNU_USER_TARGET_OS_CPP_BUILTINS'
Linux From ScratchThis 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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
GCC Pass1 - undefined reference to `GNU_USER_TARGET_OS_CPP_BUILTINS'
Ok, I'm officially stuck. I've tried this multiple times on multiple computers and always get to the same point and fail. It could be due to the fact that I'm booting from a 32bit arch usb stick onto a 64bit machine, but this also failed on a 32bit machine as well, so that's probably not the problem.
What's happening is that I'm getting the old "undefined reference to `GNU_USER_TARGET_OS_CPP_BUILTINS'" error.
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150
Rep:
Can't see anything wrong with the commands compared to mine but what is LFS_TGT set to? it should be this:
Code:
LFS_TGT=$(uname -m)-lfs-linux-gnu
And as Spiky said what is LFS set to?
If you still have trouble you MAY have a corrupted archive, as you are only on the start of building the tools I would suggest a fresh start re-download the archives and check the hash numbers before you start and check what you are doing carefully before going on to the next step.
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150
Rep:
You've got some minor version number differences which probably isn't the problem but some combinations of gcc/binutils just don't play nice together, this is my version check
Code:
bash, version 4.2.42(1)-release
/bin/sh -> /bin/bash
Binutils: (GNU Binutils) 2.23.1
bison (GNU Bison) 2.7
/usr/bin/yacc -> /usr/bin/yacc
bzip2, Version 1.0.6, 6-Sept-2010.
Coreutils: 8.21
diff (GNU diffutils) 3.2
find (GNU findutils) 4.4.2
GNU Awk 4.0.2
/usr/bin/awk -> /usr/bin/gawk
gcc (GCC) 4.7.2
(GNU libc) 2.17
grep (GNU grep) 2.14
gzip 1.5
Linux version 3.8.0 (root@LFSHolly) (gcc version 4.7.2 (GCC) ) #1 SMP PREEMPT Mon Mar 25 10:34:37 UTC 2013
m4 (GNU M4) 1.4.16
GNU Make 3.82
GNU patch 2.7.1
Perl version='5.16.2';
GNU sed version 4.2.1
tar (GNU tar) 1.26
Texinfo: makeinfo (GNU texinfo) 5.0
xz (XZ Utils) 5.0.4
gcc compilation OK
Try adjusting the versions of first gcc and binutils then the others otherwise I can't see anything blatantly wrong.
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150
Rep:
Well I just had a quick go at building gcc 4.8.0 and I also get build errors ( but not the same as yours ), I gather you are using the development branch of the book, is there any particular reason you are not using the stable version as this builds O.K.?
I know you are using a usb stick, Is it possible to install arch onto hard drive I know it should be able to work from usb but there seems nothing amiss with everything you are doing, it just a thought might be worth a try.
Maybe post you bashrc although I would expect it to be correct
I have another arch machine that I could try this on, but I'll need to update it, install missing apps, and do some other work to get it up to the point where I could us it. Currently, I'm also thinking that it must be something to do with the fact that I'm doing this on a stick and not the hd... but, as you said, there should be no reason that it shouldn't work from a stick. Or it could be the fact that my target is also on a stick and doing stick-to-stick causes the issue.
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150
Rep:
Quote:
Originally Posted by richard620
The 4.8 was just for my host arch machine, but I'm still trying to build gcc 4.7.2 from the stable branch - never tried the development version.
If you look here:http://www.linuxfromscratch.org/lfs/.../hostreqs.html
This may be the problem as gcc > 4.7.2 and binutils > 2.23.1 are not recommended, seems daft but your host system may be to high a spec, if possible try installing slackware and build lfs on that, ( slackware >=13.37 ) is compliant 'out of the box'
Booting from a usb stick should not be a problem when building the tool chain though you may have problems later when it comes to making the system bootable, I don't know for sure as I have never built from a stick, one little thing to watch is when you have to chroot into the lfs partition if you are running from a 64bit kernel you can chroot into 32bit/64bit environment but if you are running from a 32bit kernel you can't chroot into a 63bit environment.
This may be the problem as gcc > 4.7.2 and binutils > 2.23.1 are not recommended
The first attempt, before upgrading the stick, was gcc 4.7.1 and binutils 2.22.0 and it still had the same problem.
I might give slackware idea a try since it would take a little work to get my other arch box up anyway.
I installed slackware 14.0 (64bit) onto the hd and used the same target usb stick that I was using the last time for the lfs build. The exact same error occurred again. Except for one thing, when I tried to make gcc the first time, I got a 'error couldn't find /usr/lib64/libgmp.la' or something like that. So I tried it again and it seemed to make it past that and gave me my original error.
Distribution: Void, Linux From Scratch, Slackware64
Posts: 3,150
Rep:
Why don't you try just building the tools to a folder and not the usb stick, you may have duff stick, by the way what is the usb stick formated/mounted as? some times the mount options can do odd things.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.