DejaGNU testsuite does not build in toolchain

Dan Nicholson dbn.lists at
Wed Jan 17 19:31:58 PST 2007

On 1/17/07, Bernd Pol <bernd.pol at> wrote:
> Dan Nicholson schrieb am 17.01.2007 23:47:
> > On 1/17/07, Bernd Pol <bernd.pol at> wrote:
> >> Hi all,
> >>
> >> while building the tool chain according to SVN-20070109, ch. 5.10,
> >> DejaGNU refused to build its test suite (make check):
> >>
> >> ------------------------------------
> >> make[4]: Entering directory `/mnt/lfs/sources/dejagnu-1.4.4/testsuite/libdejagnu'
> >> if g++ -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"dejagnu\" -DVERSION=\"1.4.4\"  -I. -I.    -I../.. -g -g -O2 -MT unit.o -MD -MP -MF ".deps/unit.Tpo" \
> >>   -c -o unit.o `test -f '' || echo './'`; \
> >> then mv -f ".deps/unit.Tpo" ".deps/unit.Po"; \
> >> else rm -f ".deps/unit.Tpo"; exit 1; \
> >> fi
> >> g++ -I../.. -g -g -O2   -o unit  unit.o
> >> /lib/ undefined reference to `_dl_out_of_memory at GLIBC_PRIVATE'
> >> collect2: ld returned 1 exit status
> >> make[4]: *** [unit] Error 1
> >> make[4]: Leaving directory `/mnt/lfs/sources/dejagnu-1.4.4/testsuite/libdejagnu'
> >> ------------------------------------
> >
> > $ /tools/bin/ld --verbose | grep SEARCH_DIR
> >
> > I get
> >
> > SEARCH_DIR("/tools/i686-pc-linux-gnu/lib"); SEARCH_DIR("/tools/lib");
> I get exactly the same reading. There is something weird going on.
> I tried rebuilding the toolchain again from scratch, just in case.
> No change.

Wait, now I think I know. See how above it's calling g++? In
gcc-pass1, we only install the C compiler, not the C++ compiler. So,
it's actually using your host's C++ compiler, g++. I'm not sure which
collect2 it's calling (probably your host's, and in turn it's ld), but
it's trying to link to your host's C libraries and this doesn't work
for you. Just to see what's happening, do this

$ g++ -Wl,--verbose 2>&1 | grep SEARCH_DIR

You'll probably see paths outside of /tools.

> Possibly this affects DejaGNU testsuite only? Tomorrow I'll check what
> happens in pass 2 gcc building.

After gcc-pass2 you'll have a /tools/bin/g++, so everything should be
fine. You can definitely skip the dejagnu testsuite. Most people never
run it. In fact, we should probably remove that from the book since it
depends on the host's toolchain, and we don't want that.

I think this has only ever really worked before because most of the
people driving the development are building the book with host
toolchains nearly identical with what's in the book.

What kind of host are you using (distro)?


More information about the lfs-dev mailing list