<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>160561</bug_id>
          
          <creation_ts>2007-01-06 20:00 0000</creation_ts>
          <short_desc>sys-apps/pciutils-2.2.4 fails to build with MAKEOPTS=-j4</short_desc>
          <delta_ts>2007-01-08 08:11:43 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Ebuilds</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>mark-gentoo@glines.org</reporter>
          <assigned_to>base-system@gentoo.org</assigned_to>
          <cc>lostlogic@lostlogicx.com</cc>
    
    <cc>matrixhax0r@gmail.com</cc>

      

      
          <long_desc isprivate="0">
            <who>mark-gentoo@glines.org</who>
            <bug_when>2007-01-06 20:00:24 0000</bug_when>
            <thetext>Building pciutils with the -j4 flag, there is a race condition between building the apps (lspci, setpci) and the library (libpci.a).  It tries to build the apps before the library has been completely built, resulting in a linker error.


Reproducible: Sometimes

Steps to Reproduce:
1.  stick -j4 in your MAKEOPTS
2.  emerge pciutils

Actual Results:  
&gt;&gt;&gt; Emerging (1 of 1) sys-apps/pciutils-2.2.4 to /
 * pciutils-2.2.4.tar.gz MD5 ;-) ...                                      [ ok ]
 * pciutils-2.2.4.tar.gz RMD160 ;-) ...                                   [ ok ]
 * pciutils-2.2.4.tar.gz SHA1 ;-) ...                                     [ ok ]
 * pciutils-2.2.4.tar.gz SHA256 ;-) ...                                   [ ok ]
 * pciutils-2.2.4.tar.gz size ;-) ...                                     [ ok ]
 * checking ebuild checksums ;-) ...                                      [ ok ]
 * checking auxfile checksums ;-) ...                                     [ ok ]
 * checking miscfile checksums ;-) ...                                    [ ok ]
 * checking pciutils-2.2.4.tar.gz ;-) ...                                 [ ok ]
&gt;&gt;&gt; Unpacking source...
&gt;&gt;&gt; Unpacking pciutils-2.2.4.tar.gz to /var/tmp/portage/sys-apps/pciutils-2.2.4/work
 * Applying pciutils-2.2.3-build.patch ...                                [ ok ]
 * Applying pcimodules-pciutils-2.2.4.patch ...                           [ ok ]
 * Applying pciutils-2.2.4-link.patch ...                                 [ ok ]
