| OLD | NEW |
| 1 diff --git a/toolchain_build/toolchain_build_pnacl.py b/toolchain_build/toolchai
n_build_pnacl.py | 1 diff --git a/toolchain_build/toolchain_build_pnacl.py b/toolchain_build/toolchai
n_build_pnacl.py |
| 2 --- a/toolchain_build/toolchain_build_pnacl.py | 2 --- a/toolchain_build/toolchain_build_pnacl.py |
| 3 +++ b/toolchain_build/toolchain_build_pnacl.py | 3 +++ b/toolchain_build/toolchain_build_pnacl.py |
| 4 @@ -151,30 +151,33 @@ def ProgramPath(program): | 4 @@ -191,29 +191,31 @@ binaries themselves should be considered inputs for memoiz
ation. |
| 5 # Return a tuple (C compiler, C++ compiler) of the compilers to compile the hos
t | 5 # Return a tuple (C compiler, C++ compiler, ar, ranlib) of the compilers and |
| 6 # toolchains | 6 # tools to compile the host toolchains. |
| 7 def CompilersForHost(host): | 7 def CompilersForHost(host): |
| 8 - compiler = { | 8 - compiler = { |
| 9 + rtn = { | 9 + rtn = { |
| 10 # For now we only do native builds for linux and mac | 10 # For now we only do native builds for linux and mac |
| 11 # treat 32-bit linux like a native build | 11 # treat 32-bit linux like a native build |
| 12 - 'i686-linux': (CHROME_CLANG, CHROME_CLANGXX, 'ar', 'ranlib'), | 12 - 'i686-linux': (CHROME_CLANG, CHROME_CLANGXX, 'ar', 'ranlib'), |
| 13 - 'x86_64-linux': (CHROME_CLANG, CHROME_CLANGXX, 'ar', 'ranlib'), | 13 - 'x86_64-linux': (CHROME_CLANG, CHROME_CLANGXX, 'ar', 'ranlib'), |
| 14 - 'x86_64-apple-darwin': (CHROME_CLANG, CHROME_CLANGXX, 'ar', 'ranlib'), | 14 - 'x86_64-apple-darwin': (CHROME_CLANG, CHROME_CLANGXX, 'ar', 'ranlib'), |
| 15 + 'i686-linux': [CHROME_CLANG, CHROME_CLANGXX, 'ar', 'ranlib'], | 15 + 'i686-linux': [CHROME_CLANG, CHROME_CLANGXX, 'ar', 'ranlib'], |
| 16 + 'x86_64-linux': [CHROME_CLANG, CHROME_CLANGXX, 'ar', 'ranlib'], | 16 + 'x86_64-linux': [CHROME_CLANG, CHROME_CLANGXX, 'ar', 'ranlib'], |
| 17 + 'x86_64-apple-darwin': [CHROME_CLANG, CHROME_CLANGXX, 'ar', 'ranlib'], | 17 + 'x86_64-apple-darwin': [CHROME_CLANG, CHROME_CLANGXX, 'ar', 'ranlib'], |
| 18 # Windows build should work for native and cross | 18 # Windows build should work for native and cross |
| 19 - 'i686-w64-mingw32': ( | 19 - 'i686-w64-mingw32': ( |
| 20 - 'i686-w64-mingw32-gcc', 'i686-w64-mingw32-g++', 'ar', 'ranlib'), | 20 - 'i686-w64-mingw32-gcc', 'i686-w64-mingw32-g++', 'ar', 'ranlib'), |
| 21 + 'i686-w64-mingw32': [ | 21 + 'i686-w64-mingw32': [ |
| 22 + 'i686-w64-mingw32-gcc', 'i686-w64-mingw32-g++', 'ar', 'ranlib'], | 22 + 'i686-w64-mingw32-gcc', 'i686-w64-mingw32-g++', 'ar', 'ranlib'], |
| 23 # TODO: add arm-hosted support | 23 # TODO: add arm-hosted support |
| 24 - 'i686-pc-cygwin': ('gcc', 'g++', 'ar', 'ranlib'), | 24 - 'i686-pc-cygwin': ('gcc', 'g++', 'ar', 'ranlib'), |
| 25 - } | 25 - } |
| 26 - if host == 'le32-nacl': | 26 - if host == 'le32-nacl': |
| 27 - nacl_sdk = os.environ.get('NACL_SDK_ROOT') | 27 - nacl_sdk = os.environ.get('NACL_SDK_ROOT') |
| 28 - assert nacl_sdk, 'NACL_SDK_ROOT not set' | 28 - assert nacl_sdk, 'NACL_SDK_ROOT not set' |
| 29 - pnacl_bin_dir = os.path.join(nacl_sdk, 'toolchain/linux_pnacl/bin') | 29 - pnacl_bin_dir = os.path.join(nacl_sdk, 'toolchain/linux_pnacl/bin') |
| 30 - glibc_bin_dir = os.path.join(nacl_sdk, 'toolchain/linux_x86_glibc/bin') | |
| 31 - compiler.update({ | 30 - compiler.update({ |
| 32 - 'le32-nacl': (os.path.join(pnacl_bin_dir, 'pnacl-clang'), | 31 - 'le32-nacl': (os.path.join(pnacl_bin_dir, 'pnacl-clang'), |
| 33 - os.path.join(pnacl_bin_dir, 'pnacl-clang++'), | 32 - os.path.join(pnacl_bin_dir, 'pnacl-clang++'), |
| 34 - os.path.join(pnacl_bin_dir, 'pnacl-ar'), | 33 - os.path.join(pnacl_bin_dir, 'pnacl-ar'), |
| 35 - os.path.join(pnacl_bin_dir, 'pnacl-ranlib')), | 34 - os.path.join(pnacl_bin_dir, 'pnacl-ranlib')), |
| 36 - }) | 35 - }) |
| 37 - return compiler[host] | 36 - return compiler[host] |
| 38 + 'i686-pc-cygwin': ['gcc', 'g++', 'ar', 'ranlib'], | 37 + 'i686-pc-cygwin': ['gcc', 'g++', 'ar', 'ranlib'], |
| 39 + # In practice these don't get used since when naclports builds the | |
| 40 + # pnacl toolchain it explictly sets CC/CXX/etc | |
| 41 + 'le32-nacl': ['pnacl-clang', 'pnacl-clang++', 'pnacl-ar', 'pnacl-ranlib']
, | 38 + 'le32-nacl': ['pnacl-clang', 'pnacl-clang++', 'pnacl-ar', 'pnacl-ranlib']
, |
| 42 + }[host] | 39 + }[host] |
| 43 + | 40 + |
| 44 + # Allow caller to override host toolchain | 41 + # Allow caller to override host toolchain |
| 45 + if 'CC' in os.environ: | 42 + if 'CC' in os.environ: |
| 46 + rtn[0] = os.environ['CC'] | 43 + rtn[0] = os.environ['CC'] |
| 47 + if 'CXX' in os.environ: | 44 + if 'CXX' in os.environ: |
| 48 + rtn[1] = os.environ['CXX'] | 45 + rtn[1] = os.environ['CXX'] |
| 49 + if 'AR' in os.environ: | 46 + if 'AR' in os.environ: |
| 50 + rtn[2] = os.environ['AR'] | 47 + rtn[2] = os.environ['AR'] |
| 51 + if 'RANLIB' in os.environ: | 48 + if 'RANLIB' in os.environ: |
| 52 + rtn[3] = os.environ['RANLIB'] | 49 + rtn[3] = os.environ['RANLIB'] |
| 53 + | 50 + |
| 54 + return rtn | 51 + return rtn |
| 55 | 52 |
| 56 | 53 def AflFuzzCompilers(afl_fuzz_dir): |
| 57 def GSDJoin(*args): | 54 """Returns the AFL (clang) compiler executables, assuming afl_fuzz_dir |
| 58 @@ -532,10 +535,12 @@ def HostTools(host, options): | 55 @@ -677,10 +679,12 @@ def HostTools(host, options): |
| 59 # too many arguments for format. | 56 # [-Werror,-Wshift-negative-value] |
| 60 binutils_do_werror = not TripleIsWindows(host) | 57 binutils_do_werror = False |
| 61 extra_gold_deps = [] | 58 extra_gold_deps = [] |
| 62 + install_step = 'install-strip' | 59 + install_step = 'install-strip' |
| 63 if host == 'le32-nacl': | 60 if host == 'le32-nacl': |
| 64 # TODO(bradnelson): Fix warnings so this can go away. | 61 # TODO(bradnelson): Fix warnings so this can go away. |
| 65 binutils_do_werror = False | 62 binutils_do_werror = False |
| 66 extra_gold_deps = [H('llvm')] | 63 extra_gold_deps = [H('llvm')] |
| 67 + install_step = 'install' | 64 + install_step = 'install' |
| 68 | 65 |
| 69 # Binutils still has some warnings when building with clang | 66 # The binutils git checkout includes all the directories in the |
| 70 if not options.gcc: | 67 # upstream binutils-gdb.git repository, but some of these |
| 71 @@ -574,7 +579,7 @@ def HostTools(host, options): | 68 @@ -730,7 +734,7 @@ def HostTools(host, options): |
| 72 '--without-gas' | 69 '--without-gas' |
| 73 ]), | 70 ])] + DummyDirCommands(binutils_dummy_dirs) + [ |
| 74 command.Command(MakeCommand(host)), | 71 command.Command(MakeCommand(host)), |
| 75 - command.Command(MAKE_DESTDIR_CMD + ['install-strip'])] + | 72 - command.Command(MAKE_DESTDIR_CMD + ['install-strip'])] + |
| 76 + command.Command(MAKE_DESTDIR_CMD + [install_step])] + | 73 + command.Command(MAKE_DESTDIR_CMD + [install_step])] + |
| 77 [command.RemoveDirectory(os.path.join('%(output)s', dir)) | 74 [command.RemoveDirectory(os.path.join('%(output)s', dir)) |
| 78 for dir in ('lib', 'lib32')] + | 75 for dir in ('lib', 'lib32')] + |
| 79 # Since it has dual use, just create links for both sets of names | 76 # Since it has dual use, just create links for both sets of names |
| 80 @@ -624,7 +629,8 @@ def HostTools(host, options): | 77 @@ -1033,6 +1037,9 @@ def HostToolsDirectToNacl(host, options): |
| 81 # TODO(jfb) Windows currently uses MinGW's GCC 4.8.1 which generates warnings | 78 binutils_flags, binutils_inputs, binutils_deps = ConfigureBinutilsCommon( |
| 82 # on upstream LLVM code. Turn on -Werror once these are fixed. | 79 host, options, False) |
| 83 # The same applies for the default GCC on current Ubuntu. | 80 redirect_inputs.update(binutils_inputs) |
| 84 - llvm_do_werror = not (TripleIsWindows(host) or options.gcc) | 81 + install_step = 'install-strip' |
| 85 + llvm_do_werror = not (TripleIsWindows(host) or options.gcc or | 82 + if host == 'le32-nacl': |
| 86 + host == 'le32-nacl') | 83 + install_step = 'install' |
| 87 | 84 tools.update({ |
| 88 llvm_cmake = { | 85 H('binutils_x86'): { |
| 89 H('llvm'): { | 86 'type': 'build', |
| 87 @@ -1049,7 +1056,7 @@ def HostToolsDirectToNacl(host, options): |
| 88 '--enable-targets=x86_64-nacl,i686-nacl', |
| 89 '--disable-werror']), |
| 90 command.Command(MakeCommand(host)), |
| 91 - command.Command(MAKE_DESTDIR_CMD + ['install-strip'])] + |
| 92 + command.Command(MAKE_DESTDIR_CMD + [install_step])] + |
| 93 # Remove the share dir from this binutils build and leave the one |
| 94 # from the newer version used for bitcode linking. Always remove |
| 95 # the lib dirs, which have unneeded host libs. |
| 96 @@ -1311,7 +1318,7 @@ def main(): |
| 97 packages.update(HostTools(host, args)) |
| 98 if not args.pnacl_in_pnacl: |
| 99 packages.update(HostLibs(host, args)) |
| 100 - packages.update(HostToolsDirectToNacl(host, args)) |
| 101 + packages.update(HostToolsDirectToNacl(host, args)) |
| 102 if not args.pnacl_in_pnacl: |
| 103 packages.update(TargetLibCompiler(pynacl.platform.PlatformTriple(), args)) |
| 104 # Don't build the target libs on Windows because of pathname issues. |
| OLD | NEW |