I've revised a local copy of the latest book to include some build adjustments. The original concept was suggested on this list a couple years ago by Ryan Oliver. I've been using it and adjusting it for the past couple of years. It's how LightCube OS was bootstrapped.
The main differences (I'll outline all of them shortly) are the pre-adjusting of gcc in pass 1 along with the use of sysroot and newlib. The advantages are that it uses upstream mechanisms for cross compiling without having to revert any features, it doesn't require an adjustment of the specs file after glibc, doesn't require manual use of -B, and more completely separates the temporary tools from the host system. Below are all the individual changes: 1. Use --with-sysroot for binutils and gcc pass 1. This is the intended upstream mechanism for the type of bootstrapping we are doing. 2. Use --with-newlib and --without-headers in gcc pass 1. These switches are explained in the revisions, but essentially they're there to make the first pass usable as intended. 3. Add --with-local-prefix=/tools to the first pass of gcc as well as the second. This overrides the default location of /usr/local. 4. Pre-adjust pass 1 of gcc to point at headers and libs in /tools. This way the compiler is always configured to look in /tools and nowhere else. 5. Since we don't support multilib, remove all toolchain uses of lib64. No need for those symlinks any more. Everything goes to lib. 6. Remove the first toolchain adjustment section since it is no longer required. 7. Remove use of -B in pass 2 gcc and binutils builds. 8. Disable libiberty in chapter 5 gcc. We already do this in chapter 6. Not really a big deal in chapter 5, but if it's not disabled then an adjustment to libiberty's Makefile is needed so it doesn't pick up a multilib location from the host gcc and install itself to lib64. Might as well just be consistent and disable everywhere. 9. Remove cross patch in pass 1 gcc as well as the switches to disable target libiberty and zlib. I can't see a need for it, at least not with this current build method. However, I will need help confirming in a few various environments. 10. Remove the startfiles_fix patch in gcc pass 2. This was there as a workaround to get the start files prefix to work as it had previously, but the revised method does not require it as it is using the upstream mechanism intended. (If necessary I can dig up old links in both in our lists and in GCC's bug tracker.)\ 11. Extended sanity tests in the first two sections. Please review and test the actual changes. I'd like to commit this to trunk, but I want to hear opinions first. The rendered book is here: http://linuxfromscratch.org/~jhuntwork/sysroot/ And a full diff of the changes is here: http://linuxfromscratch.org/~jhuntwork/sysroot.diff Thanks, JH -- http://linuxfromscratch.org/mailman/listinfo/lfs-dev FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page
