4

I followed LFS doc.

I'm not quite understand why it needs 2 pass of compilation.

My guess:

We need target system's glibc, if we compile by host's gcc, it will not be able to separate with host anymore. So we need to build new system's binutils and gcc first to build target system's glibc let glibc connect with target's binutils and gcc. But first pass of binutils and gcc is using host's glibc, so we need second pass of compilation of target's binutils and gcc.

Are those right?

Is anything I'm missing or misunderstanding?

Thank you~

5

Correct. As the Dragon Book explains, you must first build a host binary that builds for the target, and then you use that to build a target binary that builds for the target.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.