mapbox / mapbox/cmake-node-module

LINK FLAGS "-z now" throws an error when cross-compiling

オープン
#2 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
CMake
スター
20
フォーク
3
PR マージ指標
30日以内にマージされた PR はありません

説明

I was using cmake-js in conjunction with cmake-node-module to cross-compile node modules for windows from linux. However at line number 178 of module.cmake the LINK_FLAGS "-z now" turns out to be invalid option for the linker x86_64-w64-mingw32-ld. I get the following output,

# Running the following command from a CMakeLists file dir to build the node modules 
cmake-js compile --CDCMAKE_TOOLCHAIN_FILE=<path-to-cmake-toolchain-file>

# The configuring and generating are successful, and build files are written successfully.
# However, in the subsequent linking step I get the following output.
Scanning dependencies of target hello-world-native.abi-93
[  3%] Building CXX object CMakeFiles/hello-world-native.abi-93.dir/src/hello_world.cpp.obj
[  6%] Linking CXX shared library hello-world-native.abi-93.node
/usr/bin/x86_64-w64-mingw32-ld: unrecognized option '-z'
/usr/bin/x86_64-w64-mingw32-ld: use the --help option for usage information
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/hello-world-native.abi-93.dir/build.make:106: hello-world-native.abi-93.node] Error 1
make[1]: *** [CMakeFiles/Makefile2:131: CMakeFiles/hello-world-native.abi-93.dir/all] Error 2
make: *** [Makefile:103: all] Error 2
ERR! OMG Process terminated: 2

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

178 行目の module.cmake を調査し、提供された CMake ツールチェーンファイルを使用してクロスコンパイルコマンドを再現します。LINK_FLAGS の設定が x86_64-w64-mingw32 リンカーにどのように渡るかを確認し、その後、サポートされていないオプションなしで hello-world-native.abi-93 ターゲットが正常にリンクされることを検証します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
cmake, node.js
領域
build-system
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
55/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。