On Sat, Mar 1, 2008 at 1:33 PM, Jonathan Oksman <[EMAIL PROTECTED]> wrote: > > I'm working through the current development LFS book and one section > struck me as a bit odd. In "6.9. Glibc-2.7": > > > The ldd shell script contains Bash-specific syntax. Change its default > program interpreter to /bin/bash in case > > another /bin/sh is installed as described in the Shells chapter of the > BLFS book: > > > > sed -i 's|@BASH@|/bin/bash|' elf/ldd.bash.in > > > I'm building a 'by the book' lfs system right now, and looking at my > toolchain's ldd (which did not have this substitution in chapter 5) it > appears to be using bash by default. Using dash as an example > alternative sh, this raises a few questions to my mind:
The issue is that ldd is a bash script. When you run ./configure, the BASH variable is set to /bin/sh (this is what happens when you call bash as /bin/sh). This is substituted as the interpreter for ldd. That's fine for now as /bin/sh points to bash. However, if you later change /bin/sh to be !bash, things break. Instead of substituting configure's interpretation of what the path to bash is, we just force it to be /bin/bash. That will always work as /bin/bash is certainly the bash shell. I suppose this could be a problem in Ch. 5 since glibc will encode the path to bash from the host system. But that's not a problem outside the chroot. Inside the chroot, you'll have ldd replace early in the glibc installation. This has been fixed upstream to use a better search for the bash interpreter that won't use the BASH variable, which is set by the shell. I don't recall when this went in, but the sed might not be needed anymore with glibc-2.7. -- Dan -- http://linuxfromscratch.org/mailman/listinfo/lfs-dev FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page