--- ./include/jemalloc/internal/bit_util.h.orig 2022-05-01 16:19:32.539680176 +0100 +++ ./include/jemalloc/internal/bit_util.h.orig 2022-05-01 16:28:33.940788081 +0100 @@ -82,7 +82,7 @@ BIT_UTIL_INLINE uint64_t pow2_ceil_u64(uint64_t x) { -#if (defined(__amd64__) || defined(__x86_64__) || defined(JEMALLOC_HAVE_BUILTIN_CLZ)) +#if ((defined(__amd64__) || defined(__x86_64__) || defined(JEMALLOC_HAVE_BUILTIN_CLZ))) && !defined(__ILP32__) if(unlikely(x <= 1)) { return x; } @@ -112,12 +112,12 @@ BIT_UTIL_INLINE uint32_t pow2_ceil_u32(uint32_t x) { -#if ((defined(__i386__) || defined(JEMALLOC_HAVE_BUILTIN_CLZ)) && (!defined(__s390__))) +#if (((defined(__i386__) || (defined(__amd64__) || defined(__x86_64__)) && defined(__ILP32__)) || defined(JEMALLOC_HAVE_BUILTIN_CLZ)) && (!defined(__s390__))) if(unlikely(x <= 1)) { return x; } size_t msb_on_index; -#if (defined(__i386__)) +#if (defined(__i386__)) || defined(__ILP32__) asm ("bsr %1, %0" : "=r"(msb_on_index) // Outputs. : "r"(x-1) // Inputs.