diff options
32 files changed, 110 insertions, 66 deletions
diff --git a/native_client_sdk/src/build_tools/build_sdk.py b/native_client_sdk/src/build_tools/build_sdk.py index 64ded61..6bf3b22 100755 --- a/native_client_sdk/src/build_tools/build_sdk.py +++ b/native_client_sdk/src/build_tools/build_sdk.py @@ -448,9 +448,6 @@ def GypNinjaInstall(pepperdir, toolchains): 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 in ('x86_glibc', 'x86_newlib'): diff --git a/native_client_sdk/src/build_tools/sdk_files.list b/native_client_sdk/src/build_tools/sdk_files.list index e609dab..3a321a8 100644 --- a/native_client_sdk/src/build_tools/sdk_files.list +++ b/native_client_sdk/src/build_tools/sdk_files.list @@ -59,6 +59,7 @@ getting_started/README include/error_handling/* include/GLES2/* include/glibc/bits/* +include/glibc/rpc/netdb.h include/glibc/sys/mount.h include/gmock/* include/gmock/internal/* @@ -203,6 +204,46 @@ lib/clang-newlib_x86_64/Release/libppapi_gles2.a lib/clang-newlib_x86_64/Release/libppapi_simple.a lib/clang-newlib_x86_64/Release/libppapi_simple_cpp.a lib/clang-newlib_x86_64/Release/libsdk_util.a +lib/glibc_arm/Debug/libgmock.a +lib/glibc_arm/Debug/libgmock.so +lib/glibc_arm/Debug/libgtest.a +lib/glibc_arm/Debug/libgtest.so +lib/glibc_arm/Debug/libjsoncpp.a +lib/glibc_arm/Debug/libjsoncpp.so +lib/glibc_arm/Debug/libnacl_io.a +lib/glibc_arm/Debug/libnacl_io.so +lib/glibc_arm/Debug/libppapi_cpp.a +lib/glibc_arm/Debug/libppapi_cpp.so +lib/glibc_arm/Debug/libppapi_cpp_private.a +lib/glibc_arm/Debug/libppapi_cpp_private.so +lib/glibc_arm/Debug/libppapi_gles2.a +lib/glibc_arm/Debug/libppapi_gles2.so +lib/glibc_arm/Debug/libppapi_simple.a +lib/glibc_arm/Debug/libppapi_simple.so +lib/glibc_arm/Debug/libppapi_simple_cpp.a +lib/glibc_arm/Debug/libppapi_simple_cpp.so +lib/glibc_arm/Debug/libsdk_util.a +lib/glibc_arm/Debug/libsdk_util.so +lib/glibc_arm/Release/libgmock.a +lib/glibc_arm/Release/libgmock.so +lib/glibc_arm/Release/libgtest.a +lib/glibc_arm/Release/libgtest.so +lib/glibc_arm/Release/libjsoncpp.a +lib/glibc_arm/Release/libjsoncpp.so +lib/glibc_arm/Release/libnacl_io.a +lib/glibc_arm/Release/libnacl_io.so +lib/glibc_arm/Release/libppapi_cpp.a +lib/glibc_arm/Release/libppapi_cpp.so +lib/glibc_arm/Release/libppapi_cpp_private.a +lib/glibc_arm/Release/libppapi_cpp_private.so +lib/glibc_arm/Release/libppapi_gles2.a +lib/glibc_arm/Release/libppapi_gles2.so +lib/glibc_arm/Release/libppapi_simple.a +lib/glibc_arm/Release/libppapi_simple.so +lib/glibc_arm/Release/libppapi_simple_cpp.a +lib/glibc_arm/Release/libppapi_simple_cpp.so +lib/glibc_arm/Release/libsdk_util.a +lib/glibc_arm/Release/libsdk_util.so lib/glibc_x86_32/Debug/libgmock.a lib/glibc_x86_32/Debug/libgmock.so lib/glibc_x86_32/Debug/libgtest.a diff --git a/native_client_sdk/src/libraries/nacl_io/kernel_wrap.h b/native_client_sdk/src/libraries/nacl_io/kernel_wrap.h index 98a071f..d14fea7 100644 --- a/native_client_sdk/src/libraries/nacl_io/kernel_wrap.h +++ b/native_client_sdk/src/libraries/nacl_io/kernel_wrap.h @@ -19,9 +19,17 @@ #include "nacl_io/osutime.h" #include "sdk_util/macros.h" -// Curently enable NaCl IO IRT Extension when using arm glibc (which +#if defined(__native_client__) && defined(__GLIBC__) +#if __GLIBC__ == 2 && __GLIBC_MINOR__ == 9 +#define NACL_GLIBC_OLD +#else +#define NACL_GLIBC_NEW +#endif +#endif + +// Curently enable NaCl IO IRT Extension when using newer glibc (which // only supports this method interception). -#if defined(__native_client__) && defined(__GLIBC__) && defined(__arm__) +#if defined(NACL_GLIBC_NEW) # define NACL_IO_IRT_EXT 1 #endif diff --git a/native_client_sdk/src/libraries/nacl_io/library.dsc b/native_client_sdk/src/libraries/nacl_io/library.dsc index 7150cb2..40aa14a 100644 --- a/native_client_sdk/src/libraries/nacl_io/library.dsc +++ b/native_client_sdk/src/libraries/nacl_io/library.dsc @@ -240,6 +240,7 @@ { 'FILES': [ "bits/ioctls.h", + "rpc/netdb.h", "sys/mount.h", ], 'DEST': 'include/glibc', diff --git a/native_client_sdk/src/libraries/nacl_io/rpc/netdb.h b/native_client_sdk/src/libraries/nacl_io/rpc/netdb.h new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/native_client_sdk/src/libraries/nacl_io/rpc/netdb.h diff --git a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/accept.c b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/accept.c index 1536cc8..0381a38 100644 --- a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/accept.c +++ b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/accept.c @@ -5,10 +5,10 @@ #include "nacl_io/kernel_intercept.h" #include "nacl_io/kernel_wrap.h" -#if defined(PROVIDES_SOCKET_API) && !defined(__GLIBC__) +#if defined(PROVIDES_SOCKET_API) && !defined(NACL_GLIBC_OLD) int accept(int fd, struct sockaddr* addr, socklen_t* len) { return ki_accept(fd, addr, len); } -#endif /* defined(PROVIDES_SOCKET_API) && !defined(__GLIBC__) */ +#endif /* defined(PROVIDES_SOCKET_API) && !defined(NACL_GLIBC_OLD) */ diff --git a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/bind.c b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/bind.c index cb48d4c..afaa0c8 100644 --- a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/bind.c +++ b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/bind.c @@ -5,10 +5,10 @@ #include "nacl_io/kernel_intercept.h" #include "nacl_io/kernel_wrap.h" -#if defined(PROVIDES_SOCKET_API) && !defined(__GLIBC__) +#if defined(PROVIDES_SOCKET_API) && !defined(NACL_GLIBC_OLD) int bind(int fd, const struct sockaddr* addr, socklen_t len) { return ki_bind(fd, addr, len); } -#endif /* defined(PROVIDES_SOCKET_API) && !defined(__GLIBC__) */ +#endif /* defined(PROVIDES_SOCKET_API) && !defined(NACL_GLIBC_OLD) */ diff --git a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/connect.c b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/connect.c index 46f083f..f0ff924 100644 --- a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/connect.c +++ b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/connect.c @@ -5,10 +5,10 @@ #include "nacl_io/kernel_intercept.h" #include "nacl_io/kernel_wrap.h" -#if defined(PROVIDES_SOCKET_API) && !defined(__GLIBC__) +#if defined(PROVIDES_SOCKET_API) && !defined(NACL_GLIBC_OLD) int connect(int fd, const struct sockaddr* addr, socklen_t len) { return ki_connect(fd, addr, len); } -#endif /* defined(PROVIDES_SOCKET_API) && !defined(__GLIBC__) */ +#endif /* defined(PROVIDES_SOCKET_API) && !defined(NACL_GLIBC_OLD) */ diff --git a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/gai_strerror.c b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/gai_strerror.c index db581b4..23521e1 100644 --- a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/gai_strerror.c +++ b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/gai_strerror.c @@ -8,8 +8,8 @@ #include <stdio.h> -#if !defined(__GLIBC__) -#if defined(__BIONIC__) || defined(__APPLE__) +#if !defined(NACL_GLIBC_OLD) +#if !defined(_NEWLIB_VERSION) const #endif char* gai_strerror(int errcode) { diff --git a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/getnameinfo.c b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/getnameinfo.c index 78794eb..7204eb4 100644 --- a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/getnameinfo.c +++ b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/getnameinfo.c @@ -10,6 +10,10 @@ // bionic has a slightly different signatute to glibc for getnameinfo int getnameinfo(const struct sockaddr* sa, socklen_t salen, char* host, size_t hostlen, char* serv, size_t servlen, int flags) { +#elif defined(NACL_GLIBC_NEW) +int getnameinfo(const struct sockaddr* sa, socklen_t salen, char* host, + socklen_t hostlen, char* serv, socklen_t servlen, + int flags) { #else int getnameinfo(const struct sockaddr* sa, socklen_t salen, char* host, socklen_t hostlen, char* serv, socklen_t servlen, diff --git a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/getpeername.c b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/getpeername.c index c700e69..39a3e24 100644 --- a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/getpeername.c +++ b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/getpeername.c @@ -5,10 +5,10 @@ #include "nacl_io/kernel_intercept.h" #include "nacl_io/kernel_wrap.h" -#if defined(PROVIDES_SOCKET_API) && !defined(__GLIBC__) +#if defined(PROVIDES_SOCKET_API) && !defined(NACL_GLIBC_OLD) int getpeername(int fd, struct sockaddr* addr, socklen_t* len) { return ki_getpeername(fd, addr, len); } -#endif /* defined(PROVIDES_SOCKET_API) && !defined(__GLIBC__) */ +#endif /* defined(PROVIDES_SOCKET_API) && !defined(NACL_GLIBC_OLD) */ diff --git a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/getsockname.c b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/getsockname.c index 6f9d1ee..eb36d0c 100644 --- a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/getsockname.c +++ b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/getsockname.c @@ -5,10 +5,10 @@ #include "nacl_io/kernel_intercept.h" #include "nacl_io/kernel_wrap.h" -#if defined(PROVIDES_SOCKET_API) && !defined(__GLIBC__) +#if defined(PROVIDES_SOCKET_API) && !defined(NACL_GLIBC_OLD) int getsockname(int fd, struct sockaddr* addr, socklen_t* len) { return ki_getsockname(fd, addr, len); } -#endif /* defined(PROVIDES_SOCKET_API) && !defined(__GLIBC__) */ +#endif /* defined(PROVIDES_SOCKET_API) && !defined(NACL_GLIBC_OLD) */ diff --git a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/getsockopt.c b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/getsockopt.c index c5ef7f7..4deec3c 100644 --- a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/getsockopt.c +++ b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/getsockopt.c @@ -5,10 +5,10 @@ #include "nacl_io/kernel_intercept.h" #include "nacl_io/kernel_wrap.h" -#if defined(PROVIDES_SOCKET_API) && !defined(__GLIBC__) +#if defined(PROVIDES_SOCKET_API) && !defined(NACL_GLIBC_OLD) int getsockopt(int fd, int lvl, int optname, void* optval, socklen_t* len) { return ki_getsockopt(fd, lvl, optname, optval, len); } -#endif /* defined(PROVIDES_SOCKET_API) && !defined(__GLIBC__) */ +#endif /* defined(PROVIDES_SOCKET_API) && !defined(NACL_GLIBC_OLD) */ diff --git a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/listen.c b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/listen.c index 06f7d0c..e7f31fa 100644 --- a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/listen.c +++ b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/listen.c @@ -5,10 +5,10 @@ #include "nacl_io/kernel_intercept.h" #include "nacl_io/kernel_wrap.h" -#if defined(PROVIDES_SOCKET_API) && !defined(__GLIBC__) +#if defined(PROVIDES_SOCKET_API) && !defined(NACL_GLIBC_OLD) int listen(int fd, int backlog) { return ki_listen(fd, backlog); } -#endif /* defined(PROVIDES_SOCKET_API) && !defined(__GLIBC__) */ +#endif /* defined(PROVIDES_SOCKET_API) && !defined(NACL_GLIBC_OLD) */ diff --git a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/recv.c b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/recv.c index c22c0e4..e58ee36 100644 --- a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/recv.c +++ b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/recv.c @@ -5,10 +5,10 @@ #include "nacl_io/kernel_intercept.h" #include "nacl_io/kernel_wrap.h" -#if defined(PROVIDES_SOCKET_API) && !defined(__GLIBC__) +#if defined(PROVIDES_SOCKET_API) && !defined(NACL_GLIBC_OLD) ssize_t recv(int fd, void* buf, size_t len, int flags) { return ki_recv(fd, buf, len, flags); } -#endif /* defined(PROVIDES_SOCKET_API) && !defined(__GLIBC__) */ +#endif /* defined(PROVIDES_SOCKET_API) && !defined(NACL_GLIBC_OLD) */ diff --git a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/recvfrom.c b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/recvfrom.c index 1cacabc..7a907f3 100644 --- a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/recvfrom.c +++ b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/recvfrom.c @@ -5,11 +5,11 @@ #include "nacl_io/kernel_intercept.h" #include "nacl_io/kernel_wrap.h" -#if defined(PROVIDES_SOCKET_API) && !defined(__GLIBC__) +#if defined(PROVIDES_SOCKET_API) && !defined(NACL_GLIBC_OLD) ssize_t recvfrom(int fd, void* buf, size_t len, int flags, struct sockaddr* addr, socklen_t* addrlen) { return ki_recvfrom(fd, buf, len, flags, addr, addrlen); } -#endif /* defined(PROVIDES_SOCKET_API) && !defined(__GLIBC__) */ +#endif /* defined(PROVIDES_SOCKET_API) && !defined(NACL_GLIBC_OLD) */ diff --git a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/recvmsg.c b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/recvmsg.c index d165b16..7dad260 100644 --- a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/recvmsg.c +++ b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/recvmsg.c @@ -5,10 +5,10 @@ #include "nacl_io/kernel_intercept.h" #include "nacl_io/kernel_wrap.h" -#if defined(PROVIDES_SOCKET_API) && !defined(__GLIBC__) +#if defined(PROVIDES_SOCKET_API) && !defined(NACL_GLIBC_OLD) ssize_t recvmsg(int fd, struct msghdr* msg, int flags) { return ki_recvmsg(fd, msg, flags); } -#endif /* defined(PROVIDES_SOCKET_API) && !defined(__GLIBC__) */ +#endif /* defined(PROVIDES_SOCKET_API) && !defined(NACL_GLIBC_OLD) */ diff --git a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/send.c b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/send.c index 92a367c..abc87e1 100644 --- a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/send.c +++ b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/send.c @@ -5,10 +5,10 @@ #include "nacl_io/kernel_intercept.h" #include "nacl_io/kernel_wrap.h" -#if defined(PROVIDES_SOCKET_API) && !defined(__GLIBC__) +#if defined(PROVIDES_SOCKET_API) && !defined(NACL_GLIBC_OLD) ssize_t send(int fd, const void* buf, size_t len, int flags) { return ki_send(fd, buf, len, flags); } -#endif /* defined(PROVIDES_SOCKET_API) && !defined(__GLIBC__) */ +#endif /* defined(PROVIDES_SOCKET_API) && !defined(NACL_GLIBC_OLD) */ diff --git a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/sendmsg.c b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/sendmsg.c index 830d43c..b120847 100644 --- a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/sendmsg.c +++ b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/sendmsg.c @@ -5,10 +5,10 @@ #include "nacl_io/kernel_intercept.h" #include "nacl_io/kernel_wrap.h" -#if defined(PROVIDES_SOCKET_API) && !defined(__GLIBC__) +#if defined(PROVIDES_SOCKET_API) && !defined(NACL_GLIBC_OLD) ssize_t sendmsg(int fd, const struct msghdr* msg, int flags) { return ki_sendmsg(fd, msg, flags); } -#endif /* defined(PROVIDES_SOCKET_API) && !defined(__GLIBC__) */ +#endif /* defined(PROVIDES_SOCKET_API) && !defined(NACL_GLIBC_OLD) */ diff --git a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/sendto.c b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/sendto.c index 03c6242..cbab2d3 100644 --- a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/sendto.c +++ b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/sendto.c @@ -5,11 +5,11 @@ #include "nacl_io/kernel_intercept.h" #include "nacl_io/kernel_wrap.h" -#if defined(PROVIDES_SOCKET_API) && !defined(__GLIBC__) +#if defined(PROVIDES_SOCKET_API) && !defined(NACL_GLIBC_OLD) ssize_t sendto(int fd, const void* buf, size_t len, int flags, const struct sockaddr* addr, socklen_t addrlen) { return ki_sendto(fd, buf, len, flags, addr, addrlen); } -#endif /* defined(PROVIDES_SOCKET_API) && !defined(__GLIBC__) */ +#endif /* defined(PROVIDES_SOCKET_API) && !defined(NACL_GLIBC_OLD) */ diff --git a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/setsockopt.c b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/setsockopt.c index e273a41..302c6a5 100644 --- a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/setsockopt.c +++ b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/setsockopt.c @@ -5,11 +5,11 @@ #include "nacl_io/kernel_intercept.h" #include "nacl_io/kernel_wrap.h" -#if defined(PROVIDES_SOCKET_API) && !defined(__GLIBC__) +#if defined(PROVIDES_SOCKET_API) && !defined(NACL_GLIBC_OLD) int setsockopt(int fd, int lvl, int optname, const void* optval, socklen_t len) { return ki_setsockopt(fd, lvl, optname, optval, len); } -#endif /* defined(PROVIDES_SOCKET_API) && !defined(__GLIBC__) */ +#endif /* defined(PROVIDES_SOCKET_API) && !defined(NACL_GLIBC_OLD) */ diff --git a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/shutdown.c b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/shutdown.c index e6e213b..0ec862a 100644 --- a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/shutdown.c +++ b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/shutdown.c @@ -5,10 +5,10 @@ #include "nacl_io/kernel_intercept.h" #include "nacl_io/kernel_wrap.h" -#if defined(PROVIDES_SOCKET_API) && !defined(__GLIBC__) +#if defined(PROVIDES_SOCKET_API) && !defined(NACL_GLIBC_OLD) int shutdown(int fd, int how) { return ki_shutdown(fd, how); } -#endif /* defined(PROVIDES_SOCKET_API) && !defined(__GLIBC__) */ +#endif /* defined(PROVIDES_SOCKET_API) && !defined(NACL_GLIBC_OLD) */ diff --git a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/socket.c b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/socket.c index 3c1dad7..9851b33 100644 --- a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/socket.c +++ b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/socket.c @@ -5,10 +5,10 @@ #include "nacl_io/kernel_intercept.h" #include "nacl_io/kernel_wrap.h" -#if defined(PROVIDES_SOCKET_API) && !defined(__GLIBC__) +#if defined(PROVIDES_SOCKET_API) && !defined(NACL_GLIBC_OLD) int socket(int domain, int type, int protocol) { return ki_socket(domain, type, protocol); } -#endif /* defined(PROVIDES_SOCKET_API) && !defined(__GLIBC__) */ +#endif /* defined(PROVIDES_SOCKET_API) && !defined(NACL_GLIBC_OLD) */ diff --git a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/socketpair.c b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/socketpair.c index 1e7a4d7..716dda8 100644 --- a/native_client_sdk/src/libraries/nacl_io/syscalls/socket/socketpair.c +++ b/native_client_sdk/src/libraries/nacl_io/syscalls/socket/socketpair.c @@ -5,10 +5,10 @@ #include "nacl_io/kernel_intercept.h" #include "nacl_io/kernel_wrap.h" -#if defined(PROVIDES_SOCKET_API) && !defined(__GLIBC__) +#if defined(PROVIDES_SOCKET_API) && !defined(NACL_GLIBC_OLD) int socketpair(int domain, int type, int protocol, int* sv) { return ki_socketpair(domain, type, protocol, sv); } -#endif /* defined(PROVIDES_SOCKET_API) && !defined(__GLIBC__) */ +#endif /* defined(PROVIDES_SOCKET_API) && !defined(NACL_GLIBC_OLD) */ diff --git a/native_client_sdk/src/libraries/nacl_io/syscalls/termios/cfgetispeed.c b/native_client_sdk/src/libraries/nacl_io/syscalls/termios/cfgetispeed.c index 2d66d7e..581e9e5 100644 --- a/native_client_sdk/src/libraries/nacl_io/syscalls/termios/cfgetispeed.c +++ b/native_client_sdk/src/libraries/nacl_io/syscalls/termios/cfgetispeed.c @@ -8,7 +8,7 @@ * in this #if, so this file will be compiled on a non-bionic build. */ -#if !defined(__BIONIC__) +#if !defined(__BIONIC__) && !(defined(__GLIBC__) && defined(__arm__)) #include "nacl_io/kernel_intercept.h" #include "nacl_io/kernel_wrap.h" @@ -17,4 +17,4 @@ speed_t cfgetispeed(const struct termios *termios_p) { return termios_p->c_ispeed; } -#endif /* #if !defined(__BIONIC_) */
\ No newline at end of file +#endif /* #if !defined(__BIONIC_) */ diff --git a/native_client_sdk/src/libraries/nacl_io/syscalls/termios/cfgetospeed.c b/native_client_sdk/src/libraries/nacl_io/syscalls/termios/cfgetospeed.c index 55eb2b5..fb019db 100644 --- a/native_client_sdk/src/libraries/nacl_io/syscalls/termios/cfgetospeed.c +++ b/native_client_sdk/src/libraries/nacl_io/syscalls/termios/cfgetospeed.c @@ -8,7 +8,7 @@ * in this #if, so this file will be compiled on a non-bionic build. */ -#if !defined(__BIONIC__) +#if !defined(__BIONIC__) && !(defined(__GLIBC__) && defined(__arm__)) #include "nacl_io/kernel_intercept.h" #include "nacl_io/kernel_wrap.h" @@ -17,4 +17,4 @@ speed_t cfgetospeed(const struct termios *termios_p) { return termios_p->c_ospeed; } -#endif /* #if !defined(__BIONIC_) */
\ No newline at end of file +#endif /* #if !defined(__BIONIC_) */ diff --git a/native_client_sdk/src/libraries/nacl_io/syscalls/termios/cfsetispeed.c b/native_client_sdk/src/libraries/nacl_io/syscalls/termios/cfsetispeed.c index 1ebc379..fcdaa30 100644 --- a/native_client_sdk/src/libraries/nacl_io/syscalls/termios/cfsetispeed.c +++ b/native_client_sdk/src/libraries/nacl_io/syscalls/termios/cfsetispeed.c @@ -8,7 +8,8 @@ * in this #if, so this file will be compiled on a non-bionic build. */ -#if !defined(__BIONIC__) +#if !defined(__BIONIC__) && !(defined(__GLIBC__) && defined(__arm__)) + #include "nacl_io/kernel_intercept.h" #include "nacl_io/kernel_wrap.h" @@ -17,4 +18,4 @@ int cfsetispeed(struct termios *termios_p, speed_t speed) { return 0; } -#endif /* #if !defined(__BIONIC_) */
\ No newline at end of file +#endif /* #if !defined(__BIONIC_) */ diff --git a/native_client_sdk/src/libraries/nacl_io/syscalls/termios/cfsetospeed.c b/native_client_sdk/src/libraries/nacl_io/syscalls/termios/cfsetospeed.c index ed7a678..d2e2677 100644 --- a/native_client_sdk/src/libraries/nacl_io/syscalls/termios/cfsetospeed.c +++ b/native_client_sdk/src/libraries/nacl_io/syscalls/termios/cfsetospeed.c @@ -8,7 +8,7 @@ * in this #if, so this file will be compiled on a non-bionic build. */ -#if !defined(__BIONIC__) +#if !defined(__BIONIC__) && !(defined(__GLIBC__) && defined(__arm__)) #include "nacl_io/kernel_intercept.h" #include "nacl_io/kernel_wrap.h" @@ -18,4 +18,4 @@ int cfsetospeed(struct termios *termios_p, speed_t speed) { return 0; } -#endif /* #if !defined(__BIONIC_) */
\ No newline at end of file +#endif /* #if !defined(__BIONIC_) */ diff --git a/native_client_sdk/src/libraries/nacl_io/syscalls/termios/cfsetspeed.c b/native_client_sdk/src/libraries/nacl_io/syscalls/termios/cfsetspeed.c index ecac8d7..caa5674 100644 --- a/native_client_sdk/src/libraries/nacl_io/syscalls/termios/cfsetspeed.c +++ b/native_client_sdk/src/libraries/nacl_io/syscalls/termios/cfsetspeed.c @@ -8,7 +8,7 @@ * in this #if, so this file will be compiled on a non-bionic build. */ -#if !defined(__BIONIC__) +#if !defined(__BIONIC__) && !(defined(__GLIBC__) && defined(__arm__)) #include "nacl_io/kernel_intercept.h" #include "nacl_io/kernel_wrap.h" @@ -19,4 +19,4 @@ int cfsetspeed(struct termios *termios_p, speed_t speed) { return 0; } -#endif /* #if !defined(__BIONIC_) */
\ No newline at end of file +#endif /* #if !defined(__BIONIC_) */ diff --git a/native_client_sdk/src/tools/create_nmf.py b/native_client_sdk/src/tools/create_nmf.py index c854fe1..3a2d2e8 100755 --- a/native_client_sdk/src/tools/create_nmf.py +++ b/native_client_sdk/src/tools/create_nmf.py @@ -510,15 +510,19 @@ def GetDefaultLibPath(config): # Core toolchain libraries 'toolchain/%s_x86_glibc/x86_64-nacl/lib' % osname, 'toolchain/%s_x86_glibc/x86_64-nacl/lib32' % osname, + 'toolchain/%s_arm_glibc/arm-nacl/lib' % osname, # naclports installed libraries 'toolchain/%s_x86_glibc/x86_64-nacl/usr/lib' % osname, 'toolchain/%s_x86_glibc/i686-nacl/usr/lib' % osname, + 'toolchain/%s_arm_glibc/arm-nacl/usr/lib' % osname, # SDK bundle libraries 'lib/glibc_x86_32/%s' % config, 'lib/glibc_x86_64/%s' % config, + 'lib/glibc_arm/%s' % config, # naclports bundle libraries 'ports/lib/glibc_x86_32/%s' % config, 'ports/lib/glibc_x86_64/%s' % config, + 'ports/lib/glibc_arm/%s' % config, ] # In some cases (e.g. ASAN, TSAN, STANDALONE) the name of the configuration @@ -533,8 +537,10 @@ def GetDefaultLibPath(config): libpath += [ 'lib/glibc_x86_32/%s' % config_fallback, 'lib/glibc_x86_64/%s' % config_fallback, + 'lib/glibc_arm/%s' % config_fallback, 'ports/lib/glibc_x86_32/%s' % config_fallback, 'ports/lib/glibc_x86_64/%s' % config_fallback, + 'ports/lib/glibc_arm/%s' % config_fallback, ] bionic_dir = 'toolchain/%s_arm_bionic' % osname diff --git a/native_client_sdk/src/tools/lib/get_shared_deps.py b/native_client_sdk/src/tools/lib/get_shared_deps.py index 7a355ca..ac5529a 100644 --- a/native_client_sdk/src/tools/lib/get_shared_deps.py +++ b/native_client_sdk/src/tools/lib/get_shared_deps.py @@ -89,7 +89,7 @@ def _GetNeededDynamic(main_files, objdump, lib_path): examined = set() all_files, unexamined = GleanFromObjdump(main_files, None, objdump, lib_path) for arch in all_files.itervalues(): - if unexamined: + if unexamined and arch != 'arm': unexamined.add((RUNNABLE_LD, arch)) while unexamined: diff --git a/native_client_sdk/src/tools/nacl_gcc.mk b/native_client_sdk/src/tools/nacl_gcc.mk index 34fd0e0..3791128 100644 --- a/native_client_sdk/src/tools/nacl_gcc.mk +++ b/native_client_sdk/src/tools/nacl_gcc.mk @@ -26,22 +26,12 @@ X86_64_STRIP := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a x86_64 --tool=strip) X86_64_NM := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a x86_64 --tool=nm) endif -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++) ARM_LINK := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a arm --tool=c++) ARM_LIB := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a arm --tool=ar) ARM_STRIP := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a arm --tool=strip) ARM_NM := $(shell $(NACL_CONFIG) -t $(TOOLCHAIN) -a arm --tool=nm) -endif NCVAL ?= python $(NACL_SDK_ROOT)/tools/ncval.py @@ -187,9 +177,7 @@ endef ifneq ($(TOOLCHAIN),bionic) VALID_ARCHES := x86_32 x86_64 endif -ifeq ($(ARM_SUPPORT),1) VALID_ARCHES += arm -endif ifdef NACL_ARCH ifeq (,$(findstring $(NACL_ARCH),$(VALID_ARCHES))) @@ -327,7 +315,6 @@ $(LIBDIR)/$(TOOLCHAIN)_x86_64/$(CONFIG_DIR)/lib$(1).a: $(X86_64_OUTDIR)/lib$(1)_ endif ifneq (,$(findstring arm,$(ARCHES))) -ifeq ($(ARM_SUPPORT),1) all: $(ARM_OUTDIR)/lib$(1)_arm.a $(ARM_OUTDIR)/lib$(1)_arm.a: $(foreach src,$(2),$(call SRC_TO_OBJ,$(src),_arm)) $(MKDIR) -p $$(dir $$@) @@ -340,7 +327,6 @@ $(LIBDIR)/$(TOOLCHAIN)_arm/$(CONFIG_DIR)/lib$(1).a: $(ARM_OUTDIR)/lib$(1)_arm.a $(MKDIR) -p $$(dir $$@) $(call LOG,CP ,$$@,$(OSHELPERS) cp $$^ $$@) endif -endif endef |