Closed Vascom closed 1 month ago
Same issue on x86_64 GNU/Linux (GCC). See https://github.com/purpleprotocol/mimalloc_rust/issues/111
Same issue on x86_64 GNU/Linux (GCC). See purpleprotocol/mimalloc_rust#111
In my case other arches built successfully https://koji.fedoraproject.org/koji/taskinfo?taskID=116804025
My build logs
> [build 6/7] RUN cargo build --locked --release:
12.70 cargo:warning= 240 | return (uintptr_t)__builtin_thread_pointer();
12.70 cargo:warning= | ^~~~~~~~~~~~~~~~~~~~~~~~~~
12.70
12.70 --- stderr
12.70
12.70
12.70 error occurred: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-I" "c_src/mimalloc/include" "-I" "c_src/mimalloc/src" "-Wall" "-Wextra" "-ftls-model=initial-exec" "-DMI_DEBUG=0" "-o" "/app/target/release/build/libmimalloc-sys-9bc557761968b710/out/98cfcaec7182b1d8-static.o" "-c" "c_src/mimalloc/src/static.c" with args cc did not execute successfully (status code exit status: 1).
Will give more verbose output ASAP
I got it to work by changing the distro I am using for my containers. I switched from debian bullseye to ubuntu latest (LTS). However, I did not investigate further.
ah, that is a shame. I wonder what goes wrong since the check:
// Do we have __builtin_thread_pointer? (do not make this a compound test as it fails on older gcc's, see issue #851)
#if defined(__has_builtin)
#if __has_builtin(__builtin_thread_pointer)
#define MI_HAS_BUILTIN_THREAD_POINTER 1
#endif
#elif defined(__GNUC__) && (__GNUC__ >= 7) && defined(__aarch64__) // special case aarch64 for older gcc versions (issue #851)
#define MI_HAS_BUILTIN_THREAD_POINTER 1
#endif
seems to correctly test if __builtin_thread_pointer
exists?
I think I will switch the default to prefer the TLS slot assembly after all and fall back to __builtin_thread_pointer
otherwise.
I just pushed a potential fix to dev
and dev-slice
. If this fixes the build issues I will update the release soon. Please test if you can.
This patch not fixed ppc64le build. Error is the same. I mean 146f9d2
Darn -- it looks like we cannot check for __builtin_thread_pointer
reliably. Maybe we should only enable it for platforms that we explicitly tested for :-(
@vascom, I hope the latest commits fix the build issues now. fingers crossed. (At some point I would like to figure out though why the is_builtin tests are positive even though the builtin is not actually supported? )
Same here for ppc64el, hppa, ia64, m68k, powerpc, ppc64, sparc64. See build server of Debian. I'll try your commit ASAP.
I can confirm that adding the two commits https://github.com/microsoft/mimalloc/commit/cc3c14f2ed374f908e60a3bf29c1dff84fc8cfc2 and https://github.com/microsoft/mimalloc/commit/146f9d2333bc0aeed1593dc659b17e65b38a33e7 solved the build issue for me.
Can't build mimalloc 2.1.4 for Fedora GNU Linux ppc64le arch. GCC 14.0.1
error: ‘__builtin_thread_pointer’ is not supported on this target
How to fix it?
Full build log https://kojipkgs.fedoraproject.org//work/tasks/4072/116804072/build.log