From 57bc5eaf2f9b44ad8321fecf6dfa45d82a50c580 Mon Sep 17 00:00:00 2001 From: yugui Date: Sat, 11 Oct 2014 13:33:14 +0000 Subject: Fixes build failures on Portable Native Client. Note: Some of the fixes are for newlib in general but not NaCl-specific. * include/ruby/intern.h (rb_fd_select): declare struct timeval, or the struct gets local to the function in C99. * file.c (#include): add nacl/stat.h for PNaCl. (utimes): added a declaration for PNaCl. (stat_atimespec): stat::st_atimensec is long long but timespec::tv_nsec is long in PNaCl. (stat_mtimespec, stat_ctimespec): ditto. (rb_group_member): disable getgroups unless HAVE_GETGROUPS. (eaccess): unify the fallback to generic defined(USE_GETEUID). * io.c: include sys/time.h for struct timeval. (rb_close_before_exec): nothing we can do if F_GETFD is not available. (ioctl): pnacl newlib actually doesn't have ioctl. * process.c (maxgroups): it is used iff defined(_SC_NGROUPS_MAX) || defined(NGROUPS_MAX) but not defined(HAVE_GETGROUPS) || defined(HAVE_SETGROUPS). (obj2gid): fail unless the object is a Fixnum if getgrnam is not available. (disable_child_handler_fork_child): sigaction is not available in PNaCl newlib. * configure.in (warnflags, strict_warnflags): avoid -ansi for strlcpy. (rb_cv_gcc_atomic_builtins): also check __atomic_or_etch because it is used in ruby_atomic.h. (rb_cv_gcc_sync_builtins): ditto. (HAVE_GETGRNAM): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- configure.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'configure.in') diff --git a/configure.in b/configure.in index e430d8dcd7..4cc8afaea6 100644 --- a/configure.in +++ b/configure.in @@ -837,7 +837,7 @@ if test "$GCC" = yes; then # comments. We bypass ANSI C mode for them. Otherwise # extension libs cannot include those headers. ], - [cygwin*|darwin*|netbsd*], [ + [cygwin*|darwin*|netbsd*|nacl], [ # need lgamma_r(), finite() ], [haiku], [ @@ -1621,6 +1621,7 @@ if test "$GCC" = yes; then __atomic_exchange_n(&atomic_var, 1, __ATOMIC_SEQ_CST); __atomic_fetch_add(&atomic_var, 1, __ATOMIC_SEQ_CST); __atomic_fetch_sub(&atomic_var, 1, __ATOMIC_SEQ_CST); + __atomic_or_fetch(&atomic_var, 1, __ATOMIC_SEQ_CST); ], [rb_cv_gcc_atomic_builtins=yes], [rb_cv_gcc_atomic_builtins=no])]) @@ -1635,6 +1636,8 @@ if test "$GCC" = yes; then __sync_lock_test_and_set(&atomic_var, 1); __sync_fetch_and_add(&atomic_var, 1); __sync_fetch_and_sub(&atomic_var, 1); + __sync_or_and_fetch(&atomic_var, 1); + __sync_val_compare_and_swap(&atomic_var, 0, 1); ], [rb_cv_gcc_sync_builtins=yes], [rb_cv_gcc_sync_builtins=no])]) @@ -2006,6 +2009,7 @@ AC_CHECK_FUNCS(ftruncate) AC_CHECK_FUNCS(ftruncate64) # used for Win32 platform AC_CHECK_FUNCS(getcwd) AC_CHECK_FUNCS(getgidx) +AC_CHECK_FUNCS(getgrnam) AC_CHECK_FUNCS(getgrnam_r) AC_CHECK_FUNCS(getgroups) AC_CHECK_FUNCS(getpgid) -- cgit v1.2.3