OLD | NEW |
1 # -*- python -*- | 1 # -*- python -*- |
2 # Copyright (c) 2011 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2011 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 glob | 7 import glob |
8 import os | 8 import os |
9 import platform | 9 import platform |
10 import stat | 10 import stat |
(...skipping 1892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1903 def CheckPlatformPreconditions(): | 1903 def CheckPlatformPreconditions(): |
1904 "Check and fail fast if platform-specific preconditions are unmet." | 1904 "Check and fail fast if platform-specific preconditions are unmet." |
1905 | 1905 |
1906 if base_env.Bit('target_arm') and (base_env.Bit('build_x86_32') or | 1906 if base_env.Bit('target_arm') and (base_env.Bit('build_x86_32') or |
1907 base_env.Bit('build_x86_64')): | 1907 base_env.Bit('build_x86_64')): |
1908 assert os.getenv('NACL_SDK_CC'), ( | 1908 assert os.getenv('NACL_SDK_CC'), ( |
1909 "NACL_SDK_CC undefined. " | 1909 "NACL_SDK_CC undefined. " |
1910 "Source tools/llvm/setup_arm_untrusted_toolchain.sh.") | 1910 "Source tools/llvm/setup_arm_untrusted_toolchain.sh.") |
1911 | 1911 |
1912 # ---------------------------------------------------------- | 1912 # ---------------------------------------------------------- |
| 1913 pre_base_env.Append( |
| 1914 CPPDEFINES = [ |
| 1915 ['NACL_BLOCK_SHIFT', '5'], |
| 1916 ['NACL_BLOCK_SIZE', '32'], |
| 1917 ['NACL_BUILD_ARCH', '${BUILD_ARCHITECTURE}' ], |
| 1918 ['NACL_BUILD_SUBARCH', '${BUILD_SUBARCH}' ], |
| 1919 ], |
| 1920 ) |
| 1921 |
1913 base_env = pre_base_env.Clone() | 1922 base_env = pre_base_env.Clone() |
1914 base_env.Append( | 1923 base_env.Append( |
1915 BUILD_SUBTYPE = '', | 1924 BUILD_SUBTYPE = '', |
1916 CPPDEFINES = [ | 1925 CPPDEFINES = [ |
1917 ['NACL_BLOCK_SHIFT', '5'], | |
1918 ['NACL_BLOCK_SIZE', '32'], | |
1919 ['NACL_BUILD_ARCH', '${BUILD_ARCHITECTURE}' ], | |
1920 ['NACL_BUILD_SUBARCH', '${BUILD_SUBARCH}' ], | |
1921 ['NACL_TARGET_ARCH', '${TARGET_ARCHITECTURE}' ], | 1926 ['NACL_TARGET_ARCH', '${TARGET_ARCHITECTURE}' ], |
1922 ['NACL_TARGET_SUBARCH', '${TARGET_SUBARCH}' ], | 1927 ['NACL_TARGET_SUBARCH', '${TARGET_SUBARCH}' ], |
1923 ], | 1928 ], |
1924 CPPPATH = ['${SOURCE_ROOT}'], | 1929 CPPPATH = ['${SOURCE_ROOT}'], |
1925 | 1930 |
1926 EXTRA_CFLAGS = [], | 1931 EXTRA_CFLAGS = [], |
1927 EXTRA_CCFLAGS = [], | 1932 EXTRA_CCFLAGS = [], |
1928 EXTRA_CXXFLAGS = [], | 1933 EXTRA_CXXFLAGS = [], |
1929 EXTRA_LIBS = [], | 1934 EXTRA_LIBS = [], |
1930 CFLAGS = ['${EXTRA_CFLAGS}'], | 1935 CFLAGS = ['${EXTRA_CFLAGS}'], |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2353 # Do this before the site_scons/site_tools/naclsdk.py stuff to pass it along. | 2358 # Do this before the site_scons/site_tools/naclsdk.py stuff to pass it along. |
2354 pre_base_env.Append( | 2359 pre_base_env.Append( |
2355 PNACL_BCLDFLAGS = ARGUMENTS.get('pnacl_bcldflags', '').split(':')) | 2360 PNACL_BCLDFLAGS = ARGUMENTS.get('pnacl_bcldflags', '').split(':')) |
2356 | 2361 |
2357 # ---------------------------------------------------------- | 2362 # ---------------------------------------------------------- |
2358 # The nacl_env is used to build native_client modules | 2363 # The nacl_env is used to build native_client modules |
2359 # using a special tool chain which produces platform | 2364 # using a special tool chain which produces platform |
2360 # independent binaries | 2365 # independent binaries |
2361 # NOTE: this loads stuff from: site_scons/site_tools/naclsdk.py | 2366 # NOTE: this loads stuff from: site_scons/site_tools/naclsdk.py |
2362 # ---------------------------------------------------------- | 2367 # ---------------------------------------------------------- |
2363 nacl_env = pre_base_env.Clone( | 2368 |
| 2369 nacl_common_env = pre_base_env.Clone( |
2364 tools = ['naclsdk'], | 2370 tools = ['naclsdk'], |
2365 BUILD_TYPE = 'nacl', | |
2366 BUILD_TYPE_DESCRIPTION = 'NaCl module build', | |
2367 NACL_BUILD_FAMILY = 'UNTRUSTED', | 2371 NACL_BUILD_FAMILY = 'UNTRUSTED', |
2368 | 2372 |
| 2373 ARFLAGS = 'rc', |
| 2374 |
| 2375 # ${SOURCE_ROOT} for #include <ppapi/...> |
| 2376 # ${SOURCE_ROOT}/gpu for #include <GLES2/...> |
| 2377 CPPPATH = ['${SOURCE_ROOT}', '${SOURCE_ROOT}/gpu'], |
| 2378 |
2369 EXTRA_CFLAGS = [], | 2379 EXTRA_CFLAGS = [], |
2370 EXTRA_CCFLAGS = ARGUMENTS.get('nacl_ccflags', '').split(':'), | 2380 EXTRA_CCFLAGS = ARGUMENTS.get('nacl_ccflags', '').split(':'), |
2371 EXTRA_CXXFLAGS = [], | 2381 EXTRA_CXXFLAGS = [], |
2372 EXTRA_LIBS = [], | 2382 EXTRA_LIBS = [], |
2373 EXTRA_LINKFLAGS = ARGUMENTS.get('nacl_linkflags', '').split(':'), | 2383 EXTRA_LINKFLAGS = ARGUMENTS.get('nacl_linkflags', '').split(':'), |
2374 | 2384 |
2375 # This is the address at which a user executable is expected to | |
2376 # place its data segment in order to be compatible with the | |
2377 # integrated runtime (IRT) library. | |
2378 IRT_DATA_REGION_START = '0x10000000', | |
2379 # Load addresses of the IRT's code and data segments. | |
2380 IRT_BLOB_CODE_START = '0x08000000', | |
2381 IRT_BLOB_DATA_START = '0x18000000', | |
2382 | |
2383 # always optimize binaries | 2385 # always optimize binaries |
2384 # Command line option nacl_ccflags=... add additional option to nacl build | 2386 # Command line option nacl_ccflags=... add additional option to nacl build |
2385 CCFLAGS = ['-O2', | 2387 CCFLAGS = ['-O2', |
2386 '-fomit-frame-pointer', | 2388 '-fomit-frame-pointer', |
2387 '-Wall', | 2389 '-Wall', |
2388 '-fdiagnostics-show-option', | 2390 '-fdiagnostics-show-option', |
2389 '-pedantic', | 2391 '-pedantic', |
2390 ] + | 2392 ] + |
2391 werror_flags + | 2393 werror_flags + |
2392 ['${EXTRA_CCFLAGS}'] , | 2394 ['${EXTRA_CCFLAGS}'] , |
2393 CPPPATH = ['$SOURCE_ROOT'], | 2395 |
2394 CFLAGS = ['-std=gnu99', | 2396 CFLAGS = ['-std=gnu99', |
2395 ] + | 2397 ] + |
2396 ['${EXTRA_CFLAGS}'], | 2398 ['${EXTRA_CFLAGS}'], |
2397 CXXFLAGS = ['-std=gnu++98', | 2399 CXXFLAGS = ['-std=gnu++98', |
2398 '-Wno-long-long', | 2400 '-Wno-long-long', |
2399 ] + | 2401 ] + |
2400 ['${EXTRA_CXXFLAGS}'], | 2402 ['${EXTRA_CXXFLAGS}'], |
| 2403 |
| 2404 # This is the address at which a user executable is expected to |
| 2405 # place its data segment in order to be compatible with the |
| 2406 # integrated runtime (IRT) library. |
| 2407 IRT_DATA_REGION_START = '0x10000000', |
| 2408 # Load addresses of the IRT's code and data segments. |
| 2409 IRT_BLOB_CODE_START = '0x08000000', |
| 2410 IRT_BLOB_DATA_START = '0x18000000', |
| 2411 ) |
| 2412 |
| 2413 # These add on to those set in pre_base_env, above. |
| 2414 nacl_common_env.Append( |
| 2415 CPPDEFINES = [ |
| 2416 # This ensures that UINT32_MAX gets defined. |
| 2417 ['__STDC_LIMIT_MACROS', '1'], |
| 2418 # This ensures that PRId64 etc. get defined. |
| 2419 ['__STDC_FORMAT_MACROS', '1'], |
| 2420 # _GNU_SOURCE ensures that strtof() gets declared. |
| 2421 ['_GNU_SOURCE', 1], |
| 2422 # strdup, and other common stuff |
| 2423 ['_BSD_SOURCE', '1'], |
| 2424 ['_POSIX_C_SOURCE', '199506'], |
| 2425 ['_XOPEN_SOURCE', '600'], |
| 2426 |
| 2427 ['DYNAMIC_ANNOTATIONS_ENABLED', '1' ], |
| 2428 ['DYNAMIC_ANNOTATIONS_PREFIX', 'NACL_' ], |
| 2429 ], |
| 2430 ) |
| 2431 |
| 2432 def FixWindowsAssembler(env): |
| 2433 if env.Bit('host_windows'): |
| 2434 # NOTE: This is needed because Windows builds are case-insensitive. |
| 2435 # Without this we use nacl-as, which doesn't handle include directives, etc. |
| 2436 env.Replace(ASCOM='${CCCOM}') |
| 2437 |
| 2438 FixWindowsAssembler(nacl_common_env) |
| 2439 |
| 2440 # TODO(mcgrathr,pdox): llc troubles at final link time if the libraries are |
| 2441 # built with optimization, remove this hack when the compiler is fixed. |
| 2442 # http://code.google.com/p/nativeclient/issues/detail?id=1225 |
| 2443 if nacl_common_env.Bit('bitcode'): |
| 2444 optflags = ['-O0','-O1','-O2','-O3'] |
| 2445 nacl_common_env.FilterOut(CCFLAGS=optflags) |
| 2446 nacl_common_env.FilterOut(LINKFLAGS=optflags) |
| 2447 nacl_common_env.FilterOut(CCFLAGS=optflags) |
| 2448 nacl_common_env.FilterOut(CXXFLAGS=optflags) |
| 2449 # TODO(pdox): Remove this as soon as build_config.h can be |
| 2450 # changed to accept __pnacl__. |
| 2451 # pending http://codereview.chromium.org/6667035/ |
| 2452 nacl_common_env.AddBiasForPNaCl() |
| 2453 |
| 2454 nacl_env = nacl_common_env.Clone( |
| 2455 BUILD_TYPE = 'nacl', |
| 2456 BUILD_TYPE_DESCRIPTION = 'NaCl module build', |
| 2457 |
| 2458 # This magic is copied from scons-2.0.1/engine/SCons/Defaults.py |
| 2459 # where this pattern is used for _LIBDIRFLAGS, which produces -L |
| 2460 # switches. Here we are producing a -Wl,-rpath-link,DIR for each |
| 2461 # element of LIBPATH, i.e. for each -LDIR produced. |
| 2462 RPATH_LINK_FLAGS = '$( ${_concat(RPATHLINKPREFIX, LIBPATH, RPATHLINKSUFFIX,' |
| 2463 '__env__, RDirs, TARGET, SOURCE)} $)', |
| 2464 RPATHLINKPREFIX = '-Wl,-rpath-link,', |
| 2465 RPATHLINKSUFFIX = '', |
| 2466 |
2401 LIBS = [], | 2467 LIBS = [], |
2402 LINKFLAGS = ['${EXTRA_LINKFLAGS}'], | 2468 LINKFLAGS = ['${EXTRA_LINKFLAGS}', '${RPATH_LINK_FLAGS}'], |
2403 CPPDEFINES = [ | |
2404 # _GNU_SOURCE ensures that strtof() gets declared. | |
2405 ['_GNU_SOURCE', 1], | |
2406 # This ensures that PRId64 etc. get defined. | |
2407 ['__STDC_FORMAT_MACROS', '1'], | |
2408 # strdup, and other common stuff | |
2409 ['_BSD_SOURCE', '1'], | |
2410 ['_POSIX_C_SOURCE', '199506'], | |
2411 ['_XOPEN_SOURCE', '600'], | |
2412 ], | |
2413 ) | 2469 ) |
2414 | 2470 |
| 2471 # Look in the local include and lib directories before the toolchain's. |
| 2472 nacl_env['INCLUDE_DIR'] = '${TARGET_ROOT}/include' |
| 2473 # Remove the default $LIB_DIR element so that we prepend it without duplication. |
| 2474 # Using PrependUnique alone would let it stay last, where we want it first. |
| 2475 nacl_env.FilterOut(LIBPATH=['${LIB_DIR}']) |
| 2476 nacl_env.PrependUnique( |
| 2477 CPPPATH = ['${INCLUDE_DIR}'], |
| 2478 LIBPATH = ['${LIB_DIR}'], |
| 2479 ) |
| 2480 |
2415 if not nacl_env.Bit('bitcode'): | 2481 if not nacl_env.Bit('bitcode'): |
2416 if nacl_env.Bit('build_x86_32'): | 2482 if nacl_env.Bit('build_x86_32'): |
2417 nacl_env.Append(CCFLAGS = ['-m32'], LINKFLAGS = '-m32') | 2483 nacl_env.Append(CCFLAGS = ['-m32'], LINKFLAGS = '-m32') |
2418 elif nacl_env.Bit('build_x86_64'): | 2484 elif nacl_env.Bit('build_x86_64'): |
2419 nacl_env.Append(CCFLAGS = ['-m64'], LINKFLAGS = '-m64') | 2485 nacl_env.Append(CCFLAGS = ['-m64'], LINKFLAGS = '-m64') |
2420 | 2486 |
2421 if nacl_env.Bit('bitcode'): | 2487 if nacl_env.Bit('bitcode'): |
2422 # TODO(robertm): remove this ASAP, we currently have llvm issue with c++ | 2488 # TODO(robertm): remove this ASAP, we currently have llvm issue with c++ |
2423 nacl_env.FilterOut(CCFLAGS = ['-Werror']) | 2489 nacl_env.FilterOut(CCFLAGS = ['-Werror']) |
2424 nacl_env.Append(CFLAGS = werror_flags) | 2490 nacl_env.Append(CFLAGS = werror_flags) |
(...skipping 21 matching lines...) Expand all Loading... |
2446 NACL_BUILD_FAMILY = 'UNTRUSTED_IRT', | 2512 NACL_BUILD_FAMILY = 'UNTRUSTED_IRT', |
2447 ) | 2513 ) |
2448 | 2514 |
2449 # http://code.google.com/p/nativeclient/issues/detail?id=1225 | 2515 # http://code.google.com/p/nativeclient/issues/detail?id=1225 |
2450 if nacl_irt_env.Bit('bitcode'): | 2516 if nacl_irt_env.Bit('bitcode'): |
2451 optflags = ['-O0','-O1','-O2','-O3'] | 2517 optflags = ['-O0','-O1','-O2','-O3'] |
2452 nacl_irt_env.FilterOut(LINKFLAGS=optflags) | 2518 nacl_irt_env.FilterOut(LINKFLAGS=optflags) |
2453 nacl_irt_env.FilterOut(CCFLAGS=optflags) | 2519 nacl_irt_env.FilterOut(CCFLAGS=optflags) |
2454 nacl_irt_env.FilterOut(CXXFLAGS=optflags) | 2520 nacl_irt_env.FilterOut(CXXFLAGS=optflags) |
2455 | 2521 |
| 2522 # This needs to happen pretty early, because it affects any concretized |
| 2523 # directory names. |
| 2524 def AddTargetRootSuffix(env, bit_name, suffix): |
| 2525 """Add a suffix to the subdirectory of scons-out that we use. This |
| 2526 usually does not affect correctness, but saves us triggering a |
| 2527 rebuild whenever we add or remove a build option such as --nacl_glibc. |
| 2528 """ |
| 2529 if env.Bit(bit_name): |
| 2530 pathname = '%s-%s' % (env.subst('${TARGET_ROOT}'), suffix) |
| 2531 env.Replace(TARGET_ROOT=pathname) |
| 2532 |
| 2533 AddTargetRootSuffix(nacl_env, 'bitcode', 'pnacl') |
| 2534 AddTargetRootSuffix(nacl_env, 'nacl_pic', 'pic') |
| 2535 AddTargetRootSuffix(nacl_env, 'use_sandboxed_translator', 'sbtc') |
| 2536 AddTargetRootSuffix(nacl_env, 'nacl_glibc', 'glibc') |
2456 | 2537 |
2457 if nacl_env.Bit('irt'): | 2538 if nacl_env.Bit('irt'): |
2458 nacl_env.Replace(PPAPI_LIBS=['ppapi']) | 2539 nacl_env.Replace(PPAPI_LIBS=['ppapi']) |
2459 # Even non-PPAPI nexes need this for IRT-compatible linking. | 2540 # Even non-PPAPI nexes need this for IRT-compatible linking. |
2460 # We don't just make them link with ${PPAPI_LIBS} because in | 2541 # We don't just make them link with ${PPAPI_LIBS} because in |
2461 # the non-IRT case under dynamic linking, that tries to link | 2542 # the non-IRT case under dynamic linking, that tries to link |
2462 # in libppruntime.so with its undefined symbols and fails | 2543 # in libppruntime.so with its undefined symbols and fails |
2463 # for nexes that aren't actually PPAPI users. | 2544 # for nexes that aren't actually PPAPI users. |
2464 nacl_env.Replace(NON_PPAPI_BROWSER_LIBS=nacl_env['PPAPI_LIBS']) | 2545 nacl_env.Replace(NON_PPAPI_BROWSER_LIBS=nacl_env['PPAPI_LIBS']) |
2465 else: | 2546 else: |
(...skipping 16 matching lines...) Expand all Loading... |
2482 if (nacl_env.Bit('nacl_glibc') and | 2563 if (nacl_env.Bit('nacl_glibc') and |
2483 nacl_env.Bit('nacl_static_link') and | 2564 nacl_env.Bit('nacl_static_link') and |
2484 not nacl_env.Bit('bitcode')): | 2565 not nacl_env.Bit('bitcode')): |
2485 # The "-lc" is necessary because libgcc_eh depends on libc but for | 2566 # The "-lc" is necessary because libgcc_eh depends on libc but for |
2486 # some reason nacl-gcc is not linking with "--start-group/--end-group". | 2567 # some reason nacl-gcc is not linking with "--start-group/--end-group". |
2487 nacl_env.Append(LINKFLAGS=[ | 2568 nacl_env.Append(LINKFLAGS=[ |
2488 '-static', | 2569 '-static', |
2489 '-T', 'ldscripts/%s.x.static' % GetLinkerScriptBaseName(nacl_env), | 2570 '-T', 'ldscripts/%s.x.static' % GetLinkerScriptBaseName(nacl_env), |
2490 '-lc']) | 2571 '-lc']) |
2491 | 2572 |
2492 def AddTargetRootSuffix(env, bit_name, suffix): | |
2493 """Add a suffix to the subdirectory of scons-out that we use. This | |
2494 usually does not affect correctness, but saves us triggering a | |
2495 rebuild whenever we add or remove a build option such as --nacl_glibc. | |
2496 """ | |
2497 if env.Bit(bit_name): | |
2498 pathname = '%s-%s' % (env.subst('${TARGET_ROOT}'), suffix) | |
2499 env.Replace(TARGET_ROOT=pathname) | |
2500 | |
2501 AddTargetRootSuffix(nacl_env, 'bitcode', 'pnacl') | |
2502 AddTargetRootSuffix(nacl_env, 'nacl_pic', 'pic') | |
2503 AddTargetRootSuffix(nacl_env, 'use_sandboxed_translator', 'sbtc') | |
2504 AddTargetRootSuffix(nacl_env, 'nacl_glibc', 'glibc') | |
2505 | |
2506 if nacl_env.Bit('running_on_valgrind'): | 2573 if nacl_env.Bit('running_on_valgrind'): |
2507 nacl_env.Append(CCFLAGS = ['-g', '-Wno-overlength-strings', | 2574 nacl_env.Append(CCFLAGS = ['-g', '-Wno-overlength-strings', |
2508 '-fno-optimize-sibling-calls'], | 2575 '-fno-optimize-sibling-calls'], |
2509 CPPDEFINES = [['DYNAMIC_ANNOTATIONS_ENABLED', '1' ], | 2576 CPPDEFINES = [['DYNAMIC_ANNOTATIONS_ENABLED', '1' ], |
2510 ['DYNAMIC_ANNOTATIONS_PREFIX', 'NACL_' ]]) | 2577 ['DYNAMIC_ANNOTATIONS_PREFIX', 'NACL_' ]]) |
2511 # With GLibC, libvalgrind.so is preloaded at runtime. | 2578 # With GLibC, libvalgrind.so is preloaded at runtime. |
2512 # With Newlib, it has to be linked in. | 2579 # With Newlib, it has to be linked in. |
2513 if not nacl_env.Bit('nacl_glibc'): | 2580 if not nacl_env.Bit('nacl_glibc'): |
2514 nacl_env.Append(LINKFLAGS = ['-Wl,-u,have_nacl_valgrind_interceptors'], | 2581 nacl_env.Append(LINKFLAGS = ['-Wl,-u,have_nacl_valgrind_interceptors'], |
2515 LIBS = ['valgrind']) | 2582 LIBS = ['valgrind']) |
2516 | 2583 |
2517 environment_list.append(nacl_env) | 2584 environment_list.append(nacl_env) |
2518 | 2585 |
| 2586 if not nacl_env.Bit('nacl_glibc'): |
| 2587 # These are all specific to nacl-newlib so we do not include them |
| 2588 # when building against nacl-glibc. The functionality of |
| 2589 # pthread/startup/stubs/nosys is provided by glibc. The valgrind |
| 2590 # code currently assumes nc_threads. |
| 2591 nacl_env.Append( |
| 2592 BUILD_SCONSCRIPTS = [ |
| 2593 #### ALPHABETICALLY SORTED #### |
| 2594 'src/untrusted/pthread/nacl.scons', |
| 2595 'src/untrusted/startup/nacl.scons', |
| 2596 'src/untrusted/stubs/nacl.scons', |
| 2597 'src/untrusted/nosys/nacl.scons', |
| 2598 #### ALPHABETICALLY SORTED #### |
| 2599 ]) |
| 2600 |
2519 nacl_env.Append( | 2601 nacl_env.Append( |
2520 BUILD_SCONSCRIPTS = [ | 2602 BUILD_SCONSCRIPTS = [ |
2521 #### ALPHABETICALLY SORTED #### | 2603 #### ALPHABETICALLY SORTED #### |
| 2604 'src/include/nacl/nacl.scons', |
| 2605 'src/shared/gio/nacl.scons', |
| 2606 'src/shared/imc/nacl.scons', |
| 2607 'src/shared/platform/nacl.scons', |
| 2608 'src/shared/ppapi/nacl.scons', |
| 2609 'src/shared/ppapi_proxy/nacl.scons', |
| 2610 'src/shared/srpc/nacl.scons', |
2522 'src/tools/posix_over_imc/nacl.scons', | 2611 'src/tools/posix_over_imc/nacl.scons', |
2523 'src/trusted/service_runtime/nacl.scons', | 2612 'src/trusted/service_runtime/nacl.scons', |
2524 'src/trusted/validator_x86/nacl.scons', | 2613 'src/trusted/validator_x86/nacl.scons', |
| 2614 'src/untrusted/ehsupport/nacl.scons', |
| 2615 'src/untrusted/irt_stub/nacl.scons', |
| 2616 'src/untrusted/nacl/nacl.scons', |
| 2617 'src/untrusted/ppapi/nacl.scons', |
| 2618 'src/untrusted/valgrind/nacl.scons', |
2525 'tests/app_lib/nacl.scons', | 2619 'tests/app_lib/nacl.scons', |
2526 'tests/autoloader/nacl.scons', | 2620 'tests/autoloader/nacl.scons', |
2527 'tests/barebones/nacl.scons', | 2621 'tests/barebones/nacl.scons', |
2528 'tests/blob_library_loading/nacl.scons', | 2622 'tests/blob_library_loading/nacl.scons', |
2529 'tests/browser_dynamic_library/nacl.scons', | 2623 'tests/browser_dynamic_library/nacl.scons', |
2530 'tests/browser_startup_time/nacl.scons', | 2624 'tests/browser_startup_time/nacl.scons', |
2531 'tests/bundle_size/nacl.scons', | 2625 'tests/bundle_size/nacl.scons', |
2532 'tests/callingconv/nacl.scons', | 2626 'tests/callingconv/nacl.scons', |
2533 'tests/chrome_extension/nacl.scons', | 2627 'tests/chrome_extension/nacl.scons', |
2534 'tests/computed_gotos/nacl.scons', | 2628 'tests/computed_gotos/nacl.scons', |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2566 'tests/nanosleep/nacl.scons', | 2660 'tests/nanosleep/nacl.scons', |
2567 'tests/native_worker/nacl.scons', | 2661 'tests/native_worker/nacl.scons', |
2568 'tests/noop/nacl.scons', | 2662 'tests/noop/nacl.scons', |
2569 'tests/nrd_xfer/nacl.scons', | 2663 'tests/nrd_xfer/nacl.scons', |
2570 'tests/nthread_nice/nacl.scons', | 2664 'tests/nthread_nice/nacl.scons', |
2571 'tests/null/nacl.scons', | 2665 'tests/null/nacl.scons', |
2572 'tests/nullptr/nacl.scons', | 2666 'tests/nullptr/nacl.scons', |
2573 'tests/plugin_async_messaging/nacl.scons', | 2667 'tests/plugin_async_messaging/nacl.scons', |
2574 'tests/pnacl_abi/nacl.scons', | 2668 'tests/pnacl_abi/nacl.scons', |
2575 'tests/pnacl_client_translator/nacl.scons', | 2669 'tests/pnacl_client_translator/nacl.scons', |
| 2670 'tests/ppapi/nacl.scons', |
2576 'tests/ppapi_browser/bad/nacl.scons', | 2671 'tests/ppapi_browser/bad/nacl.scons', |
2577 'tests/ppapi_browser/manifest/nacl.scons', | 2672 'tests/ppapi_browser/manifest/nacl.scons', |
2578 'tests/ppapi_browser/ppb_core/nacl.scons', | 2673 'tests/ppapi_browser/ppb_core/nacl.scons', |
2579 'tests/ppapi_browser/ppb_file_system/nacl.scons', | 2674 'tests/ppapi_browser/ppb_file_system/nacl.scons', |
2580 'tests/ppapi_browser/ppb_graphics2d/nacl.scons', | 2675 'tests/ppapi_browser/ppb_graphics2d/nacl.scons', |
2581 'tests/ppapi_browser/ppb_scrollbar/nacl.scons', | 2676 'tests/ppapi_browser/ppb_scrollbar/nacl.scons', |
2582 'tests/ppapi_browser/progress_events/nacl.scons', | 2677 'tests/ppapi_browser/progress_events/nacl.scons', |
2583 'tests/ppapi_example_2d/nacl.scons', | 2678 'tests/ppapi_example_2d/nacl.scons', |
2584 'tests/ppapi_example_audio/nacl.scons', | 2679 'tests/ppapi_example_audio/nacl.scons', |
2585 'tests/ppapi_example_events/nacl.scons', | 2680 'tests/ppapi_example_events/nacl.scons', |
2586 'tests/ppapi_example_font/nacl.scons', | 2681 'tests/ppapi_example_font/nacl.scons', |
2587 'tests/ppapi_example_gles2/nacl.scons', | 2682 'tests/ppapi_example_gles2/nacl.scons', |
2588 'tests/ppapi_example_post_message/nacl.scons', | 2683 'tests/ppapi_example_post_message/nacl.scons', |
2589 'tests/ppapi_geturl/nacl.scons', | 2684 'tests/ppapi_geturl/nacl.scons', |
2590 'tests/ppapi_gles_book/nacl.scons', | 2685 'tests/ppapi_gles_book/nacl.scons', |
2591 'tests/ppapi_messaging/nacl.scons', | 2686 'tests/ppapi_messaging/nacl.scons', |
2592 'tests/ppapi_proxy/nacl.scons', | 2687 'tests/ppapi_proxy/nacl.scons', |
2593 'tests/ppapi_simple_tests/nacl.scons', | 2688 'tests/ppapi_simple_tests/nacl.scons', |
2594 'tests/ppapi_test_example/nacl.scons', | 2689 'tests/ppapi_test_example/nacl.scons', |
2595 'tests/ppapi_test_lib/nacl.scons', | 2690 'tests/ppapi_test_lib/nacl.scons', |
2596 'tests/ppapi_tests/nacl.scons', | 2691 'tests/ppapi_tests/nacl.scons', |
2597 'tests/ppapi/nacl.scons', | |
2598 'tests/pyauto_nacl/nacl.scons', | 2692 'tests/pyauto_nacl/nacl.scons', |
2599 'tests/redir/nacl.scons', | 2693 'tests/redir/nacl.scons', |
2600 'tests/rodata_not_writable/nacl.scons', | 2694 'tests/rodata_not_writable/nacl.scons', |
2601 'tests/signal_handler/nacl.scons', | 2695 'tests/signal_handler/nacl.scons', |
2602 'tests/srpc/nacl.scons', | 2696 'tests/srpc/nacl.scons', |
2603 'tests/srpc_hw/nacl.scons', | 2697 'tests/srpc_hw/nacl.scons', |
2604 'tests/srpc_message/nacl.scons', | 2698 'tests/srpc_message/nacl.scons', |
2605 'tests/stack_alignment/nacl.scons', | 2699 'tests/stack_alignment/nacl.scons', |
2606 'tests/startup_message/nacl.scons', | 2700 'tests/startup_message/nacl.scons', |
2607 'tests/stubout_mode/nacl.scons', | 2701 'tests/stubout_mode/nacl.scons', |
2608 'tests/sysbasic/nacl.scons', | 2702 'tests/sysbasic/nacl.scons', |
| 2703 'tests/syscall_return_sandboxing/nacl.scons', |
2609 'tests/syscalls/nacl.scons', | 2704 'tests/syscalls/nacl.scons', |
2610 'tests/syscall_return_sandboxing/nacl.scons', | |
2611 'tests/threads/nacl.scons', | 2705 'tests/threads/nacl.scons', |
2612 'tests/time/nacl.scons', | 2706 'tests/time/nacl.scons', |
2613 'tests/tls/nacl.scons', | 2707 'tests/tls/nacl.scons', |
2614 'tests/toolchain/nacl.scons', | 2708 'tests/toolchain/nacl.scons', |
2615 'tests/unittests/shared/imc/nacl.scons', | 2709 'tests/unittests/shared/imc/nacl.scons', |
2616 'tests/unittests/shared/srpc/nacl.scons', | 2710 'tests/unittests/shared/srpc/nacl.scons', |
2617 'tests/untrusted_check/nacl.scons', | 2711 'tests/untrusted_check/nacl.scons', |
2618 #### ALPHABETICALLY SORTED #### | 2712 #### ALPHABETICALLY SORTED #### |
2619 ]) | 2713 ]) |
2620 | 2714 |
2621 nacl_env.Append( | 2715 nacl_env.Append( |
2622 BUILD_SCONSCRIPTS = [ | 2716 BUILD_SCONSCRIPTS = [ |
2623 'tools/tests/nacl.scons', | 2717 'tools/tests/nacl.scons', |
2624 ]) | 2718 ]) |
2625 | 2719 |
2626 # ---------------------------------------------------------- | 2720 # ---------------------------------------------------------- |
2627 # Possibly install an sdk by downloading it | 2721 # Possibly install an sdk by downloading it |
2628 # ---------------------------------------------------------- | 2722 # ---------------------------------------------------------- |
2629 # TODO: explore using a less heavy weight mechanism | 2723 # TODO: explore using a less heavy weight mechanism |
2630 # NOTE: this uses stuff from: site_scons/site_tools/naclsdk.py | 2724 # NOTE: this uses stuff from: site_scons/site_tools/naclsdk.py |
2631 import SCons.Script | 2725 import SCons.Script |
2632 | 2726 |
2633 SCons.Script.AddOption('--download', | 2727 SCons.Script.AddOption('--download', |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2668 n = env.Replicate(path, nodes) | 2762 n = env.Replicate(path, nodes) |
2669 env.Alias('prebuilt_binaries_update', n) | 2763 env.Alias('prebuilt_binaries_update', n) |
2670 return n | 2764 return n |
2671 | 2765 |
2672 nacl_env.AddMethod(AddPrebuiltBinaryToRepository) | 2766 nacl_env.AddMethod(AddPrebuiltBinaryToRepository) |
2673 # ---------------------------------------------------------- | 2767 # ---------------------------------------------------------- |
2674 # We force this into a separate env so that the tests in nacl_env | 2768 # We force this into a separate env so that the tests in nacl_env |
2675 # have NO access to any libraries build here but need to link them | 2769 # have NO access to any libraries build here but need to link them |
2676 # from the sdk libdir | 2770 # from the sdk libdir |
2677 # ---------------------------------------------------------- | 2771 # ---------------------------------------------------------- |
2678 nacl_extra_sdk_env = pre_base_env.Clone( | 2772 nacl_extra_sdk_env = nacl_common_env.Clone( |
2679 tools = ['naclsdk'], | |
2680 BUILD_TYPE = 'nacl_extra_sdk', | 2773 BUILD_TYPE = 'nacl_extra_sdk', |
2681 BUILD_TYPE_DESCRIPTION = 'NaCl SDK extra library build', | 2774 BUILD_TYPE_DESCRIPTION = 'NaCl SDK extra library build', |
2682 NACL_BUILD_FAMILY = 'UNTRUSTED', | |
2683 IRT_DATA_REGION_START = nacl_env['IRT_DATA_REGION_START'], | |
2684 # ${SOURCE_ROOT} for #include <ppapi/...> | |
2685 # ${SOURCE_ROOT}/gpu for #include <GLES2/...>" | |
2686 CPPPATH = ['${SOURCE_ROOT}', '${SOURCE_ROOT}/gpu'], | |
2687 CPPDEFINES = [ | |
2688 ['NACL_BUILD_ARCH', '${BUILD_ARCHITECTURE}' ], | |
2689 ['NACL_BUILD_SUBARCH', '${BUILD_SUBARCH}' ], | |
2690 ['NACL_BLOCK_SHIFT', '5' ], | |
2691 ['DYNAMIC_ANNOTATIONS_ENABLED', '1' ], | |
2692 ['DYNAMIC_ANNOTATIONS_PREFIX', 'NACL_' ], | |
2693 # This ensures that UINT32_MAX gets defined. | |
2694 ['__STDC_LIMIT_MACROS', '1'], | |
2695 # This ensures that PRId64 etc. get defined. | |
2696 ['__STDC_FORMAT_MACROS', '1'], | |
2697 ], | |
2698 ARFLAGS = 'rc' | |
2699 ) | 2775 ) |
2700 | 2776 |
2701 AddTargetRootSuffix(nacl_extra_sdk_env, 'bitcode', 'pnacl') | 2777 AddTargetRootSuffix(nacl_extra_sdk_env, 'bitcode', 'pnacl') |
2702 AddTargetRootSuffix(nacl_extra_sdk_env, 'nacl_glibc', 'glibc') | 2778 AddTargetRootSuffix(nacl_extra_sdk_env, 'nacl_glibc', 'glibc') |
2703 | 2779 |
2704 # TODO(robertm): consider moving some of these flags to the naclsdk tool | 2780 # TODO(robertm): consider moving some of these flags to the naclsdk tool |
2705 nacl_extra_sdk_env.Append(CCFLAGS=['-Wall', | 2781 nacl_extra_sdk_env.Append(CCFLAGS=['-Wall', |
2706 '-fdiagnostics-show-option', | 2782 '-fdiagnostics-show-option', |
2707 '-pedantic'] + | 2783 '-pedantic'] + |
2708 werror_flags + | 2784 werror_flags + |
(...skipping 15 matching lines...) Expand all Loading... |
2724 if nacl_extra_sdk_env.Bit('target_arm'): | 2800 if nacl_extra_sdk_env.Bit('target_arm'): |
2725 nacl_extra_sdk_env.FilterOut(CCFLAGS=['-g']) | 2801 nacl_extra_sdk_env.FilterOut(CCFLAGS=['-g']) |
2726 | 2802 |
2727 # TODO(robertm): remove this ASAP, we currently have llvm issue with c++ | 2803 # TODO(robertm): remove this ASAP, we currently have llvm issue with c++ |
2728 # llvm-gcc is based on gcc 4.2 and has warning bug related | 2804 # llvm-gcc is based on gcc 4.2 and has warning bug related |
2729 # class constructors | 2805 # class constructors |
2730 if nacl_extra_sdk_env.Bit('target_arm'): | 2806 if nacl_extra_sdk_env.Bit('target_arm'): |
2731 nacl_extra_sdk_env.FilterOut(CCFLAGS = ['-Werror']) | 2807 nacl_extra_sdk_env.FilterOut(CCFLAGS = ['-Werror']) |
2732 nacl_extra_sdk_env.Append(CFLAGS = werror_flags) | 2808 nacl_extra_sdk_env.Append(CFLAGS = werror_flags) |
2733 | 2809 |
2734 # TODO(pdox): Remove this as soon as build_config.h can be | |
2735 # changed to accept __pnacl__. | |
2736 if nacl_extra_sdk_env.Bit('bitcode'): | |
2737 nacl_extra_sdk_env.AddBiasForPNaCl() | |
2738 | |
2739 if nacl_extra_sdk_env.Bit('host_windows'): | |
2740 # NOTE: This is needed because Windows builds are case-insensitive. | |
2741 # Without this we use nacl-as, which doesn't handle include directives, etc. | |
2742 nacl_extra_sdk_env.Replace(ASCOM = '${CCCOM}') | |
2743 | |
2744 if nacl_env.Bit('host_windows'): | |
2745 # NOTE: This is needed because Windows builds are case-insensitive. | |
2746 # Without this we use nacl-as, which doesn't handle include directives, etc. | |
2747 nacl_env.Replace(ASCOM = '${CCCOM}') | |
2748 | |
2749 | 2810 |
2750 def NaClSdkLibrary(env, lib_name, *args, **kwargs): | 2811 def NaClSdkLibrary(env, lib_name, *args, **kwargs): |
2751 env.ComponentLibrary(lib_name, *args, **kwargs) | 2812 env.ComponentLibrary(lib_name, *args, **kwargs) |
2752 if not env.Bit('nacl_disable_shared'): | 2813 if not env.Bit('nacl_disable_shared'): |
2753 env_shared = env.Clone(COMPONENT_STATIC=False) | 2814 env_shared = env.Clone(COMPONENT_STATIC=False) |
2754 soname = SCons.Util.adjustixes(lib_name, 'lib', '.so') | 2815 soname = SCons.Util.adjustixes(lib_name, 'lib', '.so') |
2755 env_shared.AppendUnique(SHLINKFLAGS=['-Wl,-soname,%s' % (soname)]) | 2816 env_shared.AppendUnique(SHLINKFLAGS=['-Wl,-soname,%s' % (soname)]) |
2756 env_shared.ComponentLibrary(lib_name, *args, **kwargs) | 2817 env_shared.ComponentLibrary(lib_name, *args, **kwargs) |
2757 | 2818 |
2758 nacl_extra_sdk_env.AddMethod(NaClSdkLibrary) | 2819 nacl_extra_sdk_env.AddMethod(NaClSdkLibrary) |
| 2820 nacl_env.AddMethod(NaClSdkLibrary) |
2759 | 2821 |
2760 | 2822 |
2761 # --------------------------------------------------------------------- | 2823 # --------------------------------------------------------------------- |
2762 # Special environment for untrusted test binaries that use raw syscalls | 2824 # Special environment for untrusted test binaries that use raw syscalls |
2763 # --------------------------------------------------------------------- | 2825 # --------------------------------------------------------------------- |
2764 def RawSyscallObjects(env, sources): | 2826 def RawSyscallObjects(env, sources): |
2765 raw_syscall_env = env.Clone() | 2827 raw_syscall_env = env.Clone() |
2766 raw_syscall_env.Append( | 2828 raw_syscall_env.Append( |
2767 CPPDEFINES = [ | 2829 CPPDEFINES = [ |
2768 ['USE_RAW_SYSCALLS', '1'], | 2830 ['USE_RAW_SYSCALLS', '1'], |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2846 nacl_extra_sdk_env.Alias('extra_sdk_update', [libs, libs_platform]) | 2908 nacl_extra_sdk_env.Alias('extra_sdk_update', [libs, libs_platform]) |
2847 | 2909 |
2848 | 2910 |
2849 # Add a header file to the toolchain. By default, Native Client-specific | 2911 # Add a header file to the toolchain. By default, Native Client-specific |
2850 # headers go under nacl/, but there are non-specific headers, such as | 2912 # headers go under nacl/, but there are non-specific headers, such as |
2851 # the OpenGLES2 headers, that go under their own subdir. | 2913 # the OpenGLES2 headers, that go under their own subdir. |
2852 def AddHeaderToSdk(env, nodes, subdir = 'nacl/'): | 2914 def AddHeaderToSdk(env, nodes, subdir = 'nacl/'): |
2853 dir = ARGUMENTS.get('extra_sdk_include_destination') | 2915 dir = ARGUMENTS.get('extra_sdk_include_destination') |
2854 if not dir: | 2916 if not dir: |
2855 dir = '${NACL_SDK_INCLUDE}' | 2917 dir = '${NACL_SDK_INCLUDE}' |
2856 | 2918 if subdir is not None: |
2857 n = env.Replicate(dir + '/' + subdir, nodes) | 2919 dir += '/' + subdir |
| 2920 n = env.Replicate(dir, nodes) |
2858 env.Alias('extra_sdk_update_header', n) | 2921 env.Alias('extra_sdk_update_header', n) |
2859 return n | 2922 return n |
2860 | 2923 |
2861 nacl_extra_sdk_env.AddMethod(AddHeaderToSdk) | 2924 nacl_extra_sdk_env.AddMethod(AddHeaderToSdk) |
2862 | 2925 |
2863 | 2926 |
2864 def AddLibraryToSdkHelper(env, nodes, is_lib, is_platform): | 2927 def AddLibraryToSdkHelper(env, nodes, is_lib, is_platform): |
2865 """"Helper function to install libs/objs into the toolchain | 2928 """"Helper function to install libs/objs into the toolchain |
2866 and associate the action with the extra_sdk_update. | 2929 and associate the action with the extra_sdk_update. |
2867 | 2930 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2913 # The IRT-building environment was cloned from nacl_env, but it should | 2976 # The IRT-building environment was cloned from nacl_env, but it should |
2914 # ignore the --nacl_glibc, nacl_pic=1 and bitcode=1 switches. | 2977 # ignore the --nacl_glibc, nacl_pic=1 and bitcode=1 switches. |
2915 # We have to reinstantiate the naclsdk.py magic after clearing those flags, | 2978 # We have to reinstantiate the naclsdk.py magic after clearing those flags, |
2916 # so it regenerates the tool paths right. | 2979 # so it regenerates the tool paths right. |
2917 # TODO(mcgrathr,bradnelson): could get cleaner if naclsdk.py got folded back in. | 2980 # TODO(mcgrathr,bradnelson): could get cleaner if naclsdk.py got folded back in. |
2918 nacl_irt_env.ClearBits('nacl_glibc') | 2981 nacl_irt_env.ClearBits('nacl_glibc') |
2919 nacl_irt_env.ClearBits('nacl_pic') | 2982 nacl_irt_env.ClearBits('nacl_pic') |
2920 if not nacl_irt_env.Bit('target_arm'): | 2983 if not nacl_irt_env.Bit('target_arm'): |
2921 nacl_irt_env.ClearBits('bitcode') | 2984 nacl_irt_env.ClearBits('bitcode') |
2922 nacl_irt_env.Tool('naclsdk') | 2985 nacl_irt_env.Tool('naclsdk') |
| 2986 FixWindowsAssembler(nacl_irt_env) |
2923 # Make it find the libraries it builds, rather than the SDK ones. | 2987 # Make it find the libraries it builds, rather than the SDK ones. |
2924 nacl_irt_env.Replace(LIBPATH='${LIB_DIR}') | 2988 nacl_irt_env.Replace(LIBPATH='${LIB_DIR}') |
2925 | 2989 |
2926 AddTargetRootSuffix(nacl_irt_env, 'bitcode', 'pnacl') | |
2927 AddTargetRootSuffix(nacl_irt_env, 'nacl_pic', 'pic') | |
2928 if nacl_irt_env.Bit('bitcode'): | 2990 if nacl_irt_env.Bit('bitcode'): |
2929 nacl_irt_env.AddBiasForPNaCl() | 2991 nacl_irt_env.AddBiasForPNaCl() |
2930 | 2992 |
2931 # We have to stub out various methods that are only defined in | 2993 # We have to stub out various methods that are only defined in |
2932 # nacl_extra_sdk_env, because we doubly use these nacl.scons files | 2994 # nacl_extra_sdk_env, because we doubly use these nacl.scons files |
2933 # in nacl_irt_env. | 2995 # in nacl_irt_env. |
2934 # TODO(mcgrathr): Remove these when nacl_extra_sdk_env is removed. | 2996 # TODO(mcgrathr): Remove these when nacl_extra_sdk_env is removed. |
2935 def IrtAddLibraryToSdk(env, nodes, is_platform=False): | 2997 def AddLibraryDummy(env, nodes, is_platform=False): |
2936 pass | 2998 return [env.File('${LIB_DIR}/%s.a' % x) for x in nodes] |
2937 nacl_irt_env.AddMethod(IrtAddLibraryToSdk, 'AddLibraryToSdk') | 2999 nacl_env.AddMethod(AddLibraryDummy, 'AddLibraryToSdk') |
2938 nacl_irt_env.AddMethod(IrtAddLibraryToSdk, 'AddObjectToSdk') | 3000 nacl_irt_env.AddMethod(AddLibraryDummy, 'AddLibraryToSdk') |
| 3001 |
| 3002 def AddObjectInternal(env, nodes, is_platform=False): |
| 3003 return env.Replicate('${LIB_DIR}', nodes) |
| 3004 nacl_env.AddMethod(AddObjectInternal, 'AddObjectToSdk') |
| 3005 nacl_irt_env.AddMethod(AddObjectInternal, 'AddObjectToSdk') |
2939 | 3006 |
2940 def IrtNaClSdkLibrary(env, lib_name, *args, **kwargs): | 3007 def IrtNaClSdkLibrary(env, lib_name, *args, **kwargs): |
2941 env.ComponentLibrary(lib_name, *args, **kwargs) | 3008 env.ComponentLibrary(lib_name, *args, **kwargs) |
2942 nacl_irt_env.AddMethod(IrtNaClSdkLibrary, 'NaClSdkLibrary') | 3009 nacl_irt_env.AddMethod(IrtNaClSdkLibrary, 'NaClSdkLibrary') |
2943 | 3010 |
2944 def IrtAddHeaderToSdk(env, nodes, subdir = 'nacl/'): | 3011 # Populate the internal include directory when AddHeaderToSdk |
2945 pass | 3012 # is used inside nacl_env rather than nacl_extra_sdk_env. |
2946 nacl_irt_env.AddMethod(IrtAddHeaderToSdk, 'AddHeaderToSdk') | 3013 def AddHeaderInternal(env, nodes, subdir='nacl'): |
| 3014 dir = '${INCLUDE_DIR}' |
| 3015 if subdir is not None: |
| 3016 dir += '/' + subdir |
| 3017 n = env.Replicate(dir, nodes) |
| 3018 return n |
| 3019 |
| 3020 nacl_env.AddMethod(AddHeaderInternal, 'AddHeaderToSdk') |
| 3021 nacl_irt_env.AddMethod(AddHeaderInternal, 'AddHeaderToSdk') |
| 3022 |
| 3023 # We want to do this for nacl_env when not under --nacl_glibc, |
| 3024 # but for nacl_irt_env whether or not under --nacl_glibc, so |
| 3025 # we do it separately for each after making nacl_irt_env and |
| 3026 # clearing its Bit('nacl_glibc'). |
| 3027 def AddImplicitLibs(env): |
| 3028 if not env.Bit('nacl_glibc'): |
| 3029 # These are automatically linked in by the compiler, either directly |
| 3030 # or via the linker script that is -lc. In the non-glibc build, we |
| 3031 # are the ones providing these files, so we need dependencies. |
| 3032 # The ComponentProgram method (site_scons/site_tools/component_builders.py) |
| 3033 # adds dependencies on env['IMPLICIT_LIBS'] if that's set. |
| 3034 implicit_libs = ['crt1.o', 'libnacl.a', 'libcrt_platform.a'] |
| 3035 if env.Bit('bitcode'): |
| 3036 implicit_libs += ['libehsupport.a'] |
| 3037 else: |
| 3038 implicit_libs += ['crti.o', 'crtn.o'] |
| 3039 env['IMPLICIT_LIBS'] = ['${LIB_DIR}/%s' % file for file in implicit_libs] |
| 3040 # The -B<dir>/ flag is necessary to tell gcc to look for crt[1in].o there. |
| 3041 env.Prepend(LINKFLAGS=['-B${LIB_DIR}/']) |
| 3042 |
| 3043 AddImplicitLibs(nacl_env) |
| 3044 AddImplicitLibs(nacl_irt_env) |
2947 | 3045 |
2948 # Give the environment for building the IRT and its libraries | 3046 # Give the environment for building the IRT and its libraries |
2949 # the -Ds used for building those libraries for the SDK. | 3047 # the -Ds used for building those libraries for the SDK. |
2950 # TODO(mcgrathr,bradnelson): clean up when nacl_extra_sdk_env goes away. | 3048 # TODO(mcgrathr,bradnelson): clean up when nacl_extra_sdk_env goes away. |
2951 # | 3049 # |
2952 # Since we will use a locally-built libpthread rather than the | 3050 # Since we will use a locally-built libpthread rather than the |
2953 # one from the toolchain, find its header files in the source | 3051 # one from the toolchain, find its header files in the source |
2954 # rather than using the ones installed in the toolchain. | 3052 # rather than using the ones installed in the toolchain. |
2955 nacl_irt_env.AppendUnique(CPPDEFINES = nacl_extra_sdk_env['CPPDEFINES'], | 3053 nacl_irt_env.AppendUnique(CPPDEFINES = nacl_extra_sdk_env['CPPDEFINES'], |
2956 CPPPATH = ['${MAIN_DIR}/src/untrusted/pthread']) | 3054 CPPPATH = ['${MAIN_DIR}/src/untrusted/pthread']) |
2957 | 3055 |
2958 # TODO(mcgrathr): nacl, crt_platform are implicitly linked in from toolchain, | 3056 # TODO(mcgrathr): nacl, crt_platform are implicitly linked in from toolchain, |
2959 # scons does not know about the dependencies. We may be building all of | 3057 # scons does not know about the dependencies. We may be building all of |
2960 # src/untrusted/nacl but only actually getting libimc_syscalls.a from there. | 3058 # src/untrusted/nacl but only actually getting libimc_syscalls.a from there. |
2961 nacl_irt_env.Append( | 3059 nacl_irt_env.Append( |
2962 BUILD_SCONSCRIPTS = [ | 3060 BUILD_SCONSCRIPTS = [ |
| 3061 'src/include/nacl/nacl.scons', |
2963 'src/shared/gio/nacl.scons', | 3062 'src/shared/gio/nacl.scons', |
2964 'src/shared/platform/nacl.scons', | 3063 'src/shared/platform/nacl.scons', |
2965 'src/shared/ppapi_proxy/nacl.scons', | 3064 'src/shared/ppapi_proxy/nacl.scons', |
2966 'src/shared/srpc/nacl.scons', | 3065 'src/shared/srpc/nacl.scons', |
| 3066 'src/untrusted/ehsupport/nacl.scons', |
2967 'src/untrusted/irt/nacl.scons', | 3067 'src/untrusted/irt/nacl.scons', |
2968 'src/untrusted/nacl/nacl.scons', | 3068 'src/untrusted/nacl/nacl.scons', |
2969 'src/untrusted/pthread/nacl.scons', | 3069 'src/untrusted/pthread/nacl.scons', |
| 3070 'src/untrusted/stubs/nacl.scons', |
2970 ]) | 3071 ]) |
2971 | 3072 |
2972 environment_list.append(nacl_irt_env) | 3073 environment_list.append(nacl_irt_env) |
2973 | 3074 |
2974 windows_coverage_env = windows_env.Clone( | 3075 windows_coverage_env = windows_env.Clone( |
2975 tools = ['code_coverage'], | 3076 tools = ['code_coverage'], |
2976 BUILD_TYPE = 'coverage-win', | 3077 BUILD_TYPE = 'coverage-win', |
2977 BUILD_TYPE_DESCRIPTION = 'Windows code coverage build', | 3078 BUILD_TYPE_DESCRIPTION = 'Windows code coverage build', |
2978 # TODO(bradnelson): switch nacl to common testing process so this won't be | 3079 # TODO(bradnelson): switch nacl to common testing process so this won't be |
2979 # needed. | 3080 # needed. |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3175 Default(['all_programs', 'all_bundles', 'all_test_programs', 'all_libraries']) | 3276 Default(['all_programs', 'all_bundles', 'all_test_programs', 'all_libraries']) |
3176 | 3277 |
3177 if BROKEN_TEST_COUNT > 0: | 3278 if BROKEN_TEST_COUNT > 0: |
3178 msg = "There are %d broken tests." % BROKEN_TEST_COUNT | 3279 msg = "There are %d broken tests." % BROKEN_TEST_COUNT |
3179 if GetOption('brief_comstr'): | 3280 if GetOption('brief_comstr'): |
3180 msg += " Add --verbose to the command line for more information." | 3281 msg += " Add --verbose to the command line for more information." |
3181 print msg | 3282 print msg |
3182 | 3283 |
3183 # separate warnings from actual build output | 3284 # separate warnings from actual build output |
3184 Banner('B U I L D - O U T P U T:') | 3285 Banner('B U I L D - O U T P U T:') |
OLD | NEW |