on a recent emerge -u world: [stuff cut, config etc.] Making all in src make[2]: Entering directory `/var/tmp/portage/diffutils-2.8.4/work/diffutils-2.8.4/src' (echo '#define DEFAULT_DIFF_PROGRAM "/usr/bin/'`echo diff|sed 's,x,x,'`'"' && \ echo '#define LOCALEDIR "/usr/share/locale"') >paths.h [stuff cut, gcc compiles files ok, then] source='ifdef.c' object='ifdef.o' libtool=no \ depfile='.deps/ifdef.Po' tmpdepfile='.deps/ifdef.TPo' \ depmode=gcc3 /bin/sh ../config/depcomp \ gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../lib -I../lib -march=pentium4 -mmmx -msse2 -mfpmath=sse -O3 -pipe -c `test -f 'ifdef.c' || echo './'`ifdef.c diff.c: In function `main': diff.c:270: `LOCALEDIR' undeclared (first use in this function) diff.c:270: (Each undeclared identifier is reported only once diff.c:270: for each function it appears in.)
Change CFLAGS to something more sensible (like -march=pentium3 -O2 -pipe) and please try again. -march=pentium4, -msse2 among things is known to break gcc-3.2.
This has nothing to do with compiler cpu optimizations since it breaks in the parser. After a bit of investigation work I've found the problem, src/Makefile.in does: paths.h: (echo '#define DEFAULT_DIFF_PROGRAM "$(bindir)/'`echo diff|sed '$(transform)'`'"' && \ echo '#define LOCALEDIR "$(localedir)"') >$@ When make -j is used this gets run in a subshell and theres a race condition between paths.h being created and used. The solution is to add to the unpack() in the ebuild file: cd src cp Makefile.in Makefile.in.orig sed -e 's:(echo:{ echo:g' Makefile.in.orig | sed -e "s:'):'; }:g" >Makefile.in This should be reported as a bug in diffutils upstream as well.
Yeah, well, it is usually a good place to start :P Anyhow, this means that changing 'emake' to 'make' fixes this problem for you ?
BTW: what is your MAKEOPTS set to? I also have a pentium4, and do not experience this problem ....
Yup, just doing 'make' works, though its not an ideal solution. My MAKEOPTS is set to "-j6". I've just sent a bug report to gnu utils bug
Ok. We can do this two ways. -j2 seems to work, so either make it -j2 for now, or else use 'make' for the moment. CHeck if -j2 works for you, then we can use that as default for the time being.
Ok, latest version or -r1 do fix this, but I see the GNU guys did see the fix. Damn me, but I added my one liner above it, but did not see the problem. --- Never mind all that debugging. Make is behaving perfectly. It's a bug in Makefile.am. plain text document attachment (diff.out), "Makefile.am diff" --- Makefile.am-dist 2002-10-14 11:29:10.000000000 -0400 +++ Makefile.am 2002-10-14 11:29:25.000000000 -0400 @@ -37,7 +37,7 @@ MOSTLYCLEANFILES = paths.h -cmp.$(OBJEXT) diff3.$(OBJECT) diff.$(OBJECT) sdiff.$(OBJECT): paths.h +cmp.$(OBJEXT) diff3.$(OBJEXT) diff.$(OBJEXT) sdiff.$(OBJEXT): paths.h paths.h: (echo '#define DEFAULT_DIFF_PROGRAM "$(bindir)/'`echo diff|sed '$(transform)'`'"' && \ echo '#define LOCALEDIR "$(localedir)"') >$@ -- ------------------------------------------------------------------------------- Paul D. Smith <psmith@gnu.org> Find some GNU make tips at: http://www.gnu.org http://make.paulandlesley.org "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
doh, we all missed it... does this mean we can close the bug now?
Nope .. my patch works, but is not the corret one .. I still need to update it.