--- memkind-1.8.0.orig/src/memkind_arena.c
+++ memkind-1.8.0/src/memkind_arena.c
@@ -40,7 +40,6 @@
 #include <jemalloc/jemalloc.h>
 #include <utmpx.h>
 #include <sched.h>
-#include <smmintrin.h>
 #include <limits.h>
 #include <sys/mman.h>
 #include <assert.h>
@@ -618,7 +617,11 @@ MEMKIND_EXPORT int memkind_thread_get_ar
             log_err("jemk_malloc() failed.");
         }
         if (!err) {
-            *arena_tsd = _mm_crc32_u64(0, (uint64_t)pthread_self()) %
+            // On glibc pthread_self() is incremented by 0x801000 for every
+            // thread (no matter the arch's word width).  This might change
+            // in the future, but even in the worst case the hash will
+            // degenerate to a single bucket with no loss of correctness.
+            *arena_tsd = ((uint64_t)pthread_self() >> 12) %
                          kind->arena_map_len;
             err = pthread_setspecific(kind->arena_key, arena_tsd) ?
                   MEMKIND_ERROR_RUNTIME : 0;
@@ -639,9 +642,7 @@ MEMKIND_EXPORT int memkind_thread_get_ar
  */
 static uintptr_t get_fs_base()
 {
-    uintptr_t fs_base;
-    asm ("movq %%fs:0, %0" : "=r" (fs_base));
-    return fs_base;
+    return (uintptr_t)pthread_self();
 }
 
 MEMKIND_EXPORT int memkind_thread_get_arena(struct memkind *kind,
