On 19/12/2015 03:29, Ken Moffat wrote: > [...] > Ran my normal build up to gcc pass 2, then tried manually building > tcl without the correct environment. > > I've now got a script, tools-check.sh: > > - - - > #!/bin/sh > > # first check that /bin/sh is not dash > /bin/sh --version >/dev/null > if [ $? -ne 0 ]; then > echo "ERROR: read the Host System Requirements for /bin/sh" > exit 1 > fi > > # check the programs, except any -lfs- progs from pass 1 > PROGS=$(ls /tools/bin/* | sed -e 's/.*-lfs-.*//' -e '/^$/d' ) > TOOLS_HOSTPROGS=n > > for P in $PROGS ; do > ldd $P | grep -q ' /lib' && echo "$P is linked to /lib" && > TOOLS_HOSTPROGS=y > ldd $P | grep -q ' /usr/lib' && echo "$P is linked to /usr/lib" && > TOOLS_HOSTPROGS=y > done > > TOOLS_HOSTLIBS=0 > # ldd warns about lack of execute perm > for L in /tools/lib/lib*.so ; do > ldd $L 2>/dev/null | grep -q ' /lib' && > echo "$L is linked to /lib" && TOOLS_HOSTLIBS=y > ldd $L 2>/dev/null | grep -q ' /usr/lib' && > echo "$L is linked to /usr/lib" && TOOLS_HOSTLIBS=y > done > > if [ $TOOLS_HOSTPROGS = "y" ] || [ $TOOLS_HOSTLIBS = "y" ]; then > echo 'ERROR' > exit 1 > fi > - - - > > The observant will notice that I remembered that sometimes people > have linked things to /usr (e.g. incorrect builds of grep). For > programs, this seems to be doing the right thing [ NOT tested with > anything linked to /usr at this point ], i.e. it tells me > /tools/bin/tclsh is linked to /lib > /tools/bin/tclsh8.6 is linked to /lib > > But for the libraries, I just got pain. As well as the tcl libs > linked to /lib, I discovered that *many* libraries from glibc, and > also libstdc++, are linked to /lib, and a couple are also linked to > /usr (libgcc_s : we handle that one when we enter chroot. >
That's amazing: running your script after stopping a build at gcc-pass2 (I have not tried to build a bogus package), I get no output. Of course, PATH has to be set to /tools/bin:$PATH, otherwise, it is host's ldd which is run, and everything is found in /lib. But I guess you did set your PATH, otherwise, you would have gotten output for programs as well. Pierre -- http://lists.linuxfromscratch.org/listinfo/lfs-dev FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page
