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

Side by Side Diff: SConstruct

Issue 22859030: Remove wrapper-link-and-translate from PNaCl and pnacl_shared_newlib from SCons. (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: one more reference Created 7 years, 4 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pnacl/build.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 297
298 BitFromArgument(env, 'disable_flaky_tests', default=False, 298 BitFromArgument(env, 'disable_flaky_tests', default=False,
299 desc='Do not run potentially flaky tests - used on Chrome bots') 299 desc='Do not run potentially flaky tests - used on Chrome bots')
300 300
301 BitFromArgument(env, 'use_sandboxed_translator', default=False, 301 BitFromArgument(env, 'use_sandboxed_translator', default=False,
302 desc='use pnacl sandboxed translator for linking (not available for arm)') 302 desc='use pnacl sandboxed translator for linking (not available for arm)')
303 303
304 BitFromArgument(env, 'pnacl_generate_pexe', default=env.Bit('bitcode'), 304 BitFromArgument(env, 'pnacl_generate_pexe', default=env.Bit('bitcode'),
305 desc='use pnacl to generate pexes and translate in a separate step') 305 desc='use pnacl to generate pexes and translate in a separate step')
306 306
307 BitFromArgument(env, 'pnacl_shared_newlib', default=False,
308 desc='build newlib (and other libs) shared in PNaCl')
309
310 BitFromArgument(env, 'translate_in_build_step', default=True, 307 BitFromArgument(env, 'translate_in_build_step', default=True,
311 desc='Run translation during build phase (e.g. if do_not_run_tests=1)') 308 desc='Run translation during build phase (e.g. if do_not_run_tests=1)')
312 309
313 BitFromArgument(env, 'browser_headless', default=False, 310 BitFromArgument(env, 'browser_headless', default=False,
314 desc='Where possible, set up a dummy display to run the browser on ' 311 desc='Where possible, set up a dummy display to run the browser on '
315 'when running browser tests. On Linux, this runs the browser through ' 312 'when running browser tests. On Linux, this runs the browser through '
316 'xvfb-run. This Scons does not need to be run with an X11 display ' 313 'xvfb-run. This Scons does not need to be run with an X11 display '
317 'and we do not open a browser window on the user\'s desktop. ' 314 'and we do not open a browser window on the user\'s desktop. '
318 'Unfortunately there is no equivalent on Mac OS X.') 315 'Unfortunately there is no equivalent on Mac OS X.')
319 316
(...skipping 2597 matching lines...) Expand 10 before | Expand all | Expand 10 after
2917 nacl_env['INCLUDE_DIR'] = '${TARGET_ROOT}/include' 2914 nacl_env['INCLUDE_DIR'] = '${TARGET_ROOT}/include'
2918 # Remove the default $LIB_DIR element so that we prepend it without duplication. 2915 # Remove the default $LIB_DIR element so that we prepend it without duplication.
2919 # Using PrependUnique alone would let it stay last, where we want it first. 2916 # Using PrependUnique alone would let it stay last, where we want it first.
2920 nacl_env.FilterOut(LIBPATH=['${LIB_DIR}']) 2917 nacl_env.FilterOut(LIBPATH=['${LIB_DIR}'])
2921 nacl_env.PrependUnique( 2918 nacl_env.PrependUnique(
2922 CPPPATH = ['${INCLUDE_DIR}'], 2919 CPPPATH = ['${INCLUDE_DIR}'],
2923 LIBPATH = ['${LIB_DIR}'], 2920 LIBPATH = ['${LIB_DIR}'],
2924 ) 2921 )
2925 2922
2926 if nacl_env.Bit('bitcode'): 2923 if nacl_env.Bit('bitcode'):
2927 # This helps with NaClSdkLibrary() where some libraries share object files
2928 # between static and shared libs. Without it scons will complain.
2929 # NOTE: this is a standard scons mechanism
2930 nacl_env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1
2931 # passing -O when linking requests LTO, which does additional global 2924 # passing -O when linking requests LTO, which does additional global
2932 # optimizations at link time 2925 # optimizations at link time
2933 nacl_env.Append(LINKFLAGS=['-O3']) 2926 nacl_env.Append(LINKFLAGS=['-O3'])
2934 if not nacl_env.Bit('nacl_glibc') and not nacl_env.Bit('pnacl_shared_newlib'): 2927 if not nacl_env.Bit('nacl_glibc'):
2935 nacl_env.Append(LINKFLAGS=['-static']) 2928 nacl_env.Append(LINKFLAGS=['-static'])
2936 2929
2937 if nacl_env.Bit('translate_fast'): 2930 if nacl_env.Bit('translate_fast'):
2938 nacl_env.Append(LINKFLAGS=['-Xlinker', '-translate-fast']) 2931 nacl_env.Append(LINKFLAGS=['-Xlinker', '-translate-fast'])
2939 nacl_env.Append(TRANSLATEFLAGS=['-translate-fast']) 2932 nacl_env.Append(TRANSLATEFLAGS=['-translate-fast'])
2940 2933
2941 # With pnacl's clang base/ code uses the "override" keyword. 2934 # With pnacl's clang base/ code uses the "override" keyword.
2942 nacl_env.Append(CXXFLAGS=['-Wno-c++11-extensions']) 2935 nacl_env.Append(CXXFLAGS=['-Wno-c++11-extensions'])
2943 # Allow extraneous semicolons. (Until these are removed.) 2936 # Allow extraneous semicolons. (Until these are removed.)
2944 # http://code.google.com/p/nativeclient/issues/detail?id=2861 2937 # http://code.google.com/p/nativeclient/issues/detail?id=2861
(...skipping 22 matching lines...) Expand all
2967 2960
2968 # Map certain flag bits to suffices on the build output. This needs to 2961 # Map certain flag bits to suffices on the build output. This needs to
2969 # happen pretty early, because it affects any concretized directory names. 2962 # happen pretty early, because it affects any concretized directory names.
2970 target_variant_map = [ 2963 target_variant_map = [
2971 ('bitcode', 'pnacl'), 2964 ('bitcode', 'pnacl'),
2972 ('translate_fast', 'fast'), 2965 ('translate_fast', 'fast'),
2973 ('nacl_pic', 'pic'), 2966 ('nacl_pic', 'pic'),
2974 ('use_sandboxed_translator', 'sbtc'), 2967 ('use_sandboxed_translator', 'sbtc'),
2975 ('nacl_glibc', 'glibc'), 2968 ('nacl_glibc', 'glibc'),
2976 ('pnacl_generate_pexe', 'pexe'), 2969 ('pnacl_generate_pexe', 'pexe'),
2977 ('pnacl_shared_newlib', 'shared'),
2978 ] 2970 ]
2979 for variant_bit, variant_suffix in target_variant_map: 2971 for variant_bit, variant_suffix in target_variant_map:
2980 if nacl_env.Bit(variant_bit): 2972 if nacl_env.Bit(variant_bit):
2981 nacl_env['TARGET_VARIANT'] += '-' + variant_suffix 2973 nacl_env['TARGET_VARIANT'] += '-' + variant_suffix
2982 2974
2983 if nacl_env.Bit('bitcode'): 2975 if nacl_env.Bit('bitcode'):
2984 nacl_env['TARGET_VARIANT'] += '-clang' 2976 nacl_env['TARGET_VARIANT'] += '-clang'
2985 2977
2986 nacl_env.Replace(TESTRUNNER_LIBS=['testrunner']) 2978 nacl_env.Replace(TESTRUNNER_LIBS=['testrunner'])
2987 # TODO(mseaborn): Drop this once chrome side has inlined this. 2979 # TODO(mseaborn): Drop this once chrome side has inlined this.
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
3217 3209
3218 def NaClSharedLibrary(env, lib_name, *args, **kwargs): 3210 def NaClSharedLibrary(env, lib_name, *args, **kwargs):
3219 env_shared = env.Clone(COMPONENT_STATIC=False) 3211 env_shared = env.Clone(COMPONENT_STATIC=False)
3220 soname = SCons.Util.adjustixes(lib_name, 'lib', '.so') 3212 soname = SCons.Util.adjustixes(lib_name, 'lib', '.so')
3221 env_shared.AppendUnique(SHLINKFLAGS=['-Wl,-soname,%s' % (soname)]) 3213 env_shared.AppendUnique(SHLINKFLAGS=['-Wl,-soname,%s' % (soname)])
3222 return env_shared.ComponentLibrary(lib_name, *args, **kwargs) 3214 return env_shared.ComponentLibrary(lib_name, *args, **kwargs)
3223 3215
3224 nacl_env.AddMethod(NaClSharedLibrary) 3216 nacl_env.AddMethod(NaClSharedLibrary)
3225 3217
3226 def NaClSdkLibrary(env, lib_name, *args, **kwargs): 3218 def NaClSdkLibrary(env, lib_name, *args, **kwargs):
3227 gen_shared = (not env.Bit('nacl_disable_shared') or
3228 env.Bit('pnacl_shared_newlib'))
3229 if 'no_shared_lib' in kwargs:
3230 if kwargs['no_shared_lib']:
3231 gen_shared = False
3232 del kwargs['no_shared_lib']
3233 n = [env.ComponentLibrary(lib_name, *args, **kwargs)] 3219 n = [env.ComponentLibrary(lib_name, *args, **kwargs)]
3234 if gen_shared: 3220 if not env.Bit('nacl_disable_shared'):
3235 n.append(env.NaClSharedLibrary(lib_name, *args, **kwargs)) 3221 n.append(env.NaClSharedLibrary(lib_name, *args, **kwargs))
3236 return n 3222 return n
3237 3223
3238 nacl_env.AddMethod(NaClSdkLibrary) 3224 nacl_env.AddMethod(NaClSdkLibrary)
3239 3225
3240 3226
3241 # Special environment for untrusted test binaries that use raw syscalls 3227 # Special environment for untrusted test binaries that use raw syscalls
3242 def RawSyscallObjects(env, sources): 3228 def RawSyscallObjects(env, sources):
3243 raw_syscall_env = env.Clone() 3229 raw_syscall_env = env.Clone()
3244 raw_syscall_env.Append( 3230 raw_syscall_env.Append(
(...skipping 16 matching lines...) Expand all
3261 nacl_env.AddMethod(RawSyscallObjects) 3247 nacl_env.AddMethod(RawSyscallObjects)
3262 3248
3263 3249
3264 # The IRT-building environment was cloned from nacl_env, but it should 3250 # The IRT-building environment was cloned from nacl_env, but it should
3265 # ignore the --nacl_glibc, nacl_pic=1 and bitcode=1 switches. 3251 # ignore the --nacl_glibc, nacl_pic=1 and bitcode=1 switches.
3266 # We have to reinstantiate the naclsdk.py magic after clearing those flags, 3252 # We have to reinstantiate the naclsdk.py magic after clearing those flags,
3267 # so it regenerates the tool paths right. 3253 # so it regenerates the tool paths right.
3268 # TODO(mcgrathr,bradnelson): could get cleaner if naclsdk.py got folded back in. 3254 # TODO(mcgrathr,bradnelson): could get cleaner if naclsdk.py got folded back in.
3269 nacl_irt_env.ClearBits('nacl_glibc') 3255 nacl_irt_env.ClearBits('nacl_glibc')
3270 nacl_irt_env.ClearBits('nacl_pic') 3256 nacl_irt_env.ClearBits('nacl_pic')
3271 nacl_irt_env.ClearBits('pnacl_shared_newlib')
3272 # We build the IRT using the nnacl TC even when the pnacl TC is used otherwise. 3257 # We build the IRT using the nnacl TC even when the pnacl TC is used otherwise.
3273 if nacl_irt_env.Bit('target_mips32') or nacl_irt_env.Bit('target_x86_64'): 3258 if nacl_irt_env.Bit('target_mips32') or nacl_irt_env.Bit('target_x86_64'):
3274 nacl_irt_env.SetBits('bitcode') 3259 nacl_irt_env.SetBits('bitcode')
3275 else: 3260 else:
3276 nacl_irt_env.ClearBits('bitcode') 3261 nacl_irt_env.ClearBits('bitcode')
3277 nacl_irt_env.ClearBits('pnacl_generate_pexe') 3262 nacl_irt_env.ClearBits('pnacl_generate_pexe')
3278 nacl_irt_env.ClearBits('use_sandboxed_translator') 3263 nacl_irt_env.ClearBits('use_sandboxed_translator')
3279 nacl_irt_env.Tool('naclsdk') 3264 nacl_irt_env.Tool('naclsdk')
3280 # These are unfortunately clobbered by running Tool, which 3265 # These are unfortunately clobbered by running Tool, which
3281 # we needed to do to get the destination directory reset. 3266 # we needed to do to get the destination directory reset.
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
3699 nacl_env.ValidateSdk() 3684 nacl_env.ValidateSdk()
3700 3685
3701 if BROKEN_TEST_COUNT > 0: 3686 if BROKEN_TEST_COUNT > 0:
3702 msg = "There are %d broken tests." % BROKEN_TEST_COUNT 3687 msg = "There are %d broken tests." % BROKEN_TEST_COUNT
3703 if GetOption('brief_comstr'): 3688 if GetOption('brief_comstr'):
3704 msg += " Add --verbose to the command line for more information." 3689 msg += " Add --verbose to the command line for more information."
3705 print msg 3690 print msg
3706 3691
3707 # separate warnings from actual build output 3692 # separate warnings from actual build output
3708 Banner('B U I L D - O U T P U T:') 3693 Banner('B U I L D - O U T P U T:')
OLDNEW
« no previous file with comments | « no previous file | pnacl/build.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698