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

Unified Diff: SConstruct

Issue 639113003: Add nacl-clang testing to SCons (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | site_scons/site_tools/naclsdk.py » ('j') | tests/threads/race_test.c » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: SConstruct
diff --git a/SConstruct b/SConstruct
index 1661234a75e88514aebf1029af1510114bbf969b..a27fab893441debd9e1359a37aa92e88788a18bd 100755
--- a/SConstruct
+++ b/SConstruct
@@ -261,6 +261,9 @@ def SetUpArgumentBits(env):
BitFromArgument(env, 'bitcode', default=False,
desc='We are building bitcode')
+ BitFromArgument(env, 'nacl_clang', default=False,
+ desc='Use native nacl-clang compiler')
+
BitFromArgument(env, 'translate_fast', default=False,
desc='When using pnacl TC (bitcode=1) use accelerated translation step')
@@ -1240,7 +1243,8 @@ def GetToolchainDir(env, platform_build_dir=None, toolchain_name=None,
if toolchain_name is None:
# Fill in default arguments based on environment.
if is_pnacl is None:
- is_pnacl = env.Bit('bitcode')
+ # For the purposes of finding the toolchain dir, nacl_clang is PNaCl.
+ is_pnacl = env.Bit('bitcode') or env.Bit('nacl_clang')
if lib_name is None:
if is_pnacl or not env.Bit('nacl_glibc'):
lib_name = 'newlib'
@@ -3162,6 +3166,11 @@ if nacl_env.Bit('bitcode'):
# http://code.google.com/p/nativeclient/issues/detail?id=2861
nacl_env.Append(CCFLAGS=['-Wno-unused-private-field'])
+if nacl_env.Bit('nacl_clang'):
+ nacl_env.Append(CCFLAGS=['-Wno-format-security'])
+ # third_party/valgrind/nacl_valgrind.h uses asm instead of __asm__
+ nacl_env.Append(CCFLAGS=['-Wno-language-extension-token'])
+
# We use a special environment for building the IRT image because it must
# always use the newlib toolchain, regardless of --nacl_glibc. We clone
# it from nacl_env here, before too much other cruft has been added.
@@ -3190,6 +3199,7 @@ target_variant_map = [
('nacl_glibc', 'glibc'),
('pnacl_generate_pexe', 'pexe'),
('nonsfi_nacl', 'nonsfi'),
+ ('nacl_clang', 'clang'),
]
for variant_bit, variant_suffix in target_variant_map:
if nacl_env.Bit(variant_bit):
@@ -3659,6 +3669,11 @@ def AddImplicitLibs(env):
# TODO(mcgrathr): multilib nonsense defeats -B! figure out a better way.
if GetTargetPlatform() == 'x86-32':
implicit_libs.append(os.path.join('32', 'crt1.o'))
+ # libc++ depends on libpthread, and because PPAPI applications always need
+ # threads anyway, nacl-clang just includes -lpthread unconditionally.
+ if ((env.Bit('nacl_clang') or env.Bit('bitcode')) and
+ env['NACL_BUILD_FAMILY'] != 'UNTRUSTED_IRT'):
+ implicit_libs += ['libpthread.a']
if implicit_libs != []:
env['IMPLICIT_LIBS'] = [env.File(os.path.join('${LIB_DIR}', file))
« no previous file with comments | « no previous file | site_scons/site_tools/naclsdk.py » ('j') | tests/threads/race_test.c » ('J')

Powered by Google App Engine
This is Rietveld 408576698