From bc3bd502de1a60b91cc95157e2d9f530e022180f Mon Sep 17 00:00:00 2001 From: Jim Stichnoth Date: Wed, 20 Jan 2016 15:01:39 -0800 Subject: [PATCH] Subzero: Change the szbuild.py --force default. With the --force option, the behavior of its default setting is dangerous. Specifically, it doesn't retranslate by default when you change the szbuild command-line arguments. This leads to debugging frustration. Therefore, we change the default setting to be "dumb" and always retranslate. For bisection debugging, the user will quickly realize that they want to add "--force=0". BUG= none R=jpp@chromium.org Review URL: https://codereview.chromium.org/1608323002 . --- Makefile.standalone | 2 +- pydir/szbuild.py | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Makefile.standalone b/Makefile.standalone index 9f6e655de..38e7bd9e6 100644 --- a/Makefile.standalone +++ b/Makefile.standalone @@ -473,7 +473,7 @@ endif SPECFLAGS := SPECBUILDONLY := false %.spec2k: % $(OBJDIR)/pnacl-sz make_symlink runtime - ./pydir/szbuild_spec2k.py -v --force \ + ./pydir/szbuild_spec2k.py -v \ $(SPECFLAGS) --target=$(TARGETFLAG) $(SPEC) $< $(SPECBUILDONLY) || ( cd ../../../tests/spec2k; \ ./run_all.sh RunTimedBenchmarks $(SETUP) train $< ) diff --git a/pydir/szbuild.py b/pydir/szbuild.py index 5f645b86e..36112dad2 100755 --- a/pydir/szbuild.py +++ b/pydir/szbuild.py @@ -61,8 +61,10 @@ def MatchSymbol(sym, re_include, re_exclude, default_match): return default_match def AddOptionalArgs(argparser): - argparser.add_argument('--force', dest='force', action='store_true', - help='Force all re-translations of the pexe') + argparser.add_argument('--force', dest='force', type=int, choices=[0, 1], + default=1, + help='Force all re-translations of the pexe.' + + ' Default %(default)s.') argparser.add_argument('--include', '-i', default=[], dest='include', action='append', help='Subzero symbols to include ' + @@ -240,11 +242,11 @@ def main(): If no --include or --exclude arguments are given, the executable is produced entirely using Subzero, without using llc or linker tricks. - This script uses file modification timestamps to determine whether llc and - Subzero re-translation are needed. It checks timestamps of llc, pnacl-sz, - and the pexe against the translated object files to determine the minimal - work necessary. The --force option suppresses those checks and - re-translates everything. + When using the --force=0 option, this script uses file modification + timestamps to determine whether llc and Subzero re-translation are needed. + It checks timestamps of llc, pnacl-sz, and the pexe against the translated + object files to determine the minimal work necessary. The --force=1 option + (default) suppresses those checks and re-translates everything. This script expects various PNaCl and LLVM tools to be found within the native_client tree. When changes are made to these tools, copy them this -- 2.11.0