CMAKE_LINKER_TYPE=MOLD breaks CUDA ABI detection and trycompile
I have uploaded a minimal replication example here:
https://github.com/HumanisingAutonomy/cuda-minimal
The issue I am seeing is that when I try and configure a project with CUDA enabled and CMAKE_LINKER_TYPE=MOLD, the ABI detection for CUDA and the trycompile fail with collect2: fatal error: cannot find 'ld'
By default cmake does not show the output of the ABI detection failure, but running with --debug-trycompile shows the location of the ABI detection project, and running make in that directory reveals that both ABI deteection and trycompile fail with the same error.
mold is installed in /usr/local/bin/mold and /usr/local/bin is on the PATH.
I am running
- gcc 13.2.0
- cmake 3.29.6 (but i have also tried with 3.30.1)
- mold 2.23.1
- nvcc 12.5.82