Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Unified Diff: pylib/gyp/mac_tool.py

Issue 699083004: Set ZERO_AR_DATE=1 when running libtool. (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: Remove the assert as it triggers with gyptest-product Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mac/gyptest-libtool-zero.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pylib/gyp/mac_tool.py
diff --git a/pylib/gyp/mac_tool.py b/pylib/gyp/mac_tool.py
index e5d8a2b89665385bc622ce4a69fa4acbbcfff684..a25754c7ab3e787cda189e843e74ad2b09a4b83a 100755
--- a/pylib/gyp/mac_tool.py
+++ b/pylib/gyp/mac_tool.py
@@ -223,11 +223,25 @@ 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:
+ os.utime(archives[0], None)
return libtoolout.returncode
def ExecPackageFramework(self, framework, version):
« no previous file with comments | « no previous file | test/mac/gyptest-libtool-zero.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698