Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libmimalloc-sys v0.1.39->v0.1.41 introduced build failure on some platforms #111

Closed
hombit opened this issue Apr 23, 2024 · 8 comments
Closed

Comments

@hombit
Copy link

hombit commented Apr 23, 2024

I use mimalloc in one of my projects to build Rust-powered Python packages. I noticed that after the recent update from 0.1.39 to 0.1.41, the libmimalloc-sys build has failed with the following error:

cargo:warning=In file included from c_src/mimalloc/src/alloc.c:14,
  cargo:warning=                 from c_src/mimalloc/src/static.c:23:
  cargo:warning=c_src/mimalloc/include/mimalloc/prim.h: In function ‘_mi_prim_thread_id’:
  cargo:warning=c_src/mimalloc/include/mimalloc/prim.h:240:21: error: ‘__builtin_thread_pointer’ is not supported on this target
  cargo:warning=  240 |   return (uintptr_t)__builtin_thread_pointer();
  cargo:warning=      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~

  --- stderr


  error occurred: Command "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-m64" "-I" "c_src/mimalloc/include" "-I" "c_src/mimalloc/src" "-Wall" "-Wextra" "-ftls-model=initial-exec" "-DMI_DEBUG=0" "-o" "/project/target/debug/build/libmimalloc-sys-c0ac1fb27ae015bf/out/98cfcaec7182b1d8-static.o" "-c" "c_src/mimalloc/src/static.c" with args cc did not execute successfully (status code exit status: 1).

This can be reproduced with Docker, create Dockerfile and run

docker build -t build_libmimalloc-sys .
docker run --rm build_libmimalloc-sys
FROM quay.io/pypa/manylinux2014_x86_64

# Update Certificates
RUN yum install -y openssl-devel

# Install Rust
RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y
ENV PATH="${PATH}:/root/.cargo/bin"

# Create a project
RUN cargo init /project
WORKDIR /project
RUN cargo add libmimalloc-sys

# Build the project
CMD ["cargo", "build"]

It’s even more confusing that my CI builds pass for all MUSL-based and all ARM64 images, but not for GLIBC PPC64LE:
https://github.com/light-curve/light-curve-python/actions/runs/8793140128

@cfvescovo
Copy link

Same issue here, I do not know what caused it

@octavonce
Copy link
Collaborator

Seems to be an upstream issue. This check seems to pass in your case but __builtin_thread_pointer is not available on that target.

@daanx

@hombit
Copy link
Author

hombit commented Apr 23, 2024

Should I file an issue for the original C library?

@octavonce
Copy link
Collaborator

Yes

@cfvescovo
Copy link

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.

@ldemidov
Copy link

ldemidov commented May 7, 2024

Hitting the same issue here on a centos7 based container (quay.io/pypa/manylinux2014_x86_64). Unfortunately we're stuck with this container because we need to support a glibc 2.17 compatible binary.

@octavonce
Copy link
Collaborator

Please check the latest release

@hombit
Copy link
Author

hombit commented May 21, 2024

Thank you, it is fixed now!

@hombit hombit closed this as completed May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants