OLD | NEW |
1 #! -*- python -*- | 1 #! -*- python -*- |
2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2012 The Native Client 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 atexit | 6 import atexit |
7 import os | 7 import os |
8 import platform | 8 import platform |
9 import re | 9 import re |
10 import subprocess | 10 import subprocess |
(...skipping 2718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2729 # These are settings for in-tree, non-browser tests to use. | 2729 # These are settings for in-tree, non-browser tests to use. |
2730 # They use libraries that circumvent the IRT-based implementations | 2730 # They use libraries that circumvent the IRT-based implementations |
2731 # in the public libraries. | 2731 # in the public libraries. |
2732 NONIRT_LIBS = ['nacl_sys_private'], | 2732 NONIRT_LIBS = ['nacl_sys_private'], |
2733 PTHREAD_LIBS = ['pthread_private'], | 2733 PTHREAD_LIBS = ['pthread_private'], |
2734 DYNCODE_LIBS = ['nacl_dyncode_private'], | 2734 DYNCODE_LIBS = ['nacl_dyncode_private'], |
2735 EXCEPTION_LIBS = ['nacl_exception_private'], | 2735 EXCEPTION_LIBS = ['nacl_exception_private'], |
2736 LIST_MAPPINGS_LIBS = ['nacl_list_mappings_private'], | 2736 LIST_MAPPINGS_LIBS = ['nacl_list_mappings_private'], |
2737 ) | 2737 ) |
2738 | 2738 |
| 2739 # TODO(mcgrathr): Remove this after the new binutils has settled. |
2739 def IsNewLinker(env): | 2740 def IsNewLinker(env): |
2740 """Return True if using a new-style linker with the new-style layout. | 2741 """Return True if using a new-style linker with the new-style layout. |
2741 That means the linker supports the -Trodata-segment switch.""" | 2742 That means the linker supports the -Trodata-segment switch.""" |
2742 return env.Bit('target_arm') or env.Bit('bitcode') | 2743 return True |
2743 | 2744 |
2744 nacl_env.AddMethod(IsNewLinker) | 2745 nacl_env.AddMethod(IsNewLinker) |
2745 | 2746 |
2746 def UsesAbiNote(env): | 2747 def UsesAbiNote(env): |
2747 """Return True if using a new-style GCC with .note.NaCl.ABI.* notes. | 2748 """Return True if using a new-style GCC with .note.NaCl.ABI.* notes. |
2748 This means there will always be an RODATA segment, even if just for the note.""" | 2749 This means there will always be an RODATA segment, even if just for the note.""" |
2749 return env.Bit('target_arm') and not env.Bit('bitcode') | 2750 return env.Bit('target_arm') and not env.Bit('bitcode') |
2750 | 2751 |
2751 nacl_env.AddMethod(UsesAbiNote) | 2752 nacl_env.AddMethod(UsesAbiNote) |
2752 | 2753 |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2998 | 2999 |
2999 nacl_env.Replace(TESTRUNNER_LIBS=['testrunner']) | 3000 nacl_env.Replace(TESTRUNNER_LIBS=['testrunner']) |
3000 # TODO(mseaborn): Drop this once chrome side has inlined this. | 3001 # TODO(mseaborn): Drop this once chrome side has inlined this. |
3001 nacl_env.Replace(PPAPI_LIBS=['ppapi']) | 3002 nacl_env.Replace(PPAPI_LIBS=['ppapi']) |
3002 | 3003 |
3003 # TODO(mseaborn): Make nacl-glibc-based static linking work with just | 3004 # TODO(mseaborn): Make nacl-glibc-based static linking work with just |
3004 # "-static", without specifying a linker script. | 3005 # "-static", without specifying a linker script. |
3005 # See http://code.google.com/p/nativeclient/issues/detail?id=1298 | 3006 # See http://code.google.com/p/nativeclient/issues/detail?id=1298 |
3006 def GetLinkerScriptBaseName(env): | 3007 def GetLinkerScriptBaseName(env): |
3007 if env.Bit('build_x86_64'): | 3008 if env.Bit('build_x86_64'): |
3008 return 'elf64_nacl' | 3009 return 'elf_x86_64_nacl' |
3009 else: | 3010 else: |
3010 return 'elf_nacl' | 3011 return 'elf_i386_nacl' |
3011 | 3012 |
3012 if (nacl_env.Bit('nacl_glibc') and | 3013 if (nacl_env.Bit('nacl_glibc') and |
3013 nacl_env.Bit('nacl_static_link')): | 3014 nacl_env.Bit('nacl_static_link')): |
3014 if nacl_env.IsNewLinker(): | 3015 if nacl_env.IsNewLinker(): |
3015 nacl_env.Append(LINKFLAGS=['-static']) | 3016 nacl_env.Append(LINKFLAGS=['-static']) |
3016 else: | 3017 else: |
3017 # The "-lc" is necessary because libgcc_eh depends on libc but for | 3018 # The "-lc" is necessary because libgcc_eh depends on libc but for |
3018 # some reason nacl-gcc is not linking with "--start-group/--end-group". | 3019 # some reason nacl-gcc is not linking with "--start-group/--end-group". |
3019 nacl_env.Append(LINKFLAGS=[ | 3020 nacl_env.Append(LINKFLAGS=[ |
3020 '-static', | 3021 '-static', |
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3709 nacl_env.ValidateSdk() | 3710 nacl_env.ValidateSdk() |
3710 | 3711 |
3711 if BROKEN_TEST_COUNT > 0: | 3712 if BROKEN_TEST_COUNT > 0: |
3712 msg = "There are %d broken tests." % BROKEN_TEST_COUNT | 3713 msg = "There are %d broken tests." % BROKEN_TEST_COUNT |
3713 if GetOption('brief_comstr'): | 3714 if GetOption('brief_comstr'): |
3714 msg += " Add --verbose to the command line for more information." | 3715 msg += " Add --verbose to the command line for more information." |
3715 print msg | 3716 print msg |
3716 | 3717 |
3717 # separate warnings from actual build output | 3718 # separate warnings from actual build output |
3718 Banner('B U I L D - O U T P U T:') | 3719 Banner('B U I L D - O U T P U T:') |
OLD | NEW |