Cannot build on Windows for ARM64: error on init_priority attribute.
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- cmake, cpp
- Lĩnh vực
- build-system
Hướng nghiên cứu
Bắt đầu với libs/filesystem/CMakeLists.txt và libs/nowide/CMakeLists.txt, sau đó kiểm tra config/check_attribute_init_priority.cpp cùng cách xử lý CMAKE_REQUIRED_FLAGS hiện có trong libs/atomic/CMakeLists.txt và libs/log/CMakeLists.txt. Tái hiện kiểm tra bằng trình biên dịch aarch64-w64-mingw32 và xác minh rằng bài kiểm tra cấu hình từ chối cảnh báo về thuộc tính bị bỏ qua, đồng thời bản build Windows ARM64 không còn thất bại ở bước sau.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I tried to compile Boost libraries with aarch64-w64-mingw32 cross compiler.
Unfortunately, the build process failed after a while with this error message:
boost-1.90.0-1.noarch/src/boost-1.90.0/libs/nowide/src/iostream.cpp:148:70: error: 'init_priority' attribute ignored [-Werror=attributes]
148 | #define BOOST_NOWIDE_INIT_PRIORITY __attribute__((init_priority(101)))
| ^
At the time of writing, the support for init_priority is tested into two CMakeLists.txt files:
- libs/filesystem/CMakeLists.txt
- libs/nowide/CMakeLists.txt
Inside these scripts, check_cxx_source_compiles() is used.
These calls check if the test compiles fine and they define BOOST_NOWIDE_HAS_INIT_PRIORITY and BOOST_FILESYSTEM_HAS_INIT_PRIORITY if everything looks ok.
However, these tests do not fail if there is a just warning.
For example, I tried to compile the test source myself and I got this:
$ aarch64-w64-mingw32-g++ boost-1.90.0-1.noarch/src/boost-1.90.0/libs/nowide/config/check_attribute_init_priority.cpp -c -o c.o
boost-1.90.0-1.noarch/src/boost-1.90.0/libs/nowide/config/check_attribute_init_priority.cpp:9:43: warning: 'init_priority' attribute ignored [-Wattributes]
9 | Foo foo __attribute__((init_priority(101)));
| ^
So, for CMake the test was good anyways.
The problem comes out because the -Werror option, which makes the build process to fail later.
I have not enough knowledge at the moment, but I can see these two solutions:
Adding -Wno-error=attributes (if supported) when building those libraries, or
Adding -Werror (if supported) when compiling the tests with check_cxx_source_compiles().
This issue happens when building for Windows on ARM64 with GCC.
The i686-w64-mingw32 and x86_64-w64-mingw32 cross compilers also work with that attribute, but they don't emit any warning and that's why this issue was not seen before.
I hope that you will find this report useful.
EDIT: it looks like these scripts already handle CMAKE_REQUIRED_FLAGS before calling check_cxx_source_compiles():
- libs/atomic/CMakeLists.txt
- libs/log/CMakeLists.txt
Probably, it would be enough to follow the same way for adding the needed option.
- Ngôn ngữ chính
- HTML
- Star
- 8.6k
- Fork
- 2k
- Merge trung bình
- 9 giờ 35 phút
- Pull request đã merge (30 ngày)
- 1
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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của boostorg/boost
-
Add More GHA Runners to CIĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
-
Boost 1.92.0 build errorĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Tất cả issue của boostorg/boost
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
-
CI: pin OS images in build/publish tests instead of `*-latest`Có thể đã có người làm @shikhabhadoria đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
vacanza/holidays#4220 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Niko1221/Strata#6731 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 6 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
dependencies go good first issue priority: medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
fukubie/StockLlama#48 ·