Merge "Limit soinfo compatibility fields to arm32"
diff --git a/libc/bionic/pthread_detach.cpp b/libc/bionic/pthread_detach.cpp
index 7ae5eb4..dcdb7b1 100644
--- a/libc/bionic/pthread_detach.cpp
+++ b/libc/bionic/pthread_detach.cpp
@@ -44,8 +44,8 @@
     }
     switch (old_state) {
       case THREAD_NOT_JOINED: return 0;
-      case THREAD_JOINED:     return 0;  // Already being joined; silently do nothing, like glibc.
-      case THREAD_DETACHED:   return THREAD_DETACHED;
+      case THREAD_JOINED:     return EINVAL;
+      case THREAD_DETACHED:   return EINVAL;
       case THREAD_EXITED_NOT_JOINED: break;  // Call pthread_join out of scope of pthread_accessor.
     }
   }
diff --git a/libc/bionic/pthread_internal.h b/libc/bionic/pthread_internal.h
index 99882ae..538e0da 100644
--- a/libc/bionic/pthread_internal.h
+++ b/libc/bionic/pthread_internal.h
@@ -39,9 +39,6 @@
 /* Has the thread been joined by another thread? */
 #define PTHREAD_ATTR_FLAG_JOINED 0x00000002
 
-/* Did the thread exit without freeing pthread_internal_t? */
-#define PTHREAD_ATTR_FLAG_ZOMBIE 0x00000004
-
 struct pthread_key_data_t {
   uintptr_t seq; // Use uintptr_t just for alignment, as we use pointer below.
   void* data;
diff --git a/tests/pthread_test.cpp b/tests/pthread_test.cpp
index de60f28..251a230 100644
--- a/tests/pthread_test.cpp
+++ b/tests/pthread_test.cpp
@@ -271,8 +271,11 @@
 
   sleep(1); // (Give t2 a chance to call pthread_join.)
 
-  // ...a call to pthread_detach on thread 1 will "succeed" (silently fail)...
+#if defined(__BIONIC__)
+  ASSERT_EQ(EINVAL, pthread_detach(t1));
+#else
   ASSERT_EQ(0, pthread_detach(t1));
+#endif
   AssertDetached(t1, false);
 
   spinhelper.UnSpin();