Commit 0186fab3 authored by Nico Weber's avatar Nico Weber Committed by Commit Bot

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/1180718Reviewed-by: default avatarErik Chen <erikchen@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584456}
parent 8b9d29e9
...@@ -18,6 +18,7 @@ specify that. ...@@ -18,6 +18,7 @@ specify that.
""" """
import argparse import argparse
import os
import sys import sys
import subprocess import subprocess
...@@ -30,6 +31,15 @@ options, _ = parser.parse_known_args() ...@@ -30,6 +31,15 @@ options, _ = parser.parse_known_args()
objfile = options.objfile objfile = options.objfile
depfile = objfile + '.d' 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. # Assemble.
result_code = subprocess.call(sys.argv[1:]) result_code = subprocess.call(sys.argv[1:])
if result_code != 0: if result_code != 0:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment