aboutsummaryrefslogtreecommitdiff
path: root/sim/common
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-10-31 03:29:36 -0400
committerMike Frysinger <vapier@gentoo.org>2021-11-02 22:59:07 -0400
commit0a129eb19a773d930d60b084209570f663db2053 (patch)
treec29451f6fe7b9d2ae8ebc071b7a04fb36033973a /sim/common
parentd2a5dbc744548e173ba1687e1a63a8c2196c7122 (diff)
downloadfsf-binutils-gdb-0a129eb19a773d930d60b084209570f663db2053.zip
fsf-binutils-gdb-0a129eb19a773d930d60b084209570f663db2053.tar.gz
fsf-binutils-gdb-0a129eb19a773d930d60b084209570f663db2053.tar.bz2
sim: hoist cgen mloop rules up to common builds
These rules don't depend on the target compiler settings, so hoist the build logic up to the common builds for better parallelization. We have to extend the genmloop.sh logic a bit to allow outputting to a subdir since it always assumed cwd was the right place. We leave the cgen maintainer rules in the subdirs for now as they aren't normally run, and they rely on cgen logic that has not yet been generalized.
Diffstat (limited to 'sim/common')
-rwxr-xr-xsim/common/genmloop.sh15
1 files changed, 9 insertions, 6 deletions
diff --git a/sim/common/genmloop.sh b/sim/common/genmloop.sh
index fa4e7b9..572dc8a 100755
--- a/sim/common/genmloop.sh
+++ b/sim/common/genmloop.sh
@@ -140,6 +140,7 @@ switch=
cpu="unknown"
infile=""
prefix="unknown"
+outprefix=""
outsuffix=""
while test $# -gt 0
@@ -154,6 +155,7 @@ do
-scache) scache=yes ;;
-pbb) pbb=yes ;;
-no-parallel) ;;
+ -outfile-prefix) shift ; outprefix=$1 ;;
-outfile-suffix) shift ; outsuffix=$1 ;;
-parallel-read) parallel=read ;;
-parallel-write) parallel=write ;;
@@ -197,8 +199,8 @@ PREFIX=`echo ${prefix} | tr "${lowercase}" "${uppercase}"`
##########################################################################
-rm -f eng${outsuffix}.hin
-exec 1>eng${outsuffix}.hin
+rm -f ${outprefix}eng${outsuffix}.hin
+exec 1>${outprefix}eng${outsuffix}.hin
echo "/* engine configuration for ${cpu} */"
echo ""
@@ -291,8 +293,8 @@ fi
##########################################################################
-rm -f tmp-mloop-$$.cin mloop${outsuffix}.cin
-exec 1>tmp-mloop-$$.cin
+rm -f ${outprefix}tmp-mloop-$$.cin ${outprefix}mloop${outsuffix}.cin
+exec 1>${outprefix}tmp-mloop-$$.cin
# We use @cpu@ instead of ${cpu} because we still need to run sed to handle
# transformation of @cpu@ for mainloop.in, so there's no need to use ${cpu}
@@ -1334,8 +1336,9 @@ fi # -pbb
# Expand @..@ macros appearing in tmp-mloop-{pid}.cin.
sed \
-e "s/@cpu@/$cpu/g" -e "s/@CPU@/$CPU/g" \
- -e "s/@prefix@/$prefix/g" -e "s/@PREFIX@/$PREFIX/g" < tmp-mloop-$$.cin > mloop${outsuffix}.cin
+ -e "s/@prefix@/$prefix/g" -e "s/@PREFIX@/$PREFIX/g" \
+ < ${outprefix}tmp-mloop-$$.cin > ${outprefix}mloop${outsuffix}.cin
rc=$?
-rm -f tmp-mloop-$$.cin
+rm -f ${outprefix}tmp-mloop-$$.cin
exit $rc