Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 170108 - games-emulation/zsnes-1.51 fails compiling
Summary: games-emulation/zsnes-1.51 fails compiling
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Games (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Timothy Redaelli (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-09 13:49 UTC by Matteo Sasso
Modified: 2009-02-02 16:42 UTC (History)
3 users (show)

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


Attachments
emerge --info (emerge-info,7.28 KB, text/plain)
2007-03-09 13:50 UTC, Matteo Sasso
Details
build log (zsnes-emerge.log,8.48 KB, text/plain)
2007-03-09 22:27 UTC, Matteo Sasso
Details
makefile.dep (makefile.dep,7.40 KB, text/plain)
2007-03-09 22:27 UTC, Matteo Sasso
Details
Proposed patch (depbuild.patch,531 bytes, patch)
2008-10-08 20:05 UTC, Matteo Sasso
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Matteo Sasso 2007-03-09 13:49:28 UTC
When updating to zsnes-1.51 I get the following error:

makefile.dep:124: *** multiple target patterns.  Stop.

The text from makefile.dep looks garbled:
video/procvidc.o: video/procvidc.c ./gblhdr.h ./config.h \
   zpath.h zip/zunzip.h jma/zsnesjma.h zmovie.h video/ntsc.h \
   video/snes_ntsc/snes_ntsc.h video/snes_ntsc/snes_ntsc_convideo/sw_draw.o: video/sw_draw.asm macros.mac

This is the command line used to generate makefile.dep:
tools/depbuild i686-pc-linux-gnu-gcc " -march=athlon-xp -pipe -O2 -I. -D__UNIXSDL__  -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT  -D__OPENGL__ -march=athlon-xp -O3 -fomit-frame-pointer -fprefetch-loop-arrays -fforce-addr  -D__RELEASE__" nasm " -w-orphan-labels -D__UNIXSDL__ -f elf -DELF -D__OPENGL__ -O99999999 -D__RELEASE__" cfg.o endmem.o init.o initc.o input.o md.o patch.o ui.o vcache.o version.o zloader.o zmovie.o zpath.o zstate.o ztime.o ztimec.o chips/c4emu.o chips/c4proc.o chips/dsp1emu.o chips/dsp1proc.o chips/dsp2proc.o chips/dsp3emu.o chips/dsp3proc.o chips/dsp4emu.o chips/dsp4proc.o chips/fxemu2.o chips/fxemu2b.o chips/fxemu2c.o chips/fxtable.o chips/obc1emu.o chips/obc1proc.o chips/sa1proc.o chips/sa1regs.o chips/sdd1emu.o chips/seta10.o chips/sfxproc.o chips/st10proc.o chips/7110proc.o chips/seta11.o chips/st11proc.o cpu/dma.o cpu/dsp.o cpu/dspproc.o cpu/execute.o cpu/executec.o cpu/irq.o cpu/memory.o cpu/memtable.o cpu/spc700.o cpu/stable.o cpu/table.o cpu/tablec.o debugasm.o debugger.o gui/gui.o gui/guifuncs.o gui/menu.o effects/burn.o effects/smoke.o effects/water.o jma/7zlzma.o jma/crc32.o jma/iiostrm.o    jma/inbyte.o jma/jma.o jma/lzma.o       jma/lzmadec.o jma/winout.o jma/zsnesjma.o mmlib/mm.o mmlib/linux.o  video/makev16b.o video/makev16t.o video/makevid.o video/mode716.o video/mode716b.o video/mode716d.o video/mode716e.o video/mode716t.o video/mode7.o video/mode7ext.o video/mv16tms.o video/m716text.o video/newg162.o video/newgfx.o video/newgfx16.o video/newgfx2.o video/procvid.o video/procvidc.o video/sw_draw.o video/2xsaiw.o video/hq2x16.o video/hq2x32.o video/hq3x16.o video/hq3x32.o video/hq4x16.o video/hq4x32.o video/ntsc.o video/copyvwin.o linux/audio.o linux/battery.o linux/sdlintrf.o linux/sdllink.o linux/gl_draw.o linux/sw_draw.o linux/safelib.o zip/unzip.o zip/zpng.o > makefile.dep
Comment 1 Matteo Sasso 2007-03-09 13:50:24 UTC
Created attachment 112703 [details]
emerge --info
Comment 2 Mr. Bones. (RETIRED) gentoo-dev 2007-03-09 20:36:13 UTC
works for me with all stable packages.  You probably have some ~x86 packages installed.
Comment 3 Matteo Sasso 2007-03-09 21:44:04 UTC
That's correct mr. bones, but they are too many to try and remove them one by one. 

On the other hand, I found out that the package compiles fine with just ./configure; make. Applying the libpng patch has no effect.

My ebuild-fu is non-existent, so can anyone take a guess on what's going on, and maybe suggest something for me to try in order to reproduce the bug without using the ebuild?

I'll go on testing.
Comment 4 Mr. Bones. (RETIRED) gentoo-dev 2007-03-09 21:51:06 UTC
Run the configure script like the ebuild does and see if that works.
Comment 5 Matteo Sasso 2007-03-09 22:07:32 UTC
Yes, it compiles.

I commented out most of src_unpack(), but the ebuild still doesn't work, so I believe that the problem may lie somewhere in econf. (Which does NOT mean that econf is necessarily at fault, of course)
Comment 6 Mr. Bones. (RETIRED) gentoo-dev 2007-03-09 22:14:31 UTC
attach the full output of the attempted merge please:

emerge -v zsnes &> /tmp/output

attach /tmp/output as text/plain.
Comment 7 Matteo Sasso 2007-03-09 22:26:02 UTC
Very odd! The error message seems to have changed in the meantime. I didn't notice when it happened.

Anyway the error is still caused by a malformed makefile.dep, so it's not a big problem.

I'm still attaching the build log and makefile.dep.
Comment 8 Matteo Sasso 2007-03-09 22:27:02 UTC
Created attachment 112748 [details]
build log
Comment 9 Matteo Sasso 2007-03-09 22:27:35 UTC
Created attachment 112750 [details]
makefile.dep
Comment 10 moesasji 2007-03-10 16:33:18 UTC
Apparantly the package compiles if you run .configure && make but not if you run the ebuild itself. I think that the difference is that the ebuild uses your CFLAGS, CXXFLAGS and LDFLAGS as specified in your make.conf. Note that especially the LDFLAGS contains a lot of unsupported settings. 

LDFLAGS="-Wl,-O,1,--enable-new-dtags,--sort-common,-z,combreloc,--as-needed"

My suggestion would be to check if this problem also exists if you use sane settings for all those flags. So try:

LDFLAGS="" emerge -av zsnes

and see if the problem still persists (if yes: same check for CXXFLAGS)


 
Comment 11 Matteo Sasso 2007-03-10 18:01:32 UTC
Latest news: I tried clearing all environment variables, to no avail. I also tried to copy the "clean" Makefile and tools/depbuild executable to the ebuild working directory under /var/tmp/portage. It surprised me to learn that the change has no effect! So a malformed makefile.dep is generated through the same command line (I double-checked it, it's identical) and the same executable.

So, this seems like to be a bug in the tool, probably triggered by some oddity of the environment where the build process is run.
Comment 12 Matteo Sasso 2007-03-10 18:37:12 UTC
Things are getting weird: running the depbuild commandline WITHOUT the output redirection to makefile.dep yields different results (i.e. the output seems correct)!

Looks like chunks of text are somehow being moved around. I wonder why it's working in one setup and not in the other. Looks like an output flushing problem, but I cannot tell by what it's being caused.

Take for instance the line of dsp1proc. Without redirection I get:
chips/dsp1emu.o: chips/dsp1emu.c gblhdr.h config.h
chips/dsp1proc.o: chips/dsp1proc.asm macros.mac
chips/dsp2proc.o: chips/dsp2proc.asm macros.mac

If I redirect the output to makefile.def, or pipe to "cat", I get:
chips/dsp1emu.ochips/dsp1proc.o: chips/dsp1proc.asm macros.mac
chips/dsp2proc.o: chips/dsp2proc.asm macros.mac

Not that in this case the missing part after "chips/dsp1emu.o" (i.e. ": chips/dsp1emu.c gblhdr.h config.h") can be found much later in the output/file, on a separate line.

Any ideas?
Comment 13 Another Mortal 2007-06-14 19:15:58 UTC
Just take a quick peek at the awful mess
in tools/depbuild.cpp and you'll have a
much better idea what may be causing the
output flushing problem.
Comment 14 Matteo Sasso 2008-10-08 20:03:50 UTC
Good news! I finally found some time to work on this. I think the problem is that depbuild.cpp mixes cout's with the system() call (which also outputs to stdout) and this causes problems. I wrote a patch that fixes the problem on my system.
In the heat of finding a solution I also wrote a shell script (~40 lines) that does the same job of that 220-line C++ monster. Drop me a line if interested.
Comment 15 Matteo Sasso 2008-10-08 20:05:01 UTC
Created attachment 167662 [details, diff]
Proposed patch

Hope the format is ok.
Comment 16 Timothy Redaelli (RETIRED) gentoo-dev 2009-02-02 16:42:28 UTC
Fixed, thanks (no revbump needed)