@memoize
def get_toolchain_root(config):
    'Returns the toolchain folder for a given NaCl toolchain.'
    if (config.toolchain == 'emscripten'):
        return get_emscripten_root()
    platform = get_platform()
    if (config.toolchain in ('pnacl', 'clang-newlib')):
        tc_dir = os.path.join(('%s_pnacl' % platform))
    else:
        tc_arch = {'arm': 'arm', 'i686': 'x86', 'x86_64': 'x86'}[config.arch]
        tc_dir = ('%s_%s_%s' % (platform, tc_arch, config.libc))
    return os.path.join(get_sdk_root(), 'toolchain', tc_dir)
Returns the toolchain folder for a given NaCl toolchain.
@memoize
def get_toolchain_root(config):
    
    if (config.toolchain == 'emscripten'):
        return get_emscripten_root()
    platform = get_platform()
    if (config.toolchain in ('pnacl', 'clang-newlib')):
        tc_dir = os.path.join(('%s_pnacl' % platform))
    else:
        tc_arch = {'arm': 'arm', 'i686': 'x86', 'x86_64': 'x86'}[config.arch]
        tc_dir = ('%s_%s_%s' % (platform, tc_arch, config.libc))
    return os.path.join(get_sdk_root(), 'toolchain', tc_dir)