LINK FLAGS "-z now" throws an error when cross-compiling
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- cmake, node.js
- Domain
- build-system
Research direction
Inspect module.cmake at line 178 and reproduce the cross-compilation command using the provided CMake toolchain file. Check how the LINK_FLAGS setting reaches the x86_64-w64-mingw32 linker, then verify that the hello-world-native.abi-93 target links successfully without the unsupported option.
Written by the indexing model from the issue text.
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
- Dominant language
- CMake
- Stars
- 20
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mapbox/cmake-node-module
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
mapbox/cmake-node-module#1 · 1 comment ·
All issues in mapbox/cmake-node-module
Similar issues
-
Update to NCCL 2.32 Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
conda-forge/nccl-feedstock#166 ·
-
next-devel: s390x build fails — chccwdev/vmur/zkey missing from initramfs after s390utils 2.44 split Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
coreos/fedora-coreos-tracker#2228 ·
-
Python versions Openenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
MunchLab/ceREEBerus#121 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
integration-meraki type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
nautobot/nautobot-app-chatops#463 ·