CMake 3.9, arm-gcc 5.4.1, Linux / OSX:
I'm enabling stack smashing protection by adding -fstack-protector-strong to my compiler flags. This instructs gcc to look for specially-named symbols in the hard-coded libraries libssp.a and libssp_nonshared.a.
These libraries exist in my application as part of the build, but they do not yet exist when CMake is interrogating my compiler during the configuration phase.
This causes CMake to fail, which makes sense:
[2/2] Linking CXX executable cmTC_0f43d FAILED: cmTC_0f43d /path/to/arm-none-eabi-g++ -fstack-protector-strong CMakeFiles/cmTC_0f43d.dir/testCXXCompiler.cxx.obj -o cmTC_0f43d /path/to/arm-none-eabi/bin/ld: cannot find -lssp_nonshared /path/to/arm-none-eabi/bin/ld: cannot find -lssp Is there any way to:
- Tell CMake to not use
-fstack-protector-strongduring compiler interrogation? - Provide an empty "dummy" version of
libsspandlibssp_nonsharedduring interrogation? - Skip compiler interrogation entirely? (This is a custom toolchain.)
Or any other way to work around this?