Cannot build on Windows for ARM64: error on init_priority attribute.
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- cmake, cpp
- 領域
- build-system
調査の方向性
まず libs/filesystem/CMakeLists.txt と libs/nowide/CMakeLists.txt から始め、続いて config/check_attribute_init_priority.cpp と、libs/atomic/CMakeLists.txt および libs/log/CMakeLists.txt における既存の CMAKE_REQUIRED_FLAGS の処理を調べます。aarch64-w64-mingw32 コンパイラーでチェックを再現し、構成テストが無視された属性の警告を拒否すること、および Windows ARM64 ビルドが後の段階で失敗しなくなることを確認します。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- HTML
- スター
- 8.6k
- フォーク
- 2k
- 平均マージ
- 9時間 35分
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
boostorg/boost のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
-
CI: pin OS images in build/publish tests instead of `*-latest`対応中かも @shikhabhadoria が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
vacanza/holidays#4220 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
Niko1221/Strata#6731 · コメント 2 件 ·
メンテナーはふだん 6 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
dependencies go good first issue priority: medium
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
fukubie/StockLlama#48 ·