summaryrefslogtreecommitdiffstats
path: root/native_client_sdk
diff options
context:
space:
mode:
authorsbc <sbc@chromium.org>2015-07-19 13:21:26 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-19 20:22:15 +0000
commitb2217b5206b7a301bfe79ea8d46162428145eea2 (patch)
tree3d81a1a8a744357e79cf23f5a912b653ec107974 /native_client_sdk
parent698898cebb9e5ec89be25372a3ac32f135e5503e (diff)
downloadchromium_src-b2217b5206b7a301bfe79ea8d46162428145eea2.zip
chromium_src-b2217b5206b7a301bfe79ea8d46162428145eea2.tar.gz
chromium_src-b2217b5206b7a301bfe79ea8d46162428145eea2.tar.bz2
[NaCl SDK] Add initial support arm glibc toolchain
This change adds the new toolchain but doesn't enable it in the SDK makefiles by default. Adventurous users can still use with their own projects (or with the examples if they set ENABLE_ARM_GLIBC). CQ_EXTRA_TRYBOTS=tryserver.chromium.linux:linux_nacl_sdk;tryserver.chromium.mac:mac_nacl_sdk;tryserver.chromium.win:win_nacl_sdk BUG=505885 Review URL: https://codereview.chromium.org/1213893005 Cr-Commit-Position: refs/heads/master@{#339410}
Diffstat (limited to 'native_client_sdk')
-rwxr-xr-xnative_client_sdk/src/build_tools/build_sdk.py200
-rwxr-xr-xnative_client_sdk/src/build_tools/parse_dsc.py2
-rw-r--r--native_client_sdk/src/build_tools/sdk_files.list3
-rw-r--r--native_client_sdk/src/libraries/nacl_io/devfs/tty_node.cc7
-rw-r--r--native_client_sdk/src/libraries/nacl_io/include/bits/ioctls.h16
-rw-r--r--native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc2
-rw-r--r--native_client_sdk/src/libraries/nacl_io/kernel_wrap_glibc.cc4
-rw-r--r--native_client_sdk/src/libraries/nacl_io/library.dsc7
-rw-r--r--native_client_sdk/src/libraries/nacl_io/ossignal.h7
-rw-r--r--native_client_sdk/src/libraries/ppapi_simple/library.dsc2
-rwxr-xr-xnative_client_sdk/src/tools/nacl_config.py4
-rw-r--r--native_client_sdk/src/tools/nacl_gcc.mk9
-rwxr-xr-xnative_client_sdk/src/tools/tests/nacl_config_test.py6
13 files changed, 135 insertions, 134 deletions
diff --git a/native_client_sdk/src/build_tools/build_sdk.py b/native_client_sdk/src/build_tools/build_sdk.py
index 0a3e65c..6c08cf1 100755
--- a/native_client_sdk/src/build_tools/build_sdk.py
+++ b/native_client_sdk/src/build_tools/build_sdk.py
@@ -63,17 +63,39 @@ GYPBUILD_DIR = 'gypbuild'
options = None
-# Map of: ToolchainName: (PackageName, SDKDir).
+# Map of: ToolchainName: (PackageName, SDKDir, arch).
TOOLCHAIN_PACKAGE_MAP = {
- 'newlib': ('nacl_x86_newlib', '%(platform)s_x86_newlib'),
- 'bionic': ('nacl_arm_bionic', '%(platform)s_arm_bionic'),
- 'arm': ('nacl_arm_newlib', '%(platform)s_arm_newlib'),
- 'glibc': ('nacl_x86_glibc', '%(platform)s_x86_glibc'),
- 'pnacl': ('pnacl_newlib', '%(platform)s_pnacl')
+ 'arm_newlib': ('nacl_arm_newlib', '%(platform)s_arm_newlib', 'arm'),
+ 'arm_glibc': ('nacl_arm_glibc', '%(platform)s_arm_glibc', 'arm'),
+ 'x86_newlib': ('nacl_x86_newlib', '%(platform)s_x86_newlib', 'x86'),
+ 'x86_glibc': ('nacl_x86_glibc', '%(platform)s_x86_glibc', 'x86'),
+ 'arm_bionic': ('nacl_arm_bionic', '%(platform)s_arm_bionic', 'arm'),
+ 'pnacl': ('pnacl_newlib', '%(platform)s_pnacl', 'pnacl')
}
-def GetToolchainNaClInclude(tcname, tcpath, arch):
+def GetToolchainDirName(tcname):
+ """Return the directory name for a given toolchain"""
+ return TOOLCHAIN_PACKAGE_MAP[tcname][1] % {'platform': getos.GetPlatform()}
+
+
+def GetToolchainDir(pepperdir, tcname):
+ """Return the full path to a given toolchain within a given sdk root"""
+ return os.path.join(pepperdir, 'toolchain', GetToolchainDirName(tcname))
+
+
+def GetToolchainLibc(tcname):
+ if tcname == 'pnacl':
+ return 'newlib'
+ for libc in ('bionic', 'glibc', 'newlib', 'host'):
+ if libc in tcname:
+ return libc
+
+
+def GetToolchainNaClInclude(pepperdir, tcname, arch=None):
+ tcpath = GetToolchainDir(pepperdir, tcname)
+ if arch is None:
+ arch = TOOLCHAIN_PACKAGE_MAP[tcname][2]
if arch == 'x86':
return os.path.join(tcpath, 'x86_64-nacl', 'include')
elif arch == 'pnacl':
@@ -105,19 +127,17 @@ def GetGypBuiltLib(tcname, arch):
else:
lib_suffix = ''
+ tcdir = 'tc_' + GetToolchainLibc(tcname)
+
if tcname == 'pnacl':
- print arch
if arch is None:
+ lib_suffix = ''
+ tcdir = 'tc_pnacl_newlib'
arch = 'x64'
- tcname = 'pnacl_newlib'
else:
arch = 'clang-' + arch
- tcname = 'newlib'
- return os.path.join(GetNinjaOutDir(arch),
- 'gen',
- 'tc_' + tcname,
- 'lib' + lib_suffix)
+ return os.path.join(GetNinjaOutDir(arch), 'gen', tcdir, 'lib' + lib_suffix)
def GetToolchainNaClLib(tcname, tcpath, arch):
@@ -131,30 +151,9 @@ def GetToolchainNaClLib(tcname, tcpath, arch):
return os.path.join(tcpath, 'le32-nacl', 'lib')
-def GetToolchainDirName(tcname, arch):
- if tcname == 'pnacl':
- return '%s_%s' % (getos.GetPlatform(), tcname)
- elif arch == 'arm':
- return '%s_arm_%s' % (getos.GetPlatform(), tcname)
- else:
- return '%s_x86_%s' % (getos.GetPlatform(), tcname)
-
-
-def GetGypToolchainLib(tcname, arch):
- if arch == 'arm':
- toolchain = arch
- else:
- toolchain = tcname
-
- tcpath = os.path.join(GetNinjaOutDir(arch), 'gen', 'sdk',
- '%s_x86' % getos.GetPlatform(),
- TOOLCHAIN_PACKAGE_MAP[toolchain][0])
- return GetToolchainNaClLib(tcname, tcpath, arch)
-
def GetOutputToolchainLib(pepperdir, tcname, arch):
- tcpath = os.path.join(pepperdir, 'toolchain',
- GetToolchainDirName(tcname, arch))
+ tcpath = os.path.join(pepperdir, 'toolchain', GetToolchainDirName(tcname))
return GetToolchainNaClLib(tcname, tcpath, arch)
@@ -167,13 +166,9 @@ def GetPNaClTranslatorLib(tcpath, arch):
def BuildStepDownloadToolchains(toolchains):
buildbot_common.BuildStep('Running package_version.py')
args = [sys.executable, PKGVER, '--mode', 'nacl_core_sdk']
- if 'bionic' in toolchains:
+ if 'arm_bionic' in toolchains:
build_platform = '%s_x86' % getos.GetPlatform()
args.extend(['--append', os.path.join(build_platform, 'nacl_arm_bionic')])
- if getos.GetPlatform() == 'linux':
- # TODO(sbc): remove this once this change makes it into chrome
- # https://codereview.chromium.org/1080513003/
- args.extend(['--append', 'arm_trusted'])
args.extend(['sync', '--extract'])
buildbot_common.Run(args, cwd=NACL_DIR)
@@ -239,9 +234,9 @@ def BuildStepUntarToolchains(pepperdir, toolchains):
for toolchain in toolchains:
toolchain_map = TOOLCHAIN_PACKAGE_MAP.get(toolchain, None)
if toolchain_map:
- package_name, tcname = toolchain_map
+ package_name, tcdir, _ = toolchain_map
package_tuple = (os.path.join(build_platform, package_name),
- tcname % {'platform': platform})
+ tcdir % {'platform': platform})
extract_packages.append(package_tuple)
@@ -298,7 +293,6 @@ NACL_HEADER_MAP = {
'bionic': [
('ppapi/nacl_irt/public/irt_ppapi.h', ''),
],
- 'host': []
}
def InstallFiles(src_root, dest_root, file_list):
@@ -344,14 +338,9 @@ def InstallFiles(src_root, dest_root, file_list):
buildbot_common.CopyFile(source, dest)
-def InstallNaClHeaders(tc_dst_inc, tc_name):
+def InstallNaClHeaders(tc_dst_inc, tcname):
"""Copies NaCl headers to expected locations in the toolchain."""
- if tc_name in ('arm', 'pnacl'):
- # arm and pnacl toolchain headers should be the same as the newlib
- # ones
- tc_name = 'newlib'
-
- InstallFiles(SRC_DIR, tc_dst_inc, NACL_HEADER_MAP[tc_name])
+ InstallFiles(SRC_DIR, tc_dst_inc, NACL_HEADER_MAP[GetToolchainLibc(tcname)])
def MakeNinjaRelPath(path):
@@ -360,6 +349,7 @@ def MakeNinjaRelPath(path):
# TODO(ncbray): stop building and copying libraries into the SDK that are
# already provided by the toolchain.
+# Mapping from libc to libraries gyp-build trusted libraries
TOOLCHAIN_LIBS = {
'bionic' : [
'libminidump_generator.a',
@@ -392,17 +382,6 @@ TOOLCHAIN_LIBS = {
'libppapi.a',
'libppapi.so',
'libppapi_stub.a',
- ],
- 'pnacl': [
- 'libminidump_generator.a',
- 'libnacl.a',
- 'libnacl_dyncode.a',
- 'libnacl_exception.a',
- 'libnacl_list_mappings.a',
- 'libnosys.a',
- 'libppapi.a',
- 'libppapi_stub.a',
- 'libpthread.a',
]
}
@@ -461,23 +440,26 @@ def GypNinjaInstall(pepperdir, toolchains):
]
InstallFiles(GetNinjaOutDir('arm'), tools_dir, arm_files)
- for tc in set(toolchains) & set(['newlib', 'glibc', 'pnacl']):
- if tc == 'pnacl':
+ for tc in toolchains:
+ if tc in ('host', 'clang-newlib'):
+ continue
+ # TODO(sbc): remove this once untrusted.gypi can build arm glibc targets
+ elif tc == 'arm_glibc':
+ continue
+ elif tc == 'pnacl':
xarches = (None, 'ia32', 'x64', 'arm')
- elif tc == 'glibc':
+ elif tc in ('x86_glibc', 'x86_newlib'):
xarches = ('ia32', 'x64')
+ elif tc in ('arm_glibc', 'arm_newlib', 'arm_bionic'):
+ xarches = ('arm',)
else:
- xarches = ('arm', 'ia32', 'x64')
+ raise AssertionError('unexpected toolchain value: %s' % tc)
for xarch in xarches:
src_dir = GetGypBuiltLib(tc, xarch)
dst_dir = GetOutputToolchainLib(pepperdir, tc, xarch)
- InstallFiles(src_dir, dst_dir, TOOLCHAIN_LIBS[tc])
-
- # Copy ARM newlib components to bionic
- if tc == 'newlib' and xarch == 'arm' and 'bionic' in toolchains:
- bionic_dir = GetOutputToolchainLib(pepperdir, 'bionic', xarch)
- InstallFiles(src_dir, bionic_dir, TOOLCHAIN_LIBS['bionic'])
+ libc = GetToolchainLibc(tc)
+ InstallFiles(src_dir, dst_dir, TOOLCHAIN_LIBS[libc])
def GypNinjaBuild_NaCl(rel_out_dir):
@@ -548,7 +530,7 @@ def GypNinjaBuild_Pnacl(rel_out_dir, target_arch):
def GypNinjaBuild(arch, gyp_py_script, gyp_file, targets,
- out_dir, force_arm_gcc=True, gyp_defines=None):
+ out_dir, gyp_defines=None):
gyp_env = dict(os.environ)
gyp_env['GYP_GENERATORS'] = 'ninja'
gyp_defines = gyp_defines or []
@@ -562,10 +544,6 @@ def GypNinjaBuild(arch, gyp_py_script, gyp_file, targets,
gyp_defines.append('target_arch=%s' % arch)
if arch == 'arm':
gyp_env['GYP_CROSSCOMPILE'] = '1'
- # The arm glibc toolchain is currently having issues on windows.
- # TODO(sbc): remove this once we fix the issue
- # https://code.google.com/p/nativeclient/issues/detail?id=4225
- gyp_defines.append('disable_glibc=1')
if options.no_arm_trusted:
gyp_defines.append('disable_cross_trusted=1')
if getos.GetPlatform() == 'mac':
@@ -608,11 +586,11 @@ def BuildStepBuildToolchains(pepperdir, toolchains, build, clean):
GypNinjaBuild_NaCl(GYPBUILD_DIR)
GypNinjaBuild_Breakpad(GYPBUILD_DIR + '-x64')
- if set(toolchains) & set(['glibc', 'newlib']):
+ if set(toolchains) & set(['x86_glibc', 'x86_newlib']):
GypNinjaBuild_PPAPI('ia32', GYPBUILD_DIR + '-ia32')
GypNinjaBuild_PPAPI('x64', GYPBUILD_DIR + '-x64')
- if 'arm' in toolchains:
+ if set(toolchains) & set(['arm_glibc', 'arm_newlib']):
GypNinjaBuild_PPAPI('arm', GYPBUILD_DIR + '-arm')
if 'pnacl' in toolchains:
@@ -631,29 +609,11 @@ def BuildStepBuildToolchains(pepperdir, toolchains, build, clean):
GypNinjaInstall(pepperdir, toolchains)
- platform = getos.GetPlatform()
- newlibdir = os.path.join(pepperdir, 'toolchain', platform + '_x86_newlib')
- glibcdir = os.path.join(pepperdir, 'toolchain', platform + '_x86_glibc')
- armdir = os.path.join(pepperdir, 'toolchain', platform + '_arm_newlib')
- pnacldir = os.path.join(pepperdir, 'toolchain', platform + '_pnacl')
- bionicdir = os.path.join(pepperdir, 'toolchain', platform + '_arm_bionic')
-
-
- if 'newlib' in toolchains:
- InstallNaClHeaders(GetToolchainNaClInclude('newlib', newlibdir, 'x86'),
- 'newlib')
-
- if 'glibc' in toolchains:
- InstallNaClHeaders(GetToolchainNaClInclude('glibc', glibcdir, 'x86'),
- 'glibc')
-
- if 'arm' in toolchains:
- InstallNaClHeaders(GetToolchainNaClInclude('newlib', armdir, 'arm'),
- 'arm')
+ for toolchain in toolchains:
+ if toolchain not in ('host', 'clang-newlib'):
+ InstallNaClHeaders(GetToolchainNaClInclude(pepperdir, toolchain),
+ toolchain)
- if 'bionic' in toolchains:
- InstallNaClHeaders(GetToolchainNaClInclude('bionic', bionicdir, 'arm'),
- 'bionic')
if 'pnacl' in toolchains:
# NOTE: For ia32, gyp builds both x86-32 and x86-64 by default.
@@ -671,6 +631,7 @@ def BuildStepBuildToolchains(pepperdir, toolchains, build, clean):
'gen', 'tc_pnacl_translate',
'lib-' + nacl_arch)
+ pnacldir = GetToolchainDir(pepperdir, 'pnacl')
pnacl_translator_lib_dir = GetPNaClTranslatorLib(pnacldir, nacl_arch)
if not os.path.isdir(pnacl_translator_lib_dir):
buildbot_common.ErrorExit('Expected %s directory to exist.' %
@@ -680,11 +641,9 @@ def BuildStepBuildToolchains(pepperdir, toolchains, build, clean):
os.path.join(release_build_dir, 'libpnacl_irt_shim.a'),
pnacl_translator_lib_dir)
- InstallNaClHeaders(GetToolchainNaClInclude('pnacl', pnacldir, 'pnacl'),
- 'pnacl')
- InstallNaClHeaders(GetToolchainNaClInclude('pnacl', pnacldir, 'x86'),
+ InstallNaClHeaders(GetToolchainNaClInclude(pepperdir, 'pnacl', 'x86'),
'pnacl')
- InstallNaClHeaders(GetToolchainNaClInclude('pnacl', pnacldir, 'arm'),
+ InstallNaClHeaders(GetToolchainNaClInclude(pepperdir, 'pnacl', 'arm'),
'pnacl')
@@ -709,18 +668,18 @@ def BuildStepUpdateUserProjects(pepperdir, toolchains,
filters = {}
if not build_experimental:
filters['EXPERIMENTAL'] = False
- if toolchains:
- toolchains = toolchains[:]
- # arm isn't a valid toolchain for build_projects
- if 'arm' in toolchains:
- toolchains.remove('arm')
-
- if 'host' in toolchains:
- toolchains.remove('host')
- toolchains.append(getos.GetPlatform())
+ dsc_toolchains = []
+ for t in toolchains:
+ if t.startswith('x86_') or t.startswith('arm_'):
+ if t[4:] not in dsc_toolchains:
+ dsc_toolchains.append(t[4:])
+ elif t == 'host':
+ dsc_toolchains.append(getos.GetPlatform())
+ else:
+ dsc_toolchains.append(t)
- filters['TOOLS'] = toolchains
+ filters['TOOLS'] = dsc_toolchains
# Update examples and libraries
filters['DEST'] = [
@@ -733,7 +692,7 @@ def BuildStepUpdateUserProjects(pepperdir, toolchains,
tree = parse_dsc.LoadProjectTree(SDK_SRC_DIR, include=filters)
build_projects.UpdateProjects(pepperdir, tree, clobber=clobber,
- toolchains=toolchains)
+ toolchains=dsc_toolchains)
def BuildStepMakeAll(pepperdir, directory, step_name,
@@ -1060,11 +1019,12 @@ def main(args):
# NOTE: order matters here. This will be the order that is specified in the
# Makefiles; the first toolchain will be the default.
- toolchains = ['pnacl', 'newlib', 'glibc', 'arm', 'clang-newlib', 'host']
+ toolchains = ['pnacl', 'x86_newlib', 'x86_glibc', 'arm_newlib', 'arm_glibc',
+ 'clang-newlib', 'host']
# Changes for experimental bionic builder
if options.bionic:
- toolchains.append('bionic')
+ toolchains.append('arm_bionic')
options.build_ports = False
options.build_app_engine = False
@@ -1111,9 +1071,9 @@ def main(args):
BuildStepDownloadToolchains(toolchains)
if options.nacl_tree_path:
# Instead of untarring, copy the raw bionic toolchain
- not_bionic = [i for i in toolchains if i != 'bionic']
+ not_bionic = [i for i in toolchains if i != 'arm_bionic']
BuildStepUntarToolchains(pepperdir, not_bionic)
- tcname = GetToolchainDirName('bionic', 'arm')
+ tcname = GetToolchainDirName('arm_bionic')
srcdir = os.path.join(toolchain_build, 'out', tcname)
bionicdir = os.path.join(pepperdir, 'toolchain', tcname)
oshelpers.Copy(['-r', srcdir, bionicdir])
diff --git a/native_client_sdk/src/build_tools/parse_dsc.py b/native_client_sdk/src/build_tools/parse_dsc.py
index 2374915..2fda59b 100755
--- a/native_client_sdk/src/build_tools/parse_dsc.py
+++ b/native_client_sdk/src/build_tools/parse_dsc.py
@@ -227,7 +227,7 @@ def DescMatchesFilter(desc, filters):
value = desc.get(key, False)
# If we provide an expected list, match at least one
- if type(expected) != list:
+ if type(expected) not in (list, tuple):
expected = set([expected])
if type(value) != list:
value = set([value])
diff --git a/native_client_sdk/src/build_tools/sdk_files.list b/native_client_sdk/src/build_tools/sdk_files.list
index 36b391a..e609dab 100644
--- a/native_client_sdk/src/build_tools/sdk_files.list
+++ b/native_client_sdk/src/build_tools/sdk_files.list
@@ -58,6 +58,8 @@ getting_started/part2/*
getting_started/README
include/error_handling/*
include/GLES2/*
+include/glibc/bits/*
+include/glibc/sys/mount.h
include/gmock/*
include/gmock/internal/*
include/gtest/*
@@ -389,6 +391,7 @@ src/ppapi_simple_cpp/*
[win]src/pthread/*
[win]src/pthread/README
src/sdk_util/*
+toolchain/${PLATFORM}_arm_glibc/*
toolchain/${PLATFORM}_arm_newlib/*
toolchain/${PLATFORM}_arm_newlib/arm-nacl/include/irt.h
toolchain/${PLATFORM}_arm_newlib/arm-nacl/include/irt_dev.h
diff --git a/native_client_sdk/src/libraries/nacl_io/devfs/tty_node.cc b/native_client_sdk/src/libraries/nacl_io/devfs/tty_node.cc
index 445d485..4d9676a 100644
--- a/native_client_sdk/src/libraries/nacl_io/devfs/tty_node.cc
+++ b/native_client_sdk/src/libraries/nacl_io/devfs/tty_node.cc
@@ -49,12 +49,15 @@ TtyNode::TtyNode(Filesystem* filesystem)
void TtyNode::InitTermios() {
// Some sane values that produce good result.
- termios_.c_iflag = ICRNL | IXON | IXOFF | IUTF8;
+ termios_.c_iflag = ICRNL | IXON | IXOFF;
+#ifdef IUTF8
+ termios_.c_iflag |= IUTF8;
+#endif
termios_.c_oflag = OPOST | ONLCR;
termios_.c_cflag = CREAD | 077;
termios_.c_lflag =
ISIG | ICANON | ECHO | ECHOE | ECHOK | ECHOCTL | ECHOKE | IEXTEN;
-#if !defined(__BIONIC__)
+#if !defined(__BIONIC__) && !(defined(__GLIBC__) && defined(__arm__))
termios_.c_ispeed = B38400;
termios_.c_ospeed = B38400;
#endif
diff --git a/native_client_sdk/src/libraries/nacl_io/include/bits/ioctls.h b/native_client_sdk/src/libraries/nacl_io/include/bits/ioctls.h
new file mode 100644
index 0000000..7a4de32
--- /dev/null
+++ b/native_client_sdk/src/libraries/nacl_io/include/bits/ioctls.h
@@ -0,0 +1,16 @@
+/* Copyright 2015 The Chromium Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file. */
+
+#ifndef _SYS_IOCTL_H
+# error "Never use <bits/ioctls.h> directly; include <sys/ioctl.h> instead."
+#endif
+
+/*
+ * This file overrides the default bits/ioctls.h that we ship with the
+ * glibc toolchain. With the arm version of the toolchain this file is
+ * deliberately left empty, but nacl_io requires these ioctl to be defined.
+ */
+
+#define TIOCGWINSZ 0x5413
+#define TIOCSWINSZ 0x5414
diff --git a/native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc b/native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc
index 5329f60..b510f05 100644
--- a/native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc
+++ b/native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc
@@ -1136,11 +1136,13 @@ int KernelProxy::kill(pid_t pid, int sig) {
int KernelProxy::sigaction(int signum,
const struct sigaction* action,
struct sigaction* oaction) {
+#if defined(SA_SIGINFO)
if (action && action->sa_flags & SA_SIGINFO) {
// We don't support SA_SIGINFO (sa_sigaction field) yet
errno = EINVAL;
return -1;
}
+#endif
switch (signum) {
// Handled signals.
diff --git a/native_client_sdk/src/libraries/nacl_io/kernel_wrap_glibc.cc b/native_client_sdk/src/libraries/nacl_io/kernel_wrap_glibc.cc
index 158c52a..da9feea 100644
--- a/native_client_sdk/src/libraries/nacl_io/kernel_wrap_glibc.cc
+++ b/native_client_sdk/src/libraries/nacl_io/kernel_wrap_glibc.cc
@@ -6,7 +6,9 @@
// The entire file is wrapped in this #if. We do this so this .cc file can be
// compiled, even on a non-glibc build.
-#if defined(__native_client__) && defined(__GLIBC__)
+// The ARM glibc toolchain uses a different IRT hooks mechanism and is not
+// yet supported by nacl_io.
+#if defined(__native_client__) && defined(__GLIBC__) && !defined(__arm__)
#include "nacl_io/kernel_wrap.h"
diff --git a/native_client_sdk/src/libraries/nacl_io/library.dsc b/native_client_sdk/src/libraries/nacl_io/library.dsc
index 3c67053..ac2b8ef 100644
--- a/native_client_sdk/src/libraries/nacl_io/library.dsc
+++ b/native_client_sdk/src/libraries/nacl_io/library.dsc
@@ -238,6 +238,13 @@
},
{
'FILES': [
+ "bits/ioctls.h",
+ "sys/mount.h",
+ ],
+ 'DEST': 'include/glibc',
+ },
+ {
+ 'FILES': [
"arpa/inet.h",
"memory.h",
"netdb.h",
diff --git a/native_client_sdk/src/libraries/nacl_io/ossignal.h b/native_client_sdk/src/libraries/nacl_io/ossignal.h
index 8313fc5..ed2f0593 100644
--- a/native_client_sdk/src/libraries/nacl_io/ossignal.h
+++ b/native_client_sdk/src/libraries/nacl_io/ossignal.h
@@ -7,6 +7,11 @@
#if !defined(WIN23)
#include <signal.h>
+
+#if defined(__arm__) && defined(__GLIBC__)
+#define SIGWINCH 38
+#endif
+
#if defined(__APPLE__)
typedef void (*sighandler_t)(int);
#elif defined(__GLIBC__) || defined(__BIONIC__)
@@ -14,6 +19,6 @@ typedef __sighandler_t sighandler_t;
#else
typedef _sig_func_ptr sighandler_t;
#endif
-#endif
+#endif /* !WIN23 */
#endif /* LIBRARIES_NACL_IO_OSSIGNAL_H_ */
diff --git a/native_client_sdk/src/libraries/ppapi_simple/library.dsc b/native_client_sdk/src/libraries/ppapi_simple/library.dsc
index e931da18..691a79c 100644
--- a/native_client_sdk/src/libraries/ppapi_simple/library.dsc
+++ b/native_client_sdk/src/libraries/ppapi_simple/library.dsc
@@ -4,6 +4,8 @@
{
'NAME' : 'ppapi_simple',
'TYPE' : 'lib',
+ 'LIBS': ['nacl_io'],
+ 'DEPS': ['nacl_io'],
'SOURCES' : [
"ps.c",
"ps_context_2d.c",
diff --git a/native_client_sdk/src/tools/nacl_config.py b/native_client_sdk/src/tools/nacl_config.py
index 146563b..07fe263 100755
--- a/native_client_sdk/src/tools/nacl_config.py
+++ b/native_client_sdk/src/tools/nacl_config.py
@@ -118,10 +118,6 @@ def CheckValidToolchainArch(toolchain, arch, arch_required=False):
else:
ExpectArch(arch, VALID_ARCHES)
- if arch == 'arm':
- Expect(toolchain in ['newlib', 'bionic', 'clang-newlib'],
- 'The arm arch only supports newlib.')
-
def GetArchName(arch):
return ARCH_NAME.get(arch)
diff --git a/native_client_sdk/src/tools/nacl_gcc.mk b/native_client_sdk/src/tools/nacl_gcc.mk
index 20d0d1b..34fd0e0 100644
--- a/native_client_sdk/src/tools/nacl_gcc.mk
+++ b/native_client_sdk/src/tools/nacl_gcc.mk
@@ -30,6 +30,10 @@ ifneq (,$(findstring $(TOOLCHAIN),newlib bionic clang-newlib))
ARM_SUPPORT=1
endif
+ifdef ENABLE_ARM_GLIBC
+ARM_SUPPORT=1
+endif
+
ifeq ($(ARM_SUPPORT),1)
ARM_CC := $(NACL_COMPILER_PREFIX) $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a arm --tool=cc)
ARM_CXX := $(NACL_COMPILER_PREFIX) $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a arm --tool=c++)
@@ -541,8 +545,11 @@ endef
#
ifeq (x86_32,$(SYSARCH))
LIB_NAME = lib32
-else
+ifeq (x86_64,$(SYSARCH))
LIB_NAME = lib64
+else
+LIB_NAME = lib
+endif
endif
diff --git a/native_client_sdk/src/tools/tests/nacl_config_test.py b/native_client_sdk/src/tools/tests/nacl_config_test.py
index b0cbe26..b240ece 100755
--- a/native_client_sdk/src/tools/tests/nacl_config_test.py
+++ b/native_client_sdk/src/tools/tests/nacl_config_test.py
@@ -88,6 +88,8 @@ class TestNaclConfig(unittest.TestCase):
('newlib', 'arm'):
'/sdk_root/toolchain/mac_arm_newlib/bin/arm-nacl-%s' % nacl_tool,
+ ('glibc', 'arm'):
+ '/sdk_root/toolchain/mac_arm_glibc/bin/arm-nacl-%s' % nacl_tool,
('glibc', 'x86_32'):
'/sdk_root/toolchain/mac_x86_glibc/bin/i686-nacl-%s' % nacl_tool,
('glibc', 'x86_64'):
@@ -117,10 +119,6 @@ class TestNaclConfig(unittest.TestCase):
self.assertRaises(nacl_config.Error,
nacl_config.GetToolPath, toolchain, arch, tool)
- # No arm glibc.
- self.assertRaises(nacl_config.Error,
- nacl_config.GetToolPath, 'glibc', 'arm', tool)
-
def testCC(self):
self._TestTool('cc', 'gcc', 'clang')