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

Unified Diff: SConstruct

Issue 10919162: [MIPS] Implementation of sel_ldr for MIPS architecture. (Closed) Base URL: http://src.chromium.org/native_client/trunk/src/native_client/
Patch Set: Second update per Mark's comments. Created 8 years, 3 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 | pnacl/build.sh » ('j') | pnacl/build.sh » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: SConstruct
diff --git a/SConstruct b/SConstruct
index faca3da3ae369a7c46b03a31e255dbf4b52c75e8..7a9d7aeeb06d8a3fee592d17785a73b116816c47 100755
--- a/SConstruct
+++ b/SConstruct
@@ -2259,6 +2259,37 @@ def SetupLinuxEnvArm(env):
# get_plugin_dirname.cc has a dependency on dladdr
env.Append(LIBS=['dl'])
+def SetupLinuxEnvMips(env):
+ jail = '${SCONSTRUCT_DIR}/toolchain/linux_mips-trusted'
+ if env.Bit('built_elsewhere'):
+ def FakeInstall(dest, source, env):
+ print 'Not installing', dest
+ # Replace build commands with no-ops
+ env.Replace(CC='true', CXX='true', LD='true',
+ AR='true', RANLIB='true', INSTALL=FakeInstall)
+ # Allow emulation on x86 hosts for testing built_elsewhere flag
+ if not platform.machine().startswith('mips'):
+ env.Replace(EMULATOR=jail + '/run_under_qemu_mips32')
+ else:
+ sys.path.append('tools/trusted_cross_toolchains')
+ from setup_mips32_trusted_toolchain import mips32_env
+ sys.path.pop()
+ # Allow env vars to override these settings, for what it's worth.
+ mips32_env = mips32_env.copy()
+ mips32_env.update(os.environ)
+ env.Replace(CC=mips32_env.get('MIPS32_CC', 'NO-MIPSEL-CC-SPECIFIED'),
+ CXX=mips32_env.get('MIPS32_CXX', 'NO-MIPSEL-CXX-SPECIFIED'),
+ LD=mips32_env.get('MIPS32_LD', 'NO-MIPSEL-LD-SPECIFIED'),
+ EMULATOR=mips32_env.get('MIPS32_EMU', ''),
+ ASFLAGS=[],
+ LIBPATH=['${LIB_DIR}',
+ mips32_env.get('MIPS32_LIB_DIR', '').split()],
+ LINKFLAGS=mips32_env.get('MIPS32_LINKFLAGS', ''),
+ )
+
+ env.Append(LIBS=['rt', 'dl', 'pthread'],
+ CCFLAGS=['-EL', '-Wl,-EL', '-march=mips32r2'])
+
def MakeLinuxEnv():
linux_env = MakeUnixLikeEnv().Clone(
BUILD_TYPE = '${OPTIMIZATION_LEVEL}-linux',
@@ -2297,8 +2328,7 @@ def MakeLinuxEnv():
elif linux_env.Bit('build_arm'):
SetupLinuxEnvArm(linux_env)
elif linux_env.Bit('build_mips32'):
- # TODO(petarj): Add support for MIPS.
- pass
+ SetupLinuxEnvMips(linux_env)
else:
Banner('Strange platform: %s' % GetPlatform())
@@ -2315,7 +2345,7 @@ def MakeLinuxEnv():
)
# The ARM toolchain has a linker that doesn't handle the code its
# compiler generates under -fPIE.
- if linux_env.Bit('build_arm'):
+ if linux_env.Bit('build_arm') or linux_env.Bit('build_mips32'):
linux_env.Prepend(CCFLAGS=['-fPIC'])
# TODO(mcgrathr): Temporarily punt _FORTIFY_SOURCE for ARM because
# it causes a libc dependency newer than the old bots have installed.
« no previous file with comments | « no previous file | pnacl/build.sh » ('j') | pnacl/build.sh » ('J')

Powered by Google App Engine
This is Rietveld 408576698