Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 44047 - Emerge dnd-1.1 fails in Function src_compile, Line 24 with Exitcode 2
Summary: Emerge dnd-1.1 fails in Function src_compile, Line 24 with Exitcode 2
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Desktop Misc. Team
URL: http://forums.gentoo.org/viewtopic.ph...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-03-08 09:51 UTC by A J
Modified: 2004-07-03 06:58 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
patch which fixes this bug (Makefile-fix.patch,908 bytes, patch)
2004-06-16 11:56 UTC, Mirian Crzig Lennox
Details | Diff
ebuild which applies the Makefile patch. (dnd-1.1-r1.ebuild,735 bytes, text/plain)
2004-06-16 11:59 UTC, Mirian Crzig Lennox
Details

Note You need to log in before you can comment on or make changes to this bug.
Description A J 2004-03-08 09:51:59 UTC
When I try to emerge dnd-1.1, the emerge fails in Function src_compile, Line 24 with Exitcode 2

Reproducible: Always
Steps to Reproduce:
1. emerge dnd
2. wait for emerge to stop
3.

Actual Results:  
>>> emerge (1 of 1) x11-libs/dnd-1.1 to /
>>> md5 src_uri ;-) dnd.1.1.tgz
>>> Unpacking source...
>>> Unpacking dnd.1.1.tgz to /var/tmp/portage/dnd-1.1/work
RUNNING FROM extra_functions.sh
 * Applying dnd-1.1-gentoo.diff...                                        [ ok ]
>>> Source unpacked.
creating cache ./config.cache
checking for gcc... gcc
checking whether the C compiler (gcc -march=pentium4 -O2 -pipe ) works... yes
checking whether the C compiler (gcc -march=pentium4 -O2 -pipe ) is a
cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for c++... g++
checking whether the C++ compiler (g++ -march=pentium4 -O2 -pipe ) works... yes
checking whether the C++ compiler (g++ -march=pentium4 -O2 -pipe ) is a
cross-compiler... no
checking whether we are using GNU C++... yes
checking whether g++ accepts -g... yes
checking for ranlib... ranlib
checking how to run the C preprocessor... gcc -E
checking for X... libraries /usr/X11R6/lib, headers /usr/X11R6/include
checking for dnet_ntoa in -ldnet... no
checking for dnet_ntoa in -ldnet_stub... no
checking for gethostbyname... yes
checking for connect... yes
checking for remove... yes
checking for shmat... yes
checking for IceConnectionNumber in -lICE... yes
checking whether gcc needs -traditional... no
updating cache ./config.cache
creating ./config.status
creating Makefile
rm -f DragAndDrop.o
gcc  -I. -march=pentium4 -O2 -pipe  -I/usr/X11R6/include -c DragAndDrop.c
rm -f DragAndDrop.o DragAndDrop.cxx
ln -s DragAndDrop.c DragAndDrop.cxx
g++  -I. -march=pentium4 -O2 -pipe  -I/usr/X11R6/include -c DragAndDrop.cxx
DragAndDrop.c:397:8: warning: extra tokens at end of #endif directive
DragAndDrop.cxx:397:8: warning: extra tokens at end of #endif directive
rm -f libDnd.a
ar cru libDnd.a DragAndDrop.o
ranlib libDnd.a
rm -f dndtest
gcc  -I. -march=pentium4 -O2 -pipe  -I/usr/X11R6/include -c dndtest.c
rm -f libDnd++.a
ar cru libDnd++.a DragAndDrop.o
ranlib libDnd++.a
gcc  -o dndtest dndtest.o -L. -lDnd -L/usr/X11R6/lib  -lSM -lICE -lXmu -lXaw
-lXt -lX11
./libDnd.a: could not read symbols: Archive has no index; run ranlib to add one
collect2: ld returned 1 exit status
make: *** [dndtest] Error 1

!!! ERROR: x11-libs/dnd-1.1 failed.
!!! Function src_compile, Line 24, Exitcode 2
!!! (no error message)

Expected Results:  
emerge should have completed

Portage 2.0.50-r1 (default-x86-1.4, gcc-3.3.2, glibc-2.3.2-r9, 2.6.3-gentoo-r1)
=================================================================
System uname: 2.6.3-gentoo-r1 i686 Mobile Intel(R) Pentium(R) 4 - M CPU 1.80GHz
Gentoo Base System version 1.4.3.13
Autoconf: sys-devel/autoconf-2.58-r1
Automake: sys-devel/automake-1.7.7
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-march=pentium4 -O2 -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /opt/tomcat/conf /usr/X11R6/lib/X11/xkb
/usr/kde/2/share/config /usr/kde/3.1/share/config /usr/kde/3.2/share/config
/usr/kde/3/share/config /usr/share/config /usr/share/texmf/dvipdfm/config/
/usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/
/usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=pentium4 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox userpriv"
GENTOO_MIRRORS="http://gentoo.chem.wisc.edu/gentoo/ http://gentoo.seren.com/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X Xaw3d aalib acpi acpi4linux alsa apache2 arts athena bindist bonobo caps
cdr chroot clamav crypt cups dga dnd doc dvd fbcon foomaticdb foreign-package
gif gimpprint gpm gtk2 gtkhtml imap imlib irmc java javascript jikes jpeg kde
ldap lesstif libwww motif mozilla mpeg msn ncurses neXt nls nogcj nptl ofx
oggvorbis opengl operanom2 pam pcmcia pdflib perl png pnp postgres ppds
propolice python qt radeon readline sasl sdl spell sse ssl svga tcltk tcpd tetex
threads tiff truetype unicode usb video_cards_radeon vim-with-x x86 xemacs
xgetdefault xml2 xmms yahoo zlib"
Comment 1 Mirian Crzig Lennox 2004-06-15 13:19:33 UTC
The problem is that you are using MAKEOPTS="-j2".  The Makefile in DNDlib cannot safely be used in parallel, because it contains two rules:
	libDnd.a: DragAndDrop.c
and
	libDnd++.a: DragAndDrop.c
which both generate a DragAndDrop.o (one by compiling with gcc and the other by compiling with g++).  If two parallel makes are running each building one of these targets, one of them is bound to stomp on the .o file of the other, and so the dndtest program fails.

A simple workaround is to build this with MAKEOPTS="-j1", but the real solution is to rewrite this Makefile to so that one of the the above targets builds its .o file with a different name, to avoid the race condition altogether.
Comment 2 Mirian Crzig Lennox 2004-06-16 11:56:41 UTC
Created attachment 33391 [details, diff]
patch which fixes this bug

This patch fixes this bug by compiling the C and C++ version of DragAndDrop to
different names, preventing stompage by parallel makes.  The C object file is
now DragAndDropC.o and the C++ object file is now DragAndDropCpp.o.
Comment 3 Mirian Crzig Lennox 2004-06-16 11:59:38 UTC
Created attachment 33392 [details]
ebuild which applies the Makefile patch.

ebuild which applies my previously submitted Makefile patch.
Comment 4 Markus Nigbur (RETIRED) gentoo-dev 2004-07-03 06:58:54 UTC
nice work, fixed in cvs.