Chromium Code Reviews| Index: pylib/gyp/mac_tool.py |
| diff --git a/pylib/gyp/mac_tool.py b/pylib/gyp/mac_tool.py |
| index e5d8a2b89665385bc622ce4a69fa4acbbcfff684..8e5d909cf1150e5077f76881540225a917057efd 100755 |
| --- a/pylib/gyp/mac_tool.py |
| +++ b/pylib/gyp/mac_tool.py |
| @@ -223,11 +223,27 @@ class MacTool(object): |
| r'^.*libtool: warning for library: ' + |
| r'.* the table of contents is empty ' + |
| r'\(no object file members in the library define global symbols\)$') |
| - libtoolout = subprocess.Popen(cmd_list, stderr=subprocess.PIPE) |
| + env = os.environ.copy() |
| + # Ref: |
| + # http://www.opensource.apple.com/source/cctools/cctools-809/misc/libtool.c |
| + # The problem with this flag is that it resets the file mtime on the file to |
| + # epoch=0, e.g. 1970-1-1 or 1969-12-31 depending on daylight saving. |
| + env['ZERO_AR_DATE'] = '1' |
| + libtoolout = subprocess.Popen(cmd_list, stderr=subprocess.PIPE, env=env) |
| _, err = libtoolout.communicate() |
| for line in err.splitlines(): |
| if not libtool_re.match(line) and not libtool_re5.match(line): |
| print >>sys.stderr, line |
| + # Unconditionally touch any file .a file on the command line if present if |
| + # succeeded. A bit hacky. |
| + if not libtoolout.returncode: |
| + archives = [ |
| + cmd for cmd in cmd_list if cmd.endswith('.a') and os.path.isfile(cmd) |
| + ] |
| + if len(archives) != 1: |
| + print >>sys.stderr, 'Build determinism hack assertion failed' |
| + return 1 |
| + os.utime(archives[0], None) |
|
M-A Ruel
2014/11/05 02:51:05
I confirmed by running the test with:
./gyptest.py
|
| return libtoolout.returncode |
| def ExecPackageFramework(self, framework, version): |