This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [PATCH] Bulletproofing -fsyntax-only, round 2 (extra armour plate)



  In message <14751.6847.44708.251421@loki.wkstn.nix>you write:
  > [Sorry for the delay, illness and such :( ]
  > Jeffrey A Law writes:
  > > For stuff like temporary files we manage them entirely in gcc.c instead o
  > f
  > > cc1.  If gcc.c aborts, then, well, we lose.  That is arguably bad behavio
  > r.
  > >
  > > I'm not sure how to best manage the temporary file problem, except maybe
  > > to move its management into gcc.c like we do for other temporary files.
  > 
  > Agreed. Stupid of me. Fixed.
  > 
  > >                                       Yes, we don't care about the case w
  > here
  > > MKTEMP_EACH_FILE is not defined.  But my recollection is that your patch
  > > removed some code where MKTEMP_EACH_FILE was defined.  Looking at it more
  > > closely now, I was mistaken (I read a #if[n]def backwards).
  > 
  > Ah, good :) I'll keep that, then.
  > 
  > >   > > I think you need to make those changes and resubmit.
  > >   > 
  > >   > I will strip out the specs changes, too, because Zack has done the sa
  > me
  > >   > thing already.
  > > OK.
  > 
  > Er, whoops, no he hasn't, he's made the code much simpler though.
  > 
  > > So the pending issues are the documentation and a better way to handle
  > > the temporary file without using atexit if at all possible -- possibly
  > > by managing the temporary file in gcc.c.
  > 
  > Done. This is against the 20000814 snapshot, but it won't apply cleanly
  > :( because Jakub's patch of
  > <20000818131204.W24872@devserv.devel.redhat.com> collides with it,
  > modifying exactly the same line ;) it should be easy enough to modify
  > (three letters ain't so hard) but I can supply a suitably fixed patch if
  > you like.
  > 
  > It adds a %j specs flag, which expands to /dev/null if HOST_BIT_BUCKET
  > is defined and writable, and creates a temporary file exactly as %u;
  > this is possibly not optimal, as %U should perhaps not substitute it in,
  > but I'm not sure how important this is (or if it is important at
  > all). If this is undesirable behaviour, I can change it.
  > 
  > I have changed the bits in the weird part of the Fortran specs file that
  > used /dev/null to use %j instead, so that wierdness (versioning?) will
  > work even on hosts that don't support /dev/null.
  > 
  > Where are %u and %U used, anyway? It doesn't seem to be used anywhere
  > that I can tell. (If this stuff is not critical for backward
  > compatibility, and I can't see how it is, maybe I should rationalize it
  > a bit...)
  > 
  > 
  > I'd like to provide a way for hosts to say that they do not support any
  > kind of bit bucket, but just `#undef'ing it in the hosts files can't
  > work, because system.h is included after config.h, so system.h would
  > just redefine it again. A pity; perhaps there is a nice way to say this,
  > but for now I suggest just #defining an illegal filename (the null
  > string, perhaps) for hosts that don't support a bit bucket. This is ugly
  > and kludged :( improvements welcome.
  > 
  > 
  > Tested on i586-pc-linux-gnu with writable and non-writable bit buckets;
  > no test regressions, and it works with -fsyntax-only too, emitting lots
  > of FAILs from the test suite because the output file doesn't exist
  > (maybe, for makefiles, we should arrange to create it if -o was
  > specified, but that is probably overkill. Anyone who uses -fsyntax-only
  > in makefiles should know what it does :) )
  > 
  > The changes to protoize.c are untested.
  > 
  > 2000-08-19  Nix  <nix@esperi.demon.co.uk>
  > 
  > 	* gcc.c (do_spec_1): Implement %j spec flag.
  > 	Remove dead comment.
  > 
  > 	* gcc.texi (The Configuration File): Document HOST_BIT_BUCKET.
  >         * system.h (HOST_BIT_BUCKET): Default to "/dev/null".
  >         * config/i386/xm-dos.h (HOST_BIT_BUCKET): Define as "NUL".
  >         * config/i386/xm-os2.h, config/winnt/winnt.h: Likewise.
  > 
  >         * protoize.c (munge_compile_params): Use HOST_BIT_BUCKET (if
  > 	writable) instead of hardcoded value.
  > 
  > 	* toplev.c (compile_file): Output to a file even if -fsyntax-only.
  > 
  >         * gcc.c, config/i386/xm-dos.h, config/i386/xm-os2.h: Kill
  >         MKTEMP_EACH_FILE.
  > 
  >         * gcc.c (cc1_options), ch/lang-specs.h, cp/lang-specs.h, f/lang-spe
  > cs.h,
  >         java/lang-specs.h, objc/lang-specs.h: Do not process -o or
  >         run the assembler if -fsyntax-only.
  > 	* f/lang-specs.h: Use %j instead of /dev/null.
Thanks.  Installed.
jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]