| OLD | NEW |
| 1 # -*- python -*- | 1 # -*- python -*- |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 Import('env') | 6 Import('env') |
| 7 import os | |
| 8 | 7 |
| 9 # This library is part of the pnacl x86-64 toolchain only, and is used | 8 # This library contains PNaCl ABI shims which convert between the |
| 10 # to match the pnacl ABI to the IRT ABI. It was necessitated by problems | 9 # x86-64 calling conventions used by the IRT library (which uses gcc's |
| 11 # in passing structures by value on x86-64. | 10 # ABI) and those used by the PNaCl translator. It was necessitated by |
| 12 if not env.Bit('bitcode') or not env.Bit('target_x86_64'): | 11 # problems in passing structures by value on x86-64. |
| 12 # |
| 13 # We build the library on all architectures so that we can use the |
| 14 # same entry point symbol everywhere. On architectures other than |
| 15 # x86-64, the library currently does no calling conventions |
| 16 # conversion. |
| 17 if not env.Bit('bitcode'): |
| 13 Return() | 18 Return() |
| 14 | 19 |
| 15 # The library must be compiled with nacl-gcc. | 20 # The library must be compiled with nacl-gcc. |
| 16 # Clear out the pnacl_generate_pexe bit to allow building this as a | 21 # Clear out the pnacl_generate_pexe bit to allow building this as a |
| 17 # library dependency (much like the IRT). | 22 # library dependency (much like the IRT). |
| 18 nacl_gcc_env = env.Clone() | 23 native_env = env.Clone() |
| 19 nacl_gcc_env.ClearBits('pnacl_generate_pexe') | 24 native_env.ClearBits('pnacl_generate_pexe') |
| 20 nacl_gcc_env = nacl_gcc_env.PNaClGetNNaClEnv() | 25 if env.Bit('target_arm'): |
| 26 native_env.PNaClForceNative() |
| 27 else: |
| 28 native_env = native_env.PNaClGetNNaClEnv() |
| 21 | 29 |
| 22 pnacl_irt_shim = nacl_gcc_env.ComponentLibrary('pnacl_irt_shim', [ | 30 pnacl_irt_shim = native_env.ComponentLibrary('pnacl_irt_shim', [ |
| 23 'pnacl_shim.c', | 31 'pnacl_shim.c', |
| 24 'shim_entry.c', | 32 'shim_entry.c', |
| 25 'shim_ppapi.c', | 33 'shim_ppapi.c', |
| 26 ]) | 34 ]) |
| 27 | 35 |
| 28 # However, the library is part of the pnacl sdk (use original env). | 36 # However, the library is part of the pnacl sdk (use original env). |
| 29 env.AddLibraryToSdk(pnacl_irt_shim) | 37 env.AddLibraryToSdk(pnacl_irt_shim) |
| 30 | 38 |
| 31 env.AddObjectToSdk(['libpnacl_irt_shim.a']) | 39 env.AddObjectToSdk(['libpnacl_irt_shim.a']) |
| OLD | NEW |