mapbox / mapbox/cmake-node-module
LINK FLAGS "-z now" throws an error when cross-compiling
Personne n'a encore pris cette issue.
- Langage dominant
- CMake
- Étoiles
- 20
- Forks
- 3
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Examinez module.cmake à la ligne 178 et reproduisez la commande de compilation croisée à l’aide du fichier de toolchain CMake fourni. Vérifiez comment le paramètre LINK_FLAGS parvient à l’éditeur de liens x86_64-w64-mingw32, puis vérifiez que la cible hello-world-native.abi-93 se lie correctement sans l’option non prise en charge.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- cmake, node.js
- Domaine
- build-system
- Type d'issue
- Bug
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Activité
- À l'abandon
- Clarté
- Clairement spécifiée
- Accessibilité débutants
- 55/100