Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

`.subsections_via_symbols` directive causes invalid symbol pruning in macOS x86-64 kernels

Đang mở
#6,089 3 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ó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
55/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
c, macos
Lĩnh vực
backend, compilers

Hướng nghiên cứu

Reproduce the issue with the provided sasum.c command and OpenBLAS build invocation, then inspect the sasum_k kernel and the generated .L998/.L999 labels. Trace the macOS x86-64 shared-library link path and determine why deduplication occurs without -Wl,-no_deduplicate; done means cblas_sasum prints 11 without requiring an external workaround.

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

Mô tả

// sasum.c
#include <stdio.h>
#include <cblas.h>
int main(void) {
  float x[5] = {3, -1, 2, -4, 1};
  printf("cblas_sasum = %g\n", cblas_sasum(5, x, 1));   // expect 11
  return 0;
}
$ clang -arch x86_64 -O2 -I$(BUILD_DIR) sasum.c -L$(BUILD_DIR) -lopenblas -Wl,-rpath,$(BUILD_DIR) -o sasum_dyn
$ ./sasum_dyn
cblas_sasum = 4.01598e-36

The correct output is:

$ ./sasum_dyn
cblas_sasum = 11

OpenBLAS built with make TARGET=NEHALEM NOFORTRAN=1 (on Apple Silicon, the full invocation is arch -x86_64 make -j6 ARCH=x86_64 BINARY=64 CC="clang -arch x86_64" HOSTCC="clang -arch x86_64" TARGET=NEHALEM NOFORTRAN=1 shared) with Apple clang 21.0.0

The problem is that even without -Wl,-dead-strip the linker will still try to deduplicate labels unless -Wl,-no_deduplicate is provided explicitly. This happens to .L998 and .L999 in the sasum_k kernel.

I am testing via Rosetta on AArch64 macOS hardware, but I suspect this reproduces on proper x86-64 macOS targets.

Ngôn ngữ chính
C
Star
7.6k
Fork
1.7k
Merge trung bình
1 ngày 5 giờ
Pull request đã merge (30 ngày)
57

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 OpenMathLib/OpenBLAS

Tất cả issue của OpenMathLib/OpenBLAS

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.