OLD | NEW |
---|---|
1 # Copyright (c) 2013 Google Inc. All rights reserved. | 1 # Copyright (c) 2013 Google Inc. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import collections | 5 import collections |
6 import copy | 6 import copy |
7 import hashlib | 7 import hashlib |
8 import json | 8 import json |
9 import multiprocessing | 9 import multiprocessing |
10 import os.path | 10 import os.path |
(...skipping 1873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1884 % { 'solink': | 1884 % { 'solink': |
1885 '$ld -shared $ldflags -o $lib -Wl,-soname=$soname %(suffix)s', | 1885 '$ld -shared $ldflags -o $lib -Wl,-soname=$soname %(suffix)s', |
1886 'extract_toc': | 1886 'extract_toc': |
1887 ('{ readelf -d $lib | grep SONAME ; ' | 1887 ('{ readelf -d $lib | grep SONAME ; ' |
1888 'nm -gD -f p $lib | cut -f1-2 -d\' \'; }')}) | 1888 'nm -gD -f p $lib | cut -f1-2 -d\' \'; }')}) |
1889 | 1889 |
1890 master_ninja.rule( | 1890 master_ninja.rule( |
1891 'solink', | 1891 'solink', |
1892 description='SOLINK $lib', | 1892 description='SOLINK $lib', |
1893 restat=True, | 1893 restat=True, |
1894 command=(mtime_preserving_solink_base % { | 1894 command=mtime_preserving_solink_base % {'suffix': '@$lib.rsp'}, |
1895 'suffix': '-Wl,--whole-archive $in $solibs -Wl,--no-whole-archive ' | 1895 rspfile='$lib.rsp', |
1896 '$libs'}), | 1896 rspfile_content= |
1897 '-Wl,--whole-archive $in $solibs -Wl,--no-whole-archive $libs', | |
1897 pool='link_pool') | 1898 pool='link_pool') |
1898 master_ninja.rule( | 1899 master_ninja.rule( |
1899 'solink_module', | 1900 'solink_module', |
1900 description='SOLINK(module) $lib', | 1901 description='SOLINK(module) $lib', |
1901 restat=True, | 1902 restat=True, |
1902 command=(mtime_preserving_solink_base % { | 1903 command=mtime_preserving_solink_base % {'suffix': '@$lib.rsp'}, |
1903 'suffix': '-Wl,--start-group $in $solibs -Wl,--end-group ' | 1904 rspfile='$lib.rsp', |
1904 '$libs'}), | 1905 rspfile_content='-Wl,--start-group $in $solibs -Wl,--end-group $libs', |
1905 pool='link_pool') | 1906 pool='link_pool') |
1906 master_ninja.rule( | 1907 master_ninja.rule( |
1907 'link', | 1908 'link', |
1908 description='LINK $out', | 1909 description='LINK $out', |
1909 command=('$ld $ldflags -o $out ' | 1910 command=('$ld $ldflags -o $out ' |
1910 '-Wl,--start-group $in $solibs -Wl,--end-group $libs'), | 1911 '-Wl,--start-group $in $solibs -Wl,--end-group $libs'), |
1911 pool='link_pool') | 1912 pool='link_pool') |
1912 elif flavor == 'win': | 1913 elif flavor == 'win': |
1913 master_ninja.rule( | 1914 master_ninja.rule( |
1914 'alink', | 1915 'alink', |
1915 description='LIB $out', | 1916 description='LIB $out', |
1916 command=('%s gyp-win-tool link-wrapper $arch False ' | 1917 command=('%s gyp-win-tool link-wrapper $arch False ' |
1917 '$ar /nologo /ignore:4221 /OUT:$out @$out.rsp' % | 1918 '$ar /nologo /ignore:4221 /OUT:$out @$lib.rsp' % |
scottmg
2014/03/13 03:34:58
looks like this has an extra EncodePOSIX, but shou
| |
1918 sys.executable), | 1919 sys.executable), |
1919 rspfile='$out.rsp', | 1920 rspfile='$lib.rsp', |
1920 rspfile_content='$in_newline $libflags') | 1921 rspfile_content='$in_newline $libflags') |
1921 _AddWinLinkRules(master_ninja, embed_manifest=True) | 1922 _AddWinLinkRules(master_ninja, embed_manifest=True) |
1922 _AddWinLinkRules(master_ninja, embed_manifest=False) | 1923 _AddWinLinkRules(master_ninja, embed_manifest=False) |
1923 else: | 1924 else: |
1924 master_ninja.rule( | 1925 master_ninja.rule( |
1925 'objc', | 1926 'objc', |
1926 description='OBJC $out', | 1927 description='OBJC $out', |
1927 command=('$cc -MMD -MF $out.d $defines $includes $cflags $cflags_objc ' | 1928 command=('$cc -MMD -MF $out.d $defines $includes $cflags $cflags_objc ' |
1928 '$cflags_pch_objc -c $in -o $out'), | 1929 '$cflags_pch_objc -c $in -o $out'), |
1929 depfile='$out.d', | 1930 depfile='$out.d', |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1961 '%(solink)s && %(extract_toc)s > $lib.tmp && ' | 1962 '%(solink)s && %(extract_toc)s > $lib.tmp && ' |
1962 'if ! cmp -s $lib.tmp $lib.TOC; then ' | 1963 'if ! cmp -s $lib.tmp $lib.TOC; then ' |
1963 'mv $lib.tmp $lib.TOC ; ' | 1964 'mv $lib.tmp $lib.TOC ; ' |
1964 'fi; ' | 1965 'fi; ' |
1965 'fi' | 1966 'fi' |
1966 % { 'solink': solink_base, | 1967 % { 'solink': solink_base, |
1967 'extract_toc': | 1968 'extract_toc': |
1968 '{ otool -l $lib | grep LC_ID_DYLIB -A 5; ' | 1969 '{ otool -l $lib | grep LC_ID_DYLIB -A 5; ' |
1969 'nm -gP $lib | cut -f1-2 -d\' \' | grep -v U$$; true; }'}) | 1970 'nm -gP $lib | cut -f1-2 -d\' \' | grep -v U$$; true; }'}) |
1970 | 1971 |
1971 solink_suffix = '$in $solibs $libs$postbuilds' | 1972 |
1973 solink_suffix = '@$lib.rsp$postbuilds' | |
1972 master_ninja.rule( | 1974 master_ninja.rule( |
1973 'solink', | 1975 'solink', |
1974 description='SOLINK $lib, POSTBUILDS', | 1976 description='SOLINK $lib, POSTBUILDS', |
1975 restat=True, | 1977 restat=True, |
1976 command=mtime_preserving_solink_base % {'suffix': solink_suffix, | 1978 command=mtime_preserving_solink_base % {'suffix': solink_suffix, |
1977 'type': '-shared'}, | 1979 'type': '-shared'}, |
1980 rspfile='$lib.rsp', | |
1981 rspfile_content='$in $solibs $libs', | |
1978 pool='link_pool') | 1982 pool='link_pool') |
1979 master_ninja.rule( | 1983 master_ninja.rule( |
1980 'solink_notoc', | 1984 'solink_notoc', |
1981 description='SOLINK $lib, POSTBUILDS', | 1985 description='SOLINK $lib, POSTBUILDS', |
1982 restat=True, | 1986 restat=True, |
1983 command=solink_base % {'suffix':solink_suffix, 'type': '-shared'}, | 1987 command=solink_base % {'suffix':solink_suffix, 'type': '-shared'}, |
1988 rspfile='$lib.rsp', | |
1989 rspfile_content='$in $solibs $libs', | |
1984 pool='link_pool') | 1990 pool='link_pool') |
1985 | 1991 |
1986 solink_module_suffix = '$in $solibs $libs$postbuilds' | |
1987 master_ninja.rule( | 1992 master_ninja.rule( |
1988 'solink_module', | 1993 'solink_module', |
1989 description='SOLINK(module) $lib, POSTBUILDS', | 1994 description='SOLINK(module) $lib, POSTBUILDS', |
1990 restat=True, | 1995 restat=True, |
1991 command=mtime_preserving_solink_base % {'suffix': solink_module_suffix, | 1996 command=mtime_preserving_solink_base % {'suffix': solink_suffix, |
1992 'type': '-bundle'}, | 1997 'type': '-bundle'}, |
1998 rspfile='$lib.rsp', | |
1999 rspfile_content='$in $solibs $libs', | |
scottmg
2014/03/13 03:34:58
does this need $postbuilds?
| |
1993 pool='link_pool') | 2000 pool='link_pool') |
1994 master_ninja.rule( | 2001 master_ninja.rule( |
1995 'solink_module_notoc', | 2002 'solink_module_notoc', |
1996 description='SOLINK(module) $lib, POSTBUILDS', | 2003 description='SOLINK(module) $lib, POSTBUILDS', |
1997 restat=True, | 2004 restat=True, |
1998 command=solink_base % {'suffix': solink_module_suffix, 'type': '-bundle'}, | 2005 command=solink_base % {'suffix': solink_suffix, 'type': '-bundle'}, |
2006 rspfile='$lib.rsp', | |
2007 rspfile_content='$in $solibs $libs', | |
scottmg
2014/03/13 03:34:58
and here
| |
1999 pool='link_pool') | 2008 pool='link_pool') |
2000 | 2009 |
2001 master_ninja.rule( | 2010 master_ninja.rule( |
2002 'link', | 2011 'link', |
2003 description='LINK $out, POSTBUILDS', | 2012 description='LINK $out, POSTBUILDS', |
2004 command=('$ld $ldflags -o $out ' | 2013 command=('$ld $ldflags -o $out ' |
2005 '$in $solibs $libs$postbuilds'), | 2014 '$in $solibs $libs$postbuilds'), |
2006 pool='link_pool') | 2015 pool='link_pool') |
2007 master_ninja.rule( | 2016 master_ninja.rule( |
2008 'preprocess_infoplist', | 2017 'preprocess_infoplist', |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2160 arglists.append( | 2169 arglists.append( |
2161 (target_list, target_dicts, data, params, config_name)) | 2170 (target_list, target_dicts, data, params, config_name)) |
2162 pool.map(CallGenerateOutputForConfig, arglists) | 2171 pool.map(CallGenerateOutputForConfig, arglists) |
2163 except KeyboardInterrupt, e: | 2172 except KeyboardInterrupt, e: |
2164 pool.terminate() | 2173 pool.terminate() |
2165 raise e | 2174 raise e |
2166 else: | 2175 else: |
2167 for config_name in config_names: | 2176 for config_name in config_names: |
2168 GenerateOutputForConfig(target_list, target_dicts, data, params, | 2177 GenerateOutputForConfig(target_list, target_dicts, data, params, |
2169 config_name) | 2178 config_name) |
OLD | NEW |