2

I'm using CMake to setup a cross compilation for ARM Cortex M4. The recommended way to link when using the gcc-arm-none-eabi toolchain is to let gcc drive the linker. It seems however that CMake will set ld as the linker and I can't find a way to force it to gcc.

For the compiler i use CMakeForceCompiler and the CMAKE_FORCE_C_COMPILER marco but I can't find a similar option for the linker.

[edit] Running make VERBOSE=1 shows that CMake actually are letting gcc drive linking. The question remains though. How do I force a specific linker?

evading
  • 3,032
  • 6
  • 37
  • 57
  • You can overwrite `CMAKE_C_LINK_EXECUTABLE` to define your own link line (see e.g. [here](http://stackoverflow.com/questions/30313387/cmake-cross-compile-with-specific-linker-doesnt-pass-arguments-to-armlink) or [here](http://stackoverflow.com/questions/1867745/cmake-use-a-custom-linker)). – Florian Apr 09 '16 at 17:47

0 Answers0