Click to See Complete Forum and Search --> : Howto build liveCD with LFS, Make BootStrap Error (was: My next step with linux!)


LiquidAcid
05-21-2007, 03:27 AM
Well - I must say - that when it comes to asking people questions about linux the flamings can get severe - especially on irc - where flamings are usually severe anyhow.
I got flamed for asking this question just a few minutes ago, and hope to get a decent answer at some point in time.

I have Gentoo installed on my AMD64.
The partition on HDA is as follows...
/dev/hda1 = /boot - an ext2 file system
/dev/hda2 = /swap
/dev/hda3 = / - a ReiserFS file system
/dev/hda4 = /myspace - another ReiserFS file system

I choose ReiserFS because I like the name better than ext3 - not because it really makes any real difference to me at my current point on the learning curve.

I have installed Gentoo onto the hda3 with a grub loader and kernel on hda1.

It boots perfectly.

I am however trying to make an install/liveCD on /dev/hda4 known as /myspace, and this is where I am coming undone...

I have so far
1) compiled the latest vanilla-kernel V2.6.21 - I was considering patching it to 2.6.22-rc2 which is also supposed to be stable but since I didn't know how to do this correctly I left it (hint hitn: if someone could tell me how to use these patches I would appreciate it - looks to me to be a raw dump from the diff command - but that doesn't tell me how they work)
2)compiled the latest binutils V2.17.50
3)tried to compile the latest gcc with a make bootstrap command - and it failed.

The process I followed was from www.linuxfromscratch.com/org(not sure of extension)

I stuck to it pretty rigidly - but altered it somewhat to fit the configuration mentioned above.

The problem I am having with the compile is that it cannot find -lc when it gets to a point in the make, which I have ./configured with --disable-nls --enable-shared and --enable-language=c, just as specified in the lfs rule book.
They refuse to support this problem because it cuts too much into their dev time, and I can understand that they are buisy.

Anyhow - here is the output from the make command
(carefully typed - not copy pasted - becuase I can't figure out how to get it from there to here... :()

/tools/x86-64-unknown-linux-gnu/bin/ld: shipping incompatible /usr/lib/../lib/libc.so when searching for -lc
/tools/x86-64-unknown-linux-gnu/bin/ld: shipping incompatible /usr/lib/../lib/libc.a when searching for -lc
/tools/x86-64-unknown-linux-gnu/bin/ld: shipping incompatible /usr/lib/libc.so when searching for -lc
/tools/x86-64-unknown-linux-gnu/bin/ld: shipping incompatible /usr/lib/libc.a when searching for -lc
/tools/x86-64-unknown-linux-gnu/bin/ld: cannot find -lcwhich is then followed by make[x] bleh bleh Error1
make[x-1] bleh bleh Error2
and so on till the iteration is finished terminating with
make: *** [bootstrap] Error 2

Anyhow - I want to know not only why it is missing -lc, but what the jehosiphat is -lc, where it comes from and how I fix.

some things I suspect...

I am runing from Gentoo install not the live CD.
I have used the latest versions and not the old ones recomended in the lore book.

But I want to learn, and this is why I am asking - hope someone can help with this!

LA

Parcival
05-21-2007, 05:03 AM
LiquidAcid, please write better (i.e. more descriptive) thread titles in the future. It helps other users pick faster what they'd like to read, especially when they are using the search function later.

As for your problem: I have never performed the task you attempt, but I would search with Google to check what exactly ld respectively -lc is. Once you know, doublecheck if you have the necessary package installed. Compilation errors like this one usually result from a missing package. If you are unlucky, it could be that this package is missing for your AMD64 architecture.

je_fro
05-21-2007, 03:31 PM
I know you've invested a ton of time in your LFS livecd, but I've used this HOWTO:
http://forums.gentoo.org/viewtopic-t-410389-highlight-livecd.html

...to successfully build a livecd. There's a gentoo tool called catalyst that's supposed to be the "official" way but I got things going with that thread first...

je_fro
05-21-2007, 03:33 PM
You might want to find out as much as you can about catalyst2
http://forums.gentoo.org/viewtopic-t-492828-highlight-catalyst2.html
...as you can. Once you've got it set up, it's the easiest way to go.

bwkaz
05-21-2007, 07:06 PM
/tools/x86-64- That's not LFS. That's 64-bit; LFS only works for 32-bit to 32-bit builds. If you want to build a 64-bit system from a 32-bit system, then you need to read the CLFS book:

http://trac.cross-lfs.org/

And if you want to build a 64-bit system from another 64-bit system, you will have to use the CLFS method, but fake it into cross-compiling. (AFAIK this isn't very well supported either.)

(And just so you understand the error: it's complaining that either it's trying to link a 32-bit C library into a 64-bit binary, or it's trying to link a 64-bit C library into a 32-bit binary. You can't do that, and the linker prevents you from trying. -lc is the C library.)

LiquidAcid
05-22-2007, 12:55 AM
Je_fro - thanks - since I posted I have reformatted the HDD about 7 or 8 times now - I might give that a go
Bwkaz - also thank you for the explanation - I have C# exp in programming and can understand how this is problematic - I just was unfamiliar with the error syntax (Vis Studio C#/MSDN kind of make one fairly lazy in a lot of things) - Glad you could shed some light on it - I hope to decypher the crypt of these messages so I can follow what they mean in future.
Parcival - You have my apologies - I'll also give you an excuse - I am not used to posting on large scale forums - and definatly not ones that use google searches - I will do my best to keep the names acurate perhaps a better name would have been Make BootStrap Error? Will do my best on what you ask ;)