Make yasm deterministic by setting YASM_TEST_SUITE=1 while running it.

Setting YASM_TEST_SUITE makes yasm output deterministic:
- the PE/COFF timestamp field is always 0 (this breaks link.exe /incremental,
  but we no longer user link.exe)
- in debug info, yasm identifies itself as "yasm HEAD" instead of e.g.
  "yasm 1.3.0" (we don't care much about this effect)
- in debug info, file paths are no longer absolute but relative to '.'

Bug: 330260
Change-Id: Icafe7abd6a637b86af2b5b8e7f88e0bfa042da50
Reviewed-on: https://chromium-review.googlesource.com/1180718
Reviewed-by: Erik Chen <erikchen@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#584456}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 0186fab3ff94a5c847fdab82b8eec543ccca7c6e
diff --git a/run_yasm.py b/run_yasm.py
index cbd79cc..a257295 100644
--- a/run_yasm.py
+++ b/run_yasm.py
@@ -18,6 +18,7 @@
 """
 
 import argparse
+import os
 import sys
 import subprocess
 
@@ -30,6 +31,15 @@
 objfile = options.objfile
 depfile = objfile + '.d'
 
+# Set up environment for yasm.
+# Setting YASM_TEST_SUITE makes yasm output deterministic:
+# - the PE/COFF timestamp field is always 0 (this breaks link.exe /incremental,
+#   but we no longer user link.exe)
+# - in debug info, yasm identifies itself as "yasm HEAD" instead of e.g.
+#   "yasm 1.3.0" (we don't care much about this effect)
+# - in debug info, file paths are no longer absolute but relative to '.'
+os.environ['YASM_TEST_SUITE'] = '1'
+
 # Assemble.
 result_code = subprocess.call(sys.argv[1:])
 if result_code != 0: