mapbox / mapbox/cmake-node-module
LINK FLAGS "-z now" throws an error when cross-compiling
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- CMake
- Estrellas
- 20
- Forks
- 3
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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,
```bash
# Running the following command from a CMakeLists file dir to build the node modules
cmake-js compile --CDCMAKE_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
```
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Inspecciona module.cmake en la línea 178 y reproduce el comando de compilación cruzada usando el archivo de toolchain de CMake proporcionado. Comprueba cómo llega la configuración LINK_FLAGS al enlazador x86_64-w64-mingw32 y, a continuación, verifica que el destino hello-world-native.abi-93 se enlaza correctamente sin la opción no compatible.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- cmake, node.js
- Área
- build-system
- Tipo de issue
- Error
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Estado de actividad
- Estancado
- Claridad
- Bien especificado
- Aptitud para principiantes
- 55/100