Opened 9 years ago

Closed 9 years ago

#3747 closed task (fixed)

Glibc 2.21 does not like parallel build

Reported by: chris@… Owned by: lfs-book@…
Priority: normal Milestone: 7.7
Component: Book Version: SVN
Severity: normal Keywords:
Cc:

Description

When using "make -j" to build Glibc 2.21, it will sometimes fail to build. Here's the relevant part of the compile log:

make[2]: Entering directory '/usr/src/glibc/xxxbuild/glibc-2.21/elf'
.././scripts/mkinstalldirs /usr/src/glibc/xxxbuild/glibc-build/elf
.././scripts/mkinstalldirs /usr/src/glibc/xxxbuild/glibc-build/elf
.././scripts/mkinstalldirs /usr/src/glibc/xxxbuild/glibc-build/elf
echo '#define RUNTIME_LINKER "/lib/ld-linux-x86-64.so.2"' \
        > /usr/src/glibc/xxxbuild/glibc-build/elf/runtime-linker.T
mkdir -p -- /usr/src/glibc/xxxbuild/glibc-build/elf
mkdir -p -- /usr/src/glibc/xxxbuild/glibc-build/elf
/bin/sh: /usr/src/glibc/xxxbuild/glibc-build/elf/runtime-linker.T: No such file or directory

The creation of "runtime-linker.T" can occur before the "elf" directory actually exists, causing a no such file error. Obviously the fix would be to ensure the "elf" directory is created first, but I wouldn't know exactly how to fix the Makefile to ensure that happens. Until a patch can be found for this issue, a temporary fix would be to add a note that Glibc should be built with "make -j1".

Change History (2)

comment:1 by bdubbs@…, 9 years ago

It's a race condition then. I've built it with -j10 without a problem. My log has:

make[3]: Entering directory '/mnt/lfs/sources/glibc-2.21/elf'
.././scripts/mkinstalldirs /mnt/lfs/sources/glibc-build/elf
.././scripts/mkinstalldirs /mnt/lfs/sources/glibc-build/elf
mkdir -p -- /mnt/lfs/sources/glibc-build/elf
mkdir -p -- /mnt/lfs/sources/glibc-build/elf
echo "/tools/lib "    \
| gawk -f gen-trusted-dirs.awk > /mnt/lfs/sources/glibc-build/elf/trusted-dirs.T;
echo '' > /mnt/lfs/sources/glibc-build/elf/stamp.oST
echo '#define DL_DST_LIB "lib"' >> /mnt/lfs/sources/glibc-build/elf/trusted-dirs.T
mv -f /mnt/lfs/sources/glibc-build/elf/stamp.oST /mnt/lfs/sources/glibc-build/elf/stamp.oS
echo '#define RUNTIME_LINKER "/tools/lib/ld-linux-x86-64.so.2"' \
   > /mnt/lfs/sources/glibc-build/elf/runtime-linker.T
/bin/sh ../scripts/move-if-change /mnt/lfs/sources/glibc-build/elf/trusted-dirs.T /mnt/lfs/sources/glibc-build/elf/trusted-dirs.h
/bin/sh ../scripts/move-if-change /mnt/lfs/sources/glibc-build/elf/runtime-linker.T /mnt/lfs/sources/glibc-build/elf/runtime-linker.h

What happens if instead of 'mkdir -v ../glibc-build', you change it to 'mkdir -v ../glibc-build/elf' ?

comment:2 by bdubbs@…, 9 years ago

Resolution: fixed
Status: newclosed

Added a note to glibc that -j1 may be needed during make phase.

Fixed at revision 10846.

Note: See TracTickets for help on using tickets.