From: "rob pike" <rob@plan9.bell-labs.com>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] cc and more
Date: Sat, 8 Jul 2000 08:03:31 -0400 [thread overview]
Message-ID: <200007081203.IAA00122@cse.psu.edu> (raw)
Quinn is right; ape/cc and pcc have a nefarious bug. We never caught
it because it is triggered by specifying libraries explicitly, which is
almost never necessary in Plan 9 - our `autolib' #pragma figures out
which libraries to use. But if you override that, for whatever reason,
you can overwrite the wrong files. Quinn did
ape/cc -v -o test -lc test.c
which caused the output to be written to /$objtype/lib/ape/libc.a.
(The -lc is unnecessary and in fact erroneous).
Here are the patches:
diff -n /n/dump/2000/0708/sys/src/cmd/pcc.c /sys/src/cmd/pcc.c
/n/dump/2000/0708/sys/src/cmd/pcc.c:154 c pcc.c:154,157
< append(&cc, objs.strings[i]);
---
> if(cflag)
> append(&cc, oname);
> else
> append(&cc, changeext(srcs.strings[i], ot->o));
diff -n /n/dump/2000/0708/sys/src/cmd/pcc.c /sys/src/cmd/pcc.c
/n/dump/2000/0708/sys/src/cmd/pcc.c:52 c /sys/src/cmd/pcc.c:52
< int i, cppn, ccn;
---
> int i, cppn, ccn, oflag;
/n/dump/2000/0708/sys/src/cmd/pcc.c:53 a /sys/src/cmd/pcc.c:54
> oflag = 0;
/n/dump/2000/0708/sys/src/cmd/pcc.c:69 a /sys/src/cmd/pcc.c:71
> oflag = 1;
/n/dump/2000/0708/sys/src/cmd/pcc.c:154 c /sys/src/cmd/pcc.c:156,159
< append(&cc, objs.strings[i]);
---
> if(oflag && cflag)
> append(&cc, oname);
> else
> append(&cc, changeext(srcs.strings[i], ot->o));
next reply other threads:[~2000-07-08 12:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-07-08 12:03 rob pike [this message]
-- strict thread matches above, loose matches on Subject: below --
2000-06-28 18:48 rsc
2000-06-28 12:41 Quinn Dunkan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200007081203.IAA00122@cse.psu.edu \
--to=rob@plan9.bell-labs.com \
--cc=9fans@cse.psu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).