From caebfa9b50e6091370b075793bc21893f075f103 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Fri, 23 May 2014 14:00:39 -0700 Subject: [PATCH] Fix MIPS build. We really ought to remove libportable. Bug: 14903517 Change-Id: Id96b24bfe329096adffd94d452f440295d8aa83a --- .../android/libportable/arch-mips/filefd.c | 7 ++-- .../android/libportable/arch-mips/flags.c | 33 ------------------- .../android/libportable/arch-mips/pthread.c | 3 -- .../android/libportable/arch-mips/signal.c | 16 --------- .../android/libportable/arch-mips/syscall.c | 14 -------- 5 files changed, 3 insertions(+), 70 deletions(-) diff --git a/ndk/sources/android/libportable/arch-mips/filefd.c b/ndk/sources/android/libportable/arch-mips/filefd.c index d80eb3dd2..788edf18b 100644 --- a/ndk/sources/android/libportable/arch-mips/filefd.c +++ b/ndk/sources/android/libportable/arch-mips/filefd.c @@ -23,7 +23,6 @@ #include #include #include -#include #define PORTABLE_TAG "filefd_portable" #include @@ -307,7 +306,7 @@ static int import_fd_env(int verify) } else { ASSERT(filefd_mapped_file[fd] == UNUSED_FD_TYPE); - __atomic_inc(&filefd_mapped_files); + __sync_fetch_and_add(&filefd_mapped_files, 1); ALOGV("%s: ++filefd_mapped_files:%d;", __func__, filefd_mapped_files); @@ -358,7 +357,7 @@ __hidden void filefd_opened(int fd, enum filefd_type fd_type) if (fd >= 0 && fd < __FD_SETSIZE) { if (filefd_mapped_file[fd] == UNUSED_FD_TYPE) { - __atomic_inc(&filefd_mapped_files); + __sync_fetch_and_add(&filefd_mapped_files, 1); filefd_mapped_file[fd] = fd_type; } ASSERT(filefd_mapped_file[fd] == fd_type); @@ -375,7 +374,7 @@ __hidden void filefd_closed(int fd) if (filefd_mapped_file[fd] != UNUSED_FD_TYPE) { filefd_mapped_file[fd] = UNUSED_FD_TYPE; filefd_FD_CLOEXEC_file[fd] = 0; - __atomic_dec(&filefd_mapped_files); + __sync_fetch_and_sub(&filefd_mapped_files, 1); } } ALOGV("%s: }", __func__); diff --git a/ndk/sources/android/libportable/arch-mips/flags.c b/ndk/sources/android/libportable/arch-mips/flags.c index f18b8d952..f0f75009d 100644 --- a/ndk/sources/android/libportable/arch-mips/flags.c +++ b/ndk/sources/android/libportable/arch-mips/flags.c @@ -23,36 +23,3 @@ #include -/* __sflags is an internal bionic routine but the symbol is exported and there are callers... */ -extern int __sflags(const char *, int *); - -int -WRAP(__sflags)(const char *mode, int *optr) -{ - int rv; - int nflags, pflags; - - ALOGV(" "); - ALOGV("%s(mode:%p, optr:%p) {", __func__, mode, optr); - - rv = __sflags(mode, &nflags); - - /* error - no change to *optr */ - if (rv == 0) - goto done; - - pflags = nflags & O_ACCMODE; - if (nflags & O_CREAT) - pflags |= O_CREAT_PORTABLE; - if (nflags & O_TRUNC) - pflags |= O_TRUNC_PORTABLE; - if (nflags & O_APPEND) - pflags |= O_APPEND_PORTABLE; - - /* Set *optr to portable flags */ - *optr = pflags; - -done: - ALOGV("%s: return(rv:%d); }", __func__, rv); - return rv; -} diff --git a/ndk/sources/android/libportable/arch-mips/pthread.c b/ndk/sources/android/libportable/arch-mips/pthread.c index f6c3037da..5f92fb04f 100644 --- a/ndk/sources/android/libportable/arch-mips/pthread.c +++ b/ndk/sources/android/libportable/arch-mips/pthread.c @@ -213,9 +213,6 @@ PTHREAD_WRAPPER(pthread_cond_timedwait_relative_np, (pthread_cond_t *cond, pthre PTHREAD_WRAPPER(pthread_cond_timeout_np, (pthread_cond_t *cond, pthread_mutex_t *mutex, unsigned msecs), (cond, mutex, msecs), "(cond:%p, mutex:%p, msecs:%u)"); -PTHREAD_WRAPPER(pthread_mutex_lock_timeout_np, (pthread_mutex_t *mutex, unsigned msecs), - (mutex, msecs), "(mutex:%p, msecs:%u)"); - PTHREAD_WRAPPER(pthread_rwlockattr_init, (pthread_rwlockattr_t *attr), (attr), "(attr:%p)"); PTHREAD_WRAPPER(pthread_rwlockattr_destroy, (pthread_rwlockattr_t *attr), (attr), "(attr:%p)"); diff --git a/ndk/sources/android/libportable/arch-mips/signal.c b/ndk/sources/android/libportable/arch-mips/signal.c index e84b2fc33..ae3fcb475 100644 --- a/ndk/sources/android/libportable/arch-mips/signal.c +++ b/ndk/sources/android/libportable/arch-mips/signal.c @@ -871,22 +871,6 @@ int WRAP(kill)(pid_t pid, int portable_signum) } -int WRAP(tkill)(int tid, int portable_signum) -{ - extern int REAL(tkill)(int, int); - int rv; - - ALOGV(" "); - ALOGV("%s(tid:%d, portable_signum:%d) {", __func__, - tid, portable_signum); - - rv = do_kill(tid, portable_signum, REAL(tkill)); - - ALOGV("%s: return(rv:%d); }", __func__, rv); - return rv; -} - - /* tgkill is not exported from android-14 libc.so */ #if 0 int WRAP(tgkill)(int tgid, int tid, int portable_signum) diff --git a/ndk/sources/android/libportable/arch-mips/syscall.c b/ndk/sources/android/libportable/arch-mips/syscall.c index 5e31b80e1..13ac9385a 100644 --- a/ndk/sources/android/libportable/arch-mips/syscall.c +++ b/ndk/sources/android/libportable/arch-mips/syscall.c @@ -561,20 +561,6 @@ int WRAP(syscall)(int portable_number, ...) } #endif -#ifdef __NR_tkill_portable - case __NR_tkill_portable: { - int tid, sig; - - va_start(ap, portable_number); - tid = va_arg(ap, int); - sig = va_arg(ap, int); - va_end(ap); - - ret = WRAP(tkill)(tid, sig); - goto done; - } -#endif - #ifdef __NR_uname_portable case __NR_uname_portable: native_number = __NR_uname; break; #endif