<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Wed, Aug 22, 2018 at 3:02 PM Brad King <<a href="mailto:brad.king@kitware.com">brad.king@kitware.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 08/22/2018 03:49 PM, Richard Shaw wrote:<br>
> Initially I tried setting the flags before invoking "project" and that seemed<br>
> to be enough for Fedora. I've tried other things as well that I've probably<br>
> forgotten but one other method I tried was:<br>
> <br>
> set(CMAKE_REQUIRED_DEFINITIONS "--specs=nosys.specs")<br>
<br>
That's only used by Check* modules. It does not affect flags in general.<br></blockquote><div><br></div><div>Good to know, I can remove that.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">From the ubuntu issue:<br>
<br>
> The target system is: Generic - 1 - arm<br>
> The host system is: Linux - 4.15.0-32-generic - x86_64<br>
<br>
You're cross-compiling. What is your CMAKE_TOOLCHAIN_FILE?<br></blockquote><div><br></div><div>Yes, I could have worded it better but I have tried passing the toolchain file on the command line with the same result. Currently I'm using an "include" of the toolchain file prior to calling "project" since 100% of development happens on a PC instead of having to pass the CMAKE_TOOLCHAIN_FILE option every time.</div><div><br></div><div>Here's the contents:</div><div><br></div><div><div>set(CMAKE_SYSTEM_NAME Generic)</div><div>set(CMAKE_SYSTEM_PROCESSOR arm)</div><div>set(CMAKE_SYSTEM_VERSION 1)</div><div><br></div><div><br></div><div># specify the cross compiler</div><div>set(CMAKE_C_COMPILER arm-none-eabi-gcc)</div><div>set(CMAKE_CXX_COMPILER arm-none-eabi-cpp)</div><div><br></div><div>set(CMAKE_EXE_LINKER_FLAGS "-T${CMAKE_SOURCE_DIR}/stm32_flash.ld")</div><div>set(CMAKE_EXECUTABLE_SUFFIX_C ".elf")</div><div>set(CMAKE_EXECUTABLE_SUFFIX_CXX ".elf")</div><div>set(CMAKE_EXECUTABLE_SUFFIX_ASM ".elf")</div><div><br></div><div># Macro for elf->bin</div><div>macro(elf2bin target)</div><div> add_custom_command(TARGET ${target}</div><div> POST_BUILD COMMAND ${CMAKE_OBJCOPY} -O binary ${target}.elf ${target}.bin</div><div> COMMENT "Creating binary for ${target}")</div><div>endmacro()</div></div><div><br></div><div>Thanks,</div><div>Richard</div></div></div>