Bug 31356 - sys-apps/file can die when compiling with parallel make
Bug#: 31356 Product:  Gentoo Linux Version: unspecified Platform: All
OS/Version: Linux Status: RESOLVED Severity: normal Priority: P2
Resolution: FIXED Assigned To: bug-wranglers@gentoo.org Reported By: brandy@gentoo.org
Component: Core system
URL: 
Summary: sys-apps/file can die when compiling with parallel make
Keywords:  
Status Whiteboard: 
Opened: 2003-10-17 08:08 0000
Description:   Opened: 2003-10-17 08:08 0000
If for some reason, a system is missing the /usr/lib/libmagic libraries,
then sys-apps/file cannot be installed:


/bin/sh ../libtool --mode=link gcc  -march=pentium4 -O3 -pipe -fomit-frame-pointer -funroll-loops -fprefetch-loop-arrays   -o file -lmagic file.o  -lz
gcc -march=pentium4 -O3 -pipe -fomit-frame-pointer -funroll-loops -fprefetch-loop-arrays -o file file.o  -lmagic -lz
gcc -DHAVE_CONFIG_H -I. -I. -I.. -DMAGIC=\"/usr/share/misc/file/magic\" -march=pentium4 -O3 -pipe -fomit-frame-pointer -funroll-loops -fprefetch-loop-arrays -MT apptype.lo -MD -MP -MF .deps/apptype.Tpo -c apptype.c  -fPIC -DPIC -o .libs/apptype.o
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.1/../../../../i686-pc-linux-gnu/bin/ld: cannot find -lmagic
collect2: ld returned 1 exit status
make[2]: *** [file] Error 1
make[2]: *** Waiting for unfinished jobs....
gcc -DHAVE_CONFIG_H -I. -I. -I.. -DMAGIC=\"/usr/share/misc/file/magic\" -march=pentium4 -O3 -pipe -fomit-frame-pointer -funroll-loops -fprefetch-loop-arrays -MT apptype.lo -MD -MP -MF .deps/apptype.Tpo -c apptype.c -o apptype.o >/dev/null 2>&1
make[2]: Leaving directory `/var/tmp/portage/file-4.06/work/file-4.06/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/file-4.06/work/file-4.06'
make: *** [all] Error 2

!!! ERROR: sys-apps/file-4.06 failed.
!!! Function src_compile, Line 49, Exitcode 2
!!! (no error message)


And of course the libmagic files are provided by sys-apps/file itself. :)

Fortunately, the easiest fix for this is to change the 'emake || die'
line in the ebuild to 'make || die' (or 'MAKEOPTS="-j1" emake || die')

------- Comment #1 From Martin Holzer (RETIRED) 2003-10-17 09:00:52 0000 -------
MAKEOPTS="-j7" works here

------- Comment #2 From Mr. Bones. 2003-10-17 19:31:06 0000 -------
I wasn't able to get it to fail with parallel make.  However, if someone
does end up making a change to the ebuild, please just use

emake -j1 || die "emake failed"

There's no need to use MAKEOPTS.

------- Comment #3 From Mr. Bones. 2003-10-17 20:22:40 0000 -------
Fixed in CVS.  I fixed the latest version of the ebuild, but all of them
may have this bug.  Probably best if we try to get the latest version 
marked stable as quickly as possible.