mimalloc3 wasi target fails to compile

Đang mở
#1,134 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
52/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
c, wasm
Lĩnh vực
operating-systems

Hướng nghiên cứu

Tái hiện lỗi bằng lệnh WASI SDK được hiển thị trong issue, sau đó kiểm tra src/prim/wasi/prim.c tại dòng 92 và 101 cùng các khai báo helper trong include/mimalloc/internal.h. Xác nhận rằng target WASI được build thành công và các lệnh gọi alignment sử dụng helper đã được khai báo.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

I get the compilation errors when I try to build mimalloc3 using wasi target.

git clone --branch v3.1.5 https://github.com/microsoft/mimalloc.git
~/w/h/s/h/t/mimalloc ((v3.1.5)) [1]> ~/workspace/build/wasi-sdk-23.0-x86_64-linux/bin/clang src/static.c -I include/ -I src/ --sysroot ~/workspace/build/wasi-sdk-23.0-x86_64-linux/share/wasi-sysroot/
In file included from src/static.c:38:
In file included from src/prim/prim.c:19:
src/prim/wasi/prim.c:92:33: error: call to undeclared function 'mi_align_up_ptr'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
   92 |         void* aligned_current = mi_align_up_ptr(current, try_alignment);  // and align from there to minimize wasted space
      |                                 ^
src/prim/wasi/prim.c:92:33: note: did you mean '_mi_align_up_ptr'?
include/mimalloc/internal.h:441:24: note: '_mi_align_up_ptr' declared here
  441 | static inline uint8_t* _mi_align_up_ptr(void* p, size_t alignment) {
      |                        ^
In file included from src/static.c:38:
In file included from src/prim/prim.c:19:
src/prim/wasi/prim.c:92:15: error: incompatible integer to pointer conversion initializing 'void *' with an expression of type 'int' [-Wint-conversion]
   92 |         void* aligned_current = mi_align_up_ptr(current, try_alignment);  // and align from there to minimize wasted space
      |               ^                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/prim/wasi/prim.c:101:11: error: call to undeclared function 'mi_align_up_ptr'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  101 |       p = mi_align_up_ptr(base, try_alignment);
      |           ^
src/prim/wasi/prim.c:101:9: error: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion]
  101 |       p = mi_align_up_ptr(base, try_alignment);
      |         ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 errors generated.

I'm able to get rid of those by s/mi_align_up_ptr/_mi_align_up_ptr. I'm happy to create PR if that's what needed to fix it.

Ngôn ngữ chính
C
Star
13.6k
Fork
1.2k
Merge trung bình
18 giờ 12 phút
Pull request đã merge (30 ngày)
20

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/mimalloc

Tất cả issue của microsoft/mimalloc

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.