* make CGEN.sh parallelizable
@ 2002-09-19 18:00 Alexandre Oliva
0 siblings, 0 replies; only message in thread
From: Alexandre Oliva @ 2002-09-19 18:00 UTC (permalink / raw)
To: sid; +Cc: fche
[-- 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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-09-20 1:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-19 18:00 make CGEN.sh parallelizable Alexandre Oliva
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).