From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu Subject: Re: [9fans] plan9port build failure on Linux (debian) From: "Russ Cox" Date: Mon, 3 Mar 2008 11:17:47 -0500 In-Reply-To: <20080303042017.GE14610@morris-clan.net> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Message-Id: <20080303161756.820A71E8C51@holo.morphisms.net> Topicbox-Message-UUID: 6d809762-ead3-11e9-9d60-3106f5b1d025 > I am trying to install plan9port on a Linux system (Debian), > and am getting the following error: > > 9 yacc -d -s bc bc.y > > fatal error:can't create , :1 > mk: 9 yacc -d ... : exit status=exit(1) > mk: for i in ... : exit status=exit(1) The is just because the error has happened very early and yacc hasn't opened the input file yet. If you poke around in the code you'll find that it was trying to create bc.tab.h (or should have been) but somehow this code (stem="bc", FILED = "tab.h"): sprint(buf, "%s.%s", stem, FILED); fdefine = Bopen(buf, OWRITE); if(fdefine == 0) error("can't create %s", buf); ended up with an empty string in buf instead of bc.tab.h. > So, any ideas on how to fix the build process? The problem > stems from yacc.c at line #2173 in the sprint() function. > Could I replace that with the standard library sprintf() > function as a stop-gap measure? It would be interesting to know if that makes it work, but more interesting would be why the Plan 9 sprint is broken. This is a pretty simple sprint call and should work. Can you reproduce the prolem if you just run: cd /usr/local/plan9/src/cmd 9 yacc -s bc bc.y ? I'm also interested to see the output of: nm /usr/local/plan9/bin/yacc | grep sprint @erik: > once that is fixed, it would be interesting to see if yacc > prints a usage statement instead of printing the garbage. The command line passed in the mkfile has worked in thousands of other builds. Even if stem was nil, buf should at least end up being ".tab.h" or ".tab.h" or at the very worst, if %s was broken, ".". I doubt the command line is being misparsed, but I don't have any justifiable alternate theories. Russ