&gt;&gt;&gt; Source unpacked.
&gt;&gt;&gt; Compiling source in /var/tmp/portage/sys-apps/pciutils-2.2.4/work/pciutils-2.2.4 ...
cd lib &amp;&amp; ./configure &quot;/usr/share/misc&quot; &quot;2.2.4&quot; &quot;&quot; &quot;&quot; &quot;&quot;
Configuring libpci for your system... i386--linux 2.6.16-vs2.1.1-rc19-gentoo
Looking for access methods... sysfs proc i386-ports dump
Checking for zlib support... yes (auto-detected)
make -C lib all
i686-pc-linux-gnu-gcc -march=athlon-mp -O2 -pipe -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes   -c -o lspci.o lspci.c
i686-pc-linux-gnu-gcc -march=athlon-mp -O2 -pipe -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes   -c -o common.o common.c
i686-pc-linux-gnu-gcc -march=athlon-mp -O2 -pipe -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes   -c -o setpci.o setpci.c
make[1]: Entering directory `/var/tmp/portage/sys-apps/pciutils-2.2.4/work/pciutils-2.2.4/lib&apos;
i686-pc-linux-gnu-gcc -march=athlon-mp -O2 -pipe -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -fPIC   -c -o access.o access.c
i686-pc-linux-gnu-gcc -march=athlon-mp -O2 -pipe -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes   -c -o pcimodules.o pcimodules.c
M=`echo 2006-09-09 | sed &apos;s/-01-/-January-/;s/-02-/-February-/;s/-03-/-March-/;s/-04-/-April-/;s/-05-/-May-/;s/-06-/-June-/;s/-07-/-July-/;s/-08-/-August-/;s/-09-/-September-/;s/-10-/-October-/;s/-11-/-November-/;s/-12-/-December-/;s/\(.*\)-\(.*\)-\(.*\)/\3 \2 \1/&apos;` ; sed &lt;lspci.man &gt;lspci.8 &quot;s/@TODAY@/$M/;s/@VERSION@/pciutils-2.2.4/;s#@IDSDIR@#/usr/share/misc#&quot;
M=`echo 2006-09-09 | sed &apos;s/-01-/-January-/;s/-02-/-February-/;s/-03-/-March-/;s/-04-/-April-/;s/-05-/-May-/;s/-06-/-June-/;s/-07-/-July-/;s/-08-/-August-/;s/-09-/-September-/;s/-10-/-October-/;s/-11-/-November-/;s/-12-/-December-/;s/\(.*\)-\(.*\)-\(.*\)/\3 \2 \1/&apos;` ; sed &lt;setpci.man &gt;setpci.8 &quot;s/@TODAY@/$M/;s/@VERSION@/pciutils-2.2.4/;s#@IDSDIR@#/usr/share/misc#&quot;
i686-pc-linux-gnu-gcc -march=athlon-mp -O2 -pipe -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -fPIC   -c -o generic.o generic.c
sed &lt;update-pciids.sh &gt;update-pciids &quot;s@^DEST=.*@DEST=/usr/share/misc/pci.ids.gz@;s@^PCI_COMPRESSED_IDS=.*@PCI_COMPRESSED_IDS=1@&quot;
chmod +x update-pciids
i686-pc-linux-gnu-gcc -march=athlon-mp -O2 -pipe -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -fPIC   -c -o dump.o dump.c
M=`echo 2006-09-09 | sed &apos;s/-01-/-January-/;s/-02-/-February-/;s/-03-/-March-/;s/-04-/-April-/;s/-05-/-May-/;s/-06-/-June-/;s/-07-/-July-/;s/-08-/-August-/;s/-09-/-September-/;s/-10-/-October-/;s/-11-/-November-/;s/-12-/-December-/;s/\(.*\)-\(.*\)-\(.*\)/\3 \2 \1/&apos;` ; sed &lt;update-pciids.man &gt;update-pciids.8 &quot;s/@TODAY@/$M/;s/@VERSION@/pciutils-2.2.4/;s#@IDSDIR@#/usr/share/misc#&quot;
i686-pc-linux-gnu-gcc -march=athlon-mp -O2 -pipe -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -fPIC   -c -o names.o names.c
i686-pc-linux-gnu-gcc -march=athlon-mp -O2 -pipe -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -fPIC   -c -o filter.o filter.c
i686-pc-linux-gnu-gcc -march=athlon-mp -O2 -pipe -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -fPIC   -c -o sysfs.o sysfs.c
M=`echo 2006-09-09 | sed &apos;s/-01-/-January-/;s/-02-/-February-/;s/-03-/-March-/;s/-04-/-April-/;s/-05-/-May-/;s/-06-/-June-/;s/-07-/-July-/;s/-08-/-August-/;s/-09-/-September-/;s/-10-/-October-/;s/-11-/-November-/;s/-12-/-December-/;s/\(.*\)-\(.*\)-\(.*\)/\3 \2 \1/&apos;` ; sed &lt;pcimodules.man &gt;pcimodules.8 &quot;s/@TODAY@/$M/;s/@VERSION@/pciutils-2.2.4/;s#@IDSDIR@#/usr/share/misc#&quot;
i686-pc-linux-gnu-gcc -march=athlon-mp -O2 -pipe -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -fPIC   -c -o proc.o proc.c
i686-pc-linux-gnu-gcc -march=athlon-mp -O2 -pipe -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes -fPIC   -c -o i386-ports.o i386-ports.c
gzip -9 &lt;pci.ids &gt;pci.ids.gz
i686-pc-linux-gnu-gcc   lspci.o common.o  lib/libpci.a -lz -o lspci
i686-pc-linux-gnu-gcc   setpci.o common.o  lib/libpci.a -lz -o setpci
i686-pc-linux-gnu-gcc: lib/libpci.a: No such file or directory
rm -f libpci.a
i686-pc-linux-gnu-ar rcs libpci.a access.o generic.o dump.o names.o filter.o sysfs.o proc.o i386-ports.o
make: *** [setpci] Error 1
make: *** Waiting for unfinished jobs....
i686-pc-linux-gnu-ranlib libpci.a
make[1]: Leaving directory `/var/tmp/portage/sys-apps/pciutils-2.2.4/work/pciutils-2.2.4/lib&apos;

!!! ERROR: sys-apps/pciutils-2.2.4 failed.
Call stack:
  ebuild.sh, line 1593:   Called dyn_compile
  ebuild.sh, line 951:   Called src_compile
  pciutils-2.2.4.ebuild, line 28:   Called die

!!! emake failed
!!! If you need support, post the topmost build error, and the call stack if relevant.


Expected Results:  
A successful build.

I&apos;ll attach a patch to fix it.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>mark-gentoo@glines.org</who>
            <bug_when>2007-01-06 20:01:54 0000</bug_when>
            <thetext>Created an attachment (id=105695)
patch to add -j1 to the make command-line

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2007-01-07 01:40:30 0000</bug_when>
            <thetext>the answer is never to apply -j1

fixed patch in cvs</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jakub@gentoo.org</who>
            <bug_when>2007-01-08 08:11:43 0000</bug_when>
            <thetext>*** Bug 160827 has been marked as a duplicate of this bug. ***</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>105695</attachid>
            <date>2007-01-06 20:01 0000</date>
            <desc>patch to add -j1 to the make command-line</desc>
            <filename>160561.diff</filename>
            <type>text/plain</type>
            <data encoding="base64">LS0tIHBjaXV0aWxzLTIuMi40LmVidWlsZC5vcmlnCTIwMDctMDEtMDYgMTE6NTU6MDEuMDAwMDAw
MDAwIC0wODAwCisrKyBwY2l1dGlscy0yLjIuNC5lYnVpbGQJMjAwNy0wMS0wNiAxMTo1NToxMS4w
MDAwMDAwMDAgLTA4MDAKQEAgLTI1LDcgKzI1LDcgQEAKIAogc3JjX2NvbXBpbGUoKSB7CiAJdGMt
ZXhwb3J0IEFSIENDIFJBTkxJQgotCWVtYWtlIE9QVD0iJHtDRkxBR1N9IiB8fCBkaWUgImVtYWtl
IGZhaWxlZCIKKwllbWFrZSBPUFQ9IiR7Q0ZMQUdTfSIgLWoxIHx8IGRpZSAiZW1ha2UgZmFpbGVk
IgogfQogCiBzcmNfaW5zdGFsbCgpIHsK
</data>        

          </attachment>
    </bug>

</bugzilla>