From: Alexandre Oliva <aoliva@redhat.com>
To: sid@sources.redhat.com
Cc: fche@redhat.com
Subject: make CGEN.sh parallelizable
Date: Thu, 19 Sep 2002 18:00:00 -0000 [thread overview]
Message-ID: <or7khhscf9.fsf@free.redhat.lsd.ic.unicamp.br> (raw)
[-- Attachment #1: Type: text/plain, Size: 462 bytes --]
Some existing cgen-based sid ports (arm7t, for example) may run into
problems in case you run make cgen-all -jN with some N>1, because
CGEN.sh reuses the same temporary file names for concurrent builds.
Oops. This patch fixes this problem, except on filesystems that have
limited filenames, in which case the PID trailer is likely to be
dropped, so it will hopefully still work without -j on such old,
broken systems. I'm checking this in, approved by Frank.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: sid-cgen-parallelize.patch --]
[-- Type: text/x-patch, Size: 5946 bytes --]
Index: sid/component/cgen-cpu/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* CGEN.sh.in: Add $$ to temporary file names.
Index: sid/component/cgen-cpu/CGEN.sh.in
===================================================================
RCS file: /cvs/src/src/sid/component/cgen-cpu/CGEN.sh.in,v
retrieving revision 1.1
diff -u -p -r1.1 CGEN.sh.in
--- sid/component/cgen-cpu/CGEN.sh.in 7 Dec 2000 19:30:47 -0000 1.1
+++ sid/component/cgen-cpu/CGEN.sh.in 20 Sep 2002 00:59:45 -0000
@@ -66,26 +66,26 @@ else
fi
-rm -f tmp-desc.h1 tmp-desc.h
-rm -f tmp-cpu.h1 tmp-cpu.h
-rm -f tmp-defs.h1 tmp-defs.h
-rm -f tmp-sem.cxx1 tmp-sem.cxx
-rm -f tmp-semsw.cxx1 tmp-semsw.cxx
-rm -f tmp-dec.h1 tmp-dec.h
-rm -f tmp-dec.cxx1 tmp-dec.cxx
+rm -f tmp-desc-$$.h1 tmp-desc-$$.h
+rm -f tmp-cpu-$$.h1 tmp-cpu-$$.h
+rm -f tmp-defs-$$.h1 tmp-defs-$$.h
+rm -f tmp-sem-$$.cxx1 tmp-sem-$$.cxx
+rm -f tmp-semsw-$$.cxx1 tmp-semsw-$$.cxx
+rm -f tmp-dec-$$.h1 tmp-dec-$$.h
+rm -f tmp-dec-$$.cxx1 tmp-dec-$$.cxx
fileopts=""
for f in $filespecs
do
case $f in
- desc.h) fileopts="$fileopts -H tmp-desc.h1" ;;
- cpu.h) fileopts="$fileopts -C tmp-cpu.h1" ;;
- defs.h) fileopts="$fileopts -E tmp-defs.h1" ;;
- decode.h) fileopts="$fileopts -T tmp-dec.h1" ;;
- decode.cxx) fileopts="$fileopts -D tmp-dec.cxx1" ;;
- semantics.cxx) fileopts="$fileopts -S tmp-sem.cxx1" ;;
- sem-switch.cxx) fileopts="$fileopts -X tmp-semsw.cxx1" ;;
- write.cxx) fileopts="$fileopts -W tmp-write.cxx1" ;;
+ desc.h) fileopts="$fileopts -H tmp-desc-$$.h1" ;;
+ cpu.h) fileopts="$fileopts -C tmp-cpu-$$.h1" ;;
+ defs.h) fileopts="$fileopts -E tmp-defs-$$.h1" ;;
+ decode.h) fileopts="$fileopts -T tmp-dec-$$.h1" ;;
+ decode.cxx) fileopts="$fileopts -D tmp-dec-$$.cxx1" ;;
+ semantics.cxx) fileopts="$fileopts -S tmp-sem-$$.cxx1" ;;
+ sem-switch.cxx) fileopts="$fileopts -X tmp-semsw-$$.cxx1" ;;
+ write.cxx) fileopts="$fileopts -W tmp-write-$$.cxx1" ;;
*) echo "unknown file spec: $f" >&2 ; exit 1 ;;
esac
done
@@ -110,68 +110,68 @@ do
sed -e "s,@ARCH@,${ARCH},g" -e "s,@arch@,${arch},g" \
-e "s=@CPU@=${CPU}=g" -e "s=@cpu@=${cpu}=g" \
-e "s=@PREFIX@=${PREFIX}=g" -e "s=@"prefix"@=${prefix}=g" \
- < tmp-desc.h1 > tmp-desc.h
- ${rootdir}/move-if-change tmp-desc.h ${srcdir}/${fileprefix}desc.h
+ < tmp-desc-$$.h1 > tmp-desc-$$.h
+ ${rootdir}/move-if-change tmp-desc-$$.h ${srcdir}/${fileprefix}desc.h
;;
cpu.h)
sed -e "s=@ARCH@=${ARCH}=g" -e "s=@arch@=${arch}=g" \
-e "s=@CPU@=${CPU}=g" -e "s=@cpu@=${cpu}=g" \
-e "s=@PREFIX@=${PREFIX}=g" -e "s=@"prefix"@=${prefix}=g" \
- < tmp-cpu.h1 > tmp-cpu.h
- ${rootdir}/move-if-change tmp-cpu.h ${srcdir}/${fileprefix}cpu.h
+ < tmp-cpu-$$.h1 > tmp-cpu-$$.h
+ ${rootdir}/move-if-change tmp-cpu-$$.h ${srcdir}/${fileprefix}cpu.h
;;
defs.h)
sed -e "s=@ARCH@=${ARCH}=g" -e "s=@arch@=${arch}=g" \
-e "s=@CPU@=${CPU}=g" -e "s=@cpu@=${cpu}=g" \
-e "s=@PREFIX@=${PREFIX}=g" -e "s=@"prefix"@=${prefix}=g" \
- < tmp-defs.h1 > tmp-defs.h
- ${rootdir}/move-if-change tmp-defs.h ${srcdir}/${fileprefix}defs.h
+ < tmp-defs-$$.h1 > tmp-defs-$$.h
+ ${rootdir}/move-if-change tmp-defs-$$.h ${srcdir}/${fileprefix}defs.h
;;
decode.h)
sed -e "s=@ARCH@=${ARCH}=g" -e "s=@arch@=${arch}=g" \
-e "s=@CPU@=${CPU}=g" -e "s=@cpu@=${cpu}=g" \
-e "s=@PREFIX@=${PREFIX}=g" -e "s=@"prefix"@=${prefix}=g" \
- < tmp-dec.h1 > tmp-dec.h
- ${rootdir}/move-if-change tmp-dec.h ${srcdir}/${fileprefix}decode.h
+ < tmp-dec-$$.h1 > tmp-dec-$$.h
+ ${rootdir}/move-if-change tmp-dec-$$.h ${srcdir}/${fileprefix}decode.h
;;
decode.cxx)
sed -e "s=@ARCH@=${ARCH}=g" -e "s=@arch@=${arch}=g" \
-e "s=@CPU@=${CPU}=g" -e "s=@cpu@=${cpu}=g" \
-e "s=@PREFIX@=${PREFIX}=g" -e "s=@"prefix"@=${prefix}=g" \
- < tmp-dec.cxx1 > tmp-dec.cxx
- ${rootdir}/move-if-change tmp-dec.cxx ${srcdir}/${fileprefix}decode.cxx
+ < tmp-dec-$$.cxx1 > tmp-dec-$$.cxx
+ ${rootdir}/move-if-change tmp-dec-$$.cxx ${srcdir}/${fileprefix}decode.cxx
;;
semantics.cxx)
sed -e "s=@ARCH@=${ARCH}=g" -e "s=@arch@=${arch}=g" \
-e "s=@CPU@=${CPU}=g" -e "s=@cpu@=${cpu}=g" \
-e "s=@PREFIX@=${PREFIX}=g" -e "s=@"prefix"@=${prefix}=g" \
- < tmp-sem.cxx1 > tmp-sem.cxx
- ${rootdir}/move-if-change tmp-sem.cxx ${srcdir}/${fileprefix}sem.cxx
+ < tmp-sem-$$.cxx1 > tmp-sem-$$.cxx
+ ${rootdir}/move-if-change tmp-sem-$$.cxx ${srcdir}/${fileprefix}sem.cxx
;;
sem-switch.cxx)
sed -e "s=@ARCH@=${ARCH}=g" -e "s=@arch@=${arch}=g" \
-e "s=@CPU@=${CPU}=g" -e "s=@cpu@=${cpu}=g" \
-e "s=@PREFIX@=${PREFIX}=g" -e "s=@"prefix"@=${prefix}=g" \
- < tmp-semsw.cxx1 > tmp-semsw.cxx
- ${rootdir}/move-if-change tmp-semsw.cxx ${srcdir}/${fileprefix}semsw.cxx
+ < tmp-semsw-$$.cxx1 > tmp-semsw-$$.cxx
+ ${rootdir}/move-if-change tmp-semsw-$$.cxx ${srcdir}/${fileprefix}semsw.cxx
;;
write.cxx)
sed -e "s=@ARCH@=${ARCH}=g" -e "s=@arch@=${arch}=g" \
-e "s=@CPU@=${CPU}=g" -e "s=@cpu@=${cpu}=g" \
-e "s=@PREFIX@=${PREFIX}=g" -e "s=@"prefix"@=${prefix}=g" \
- < tmp-write.cxx1 > tmp-write.cxx
- ${rootdir}/move-if-change tmp-write.cxx ${srcdir}/${fileprefix}write.cxx
+ < tmp-write-$$.cxx1 > tmp-write-$$.cxx
+ ${rootdir}/move-if-change tmp-write-$$.cxx ${srcdir}/${fileprefix}write.cxx
;;
esac
done
-rm -f tmp-desc.h1 tmp-desc.h
-rm -f tmp-cpu.h1 tmp-cpu.h
-rm -f tmp-defs.h1 tmp-defs.h
-rm -f tmp-sem.cxx1 tmp-sem.cxx
-rm -f tmp-semsw.cxx1 tmp-semsw.cxx
-rm -f tmp-write.cxx1 tmp-write.cxx
-rm -f tmp-dec.h1 tmp-dec.h
-rm -f tmp-dec.cxx1 tmp-dec.cxx
+rm -f tmp-desc-$$.h1 tmp-desc-$$.h
+rm -f tmp-cpu-$$.h1 tmp-cpu-$$.h
+rm -f tmp-defs-$$.h1 tmp-defs-$$.h
+rm -f tmp-sem-$$.cxx1 tmp-sem-$$.cxx
+rm -f tmp-semsw-$$.cxx1 tmp-semsw-$$.cxx
+rm -f tmp-write-$$.cxx1 tmp-write-$$.cxx
+rm -f tmp-dec-$$.h1 tmp-dec-$$.h
+rm -f tmp-dec-$$.cxx1 tmp-dec-$$.cxx
exit 0
[-- Attachment #3: Type: text/plain, Size: 70 bytes --]
--
Alexandre Oliva, GCC Team +55 19 3243-5233 / +55 19 9714-3658
reply other threads:[~2002-09-20 1:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=or7khhscf9.fsf@free.redhat.lsd.ic.unicamp.br \
--to=aoliva@redhat.com \
--cc=fche@redhat.com \
--cc=sid@sources.redhat.com \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).