<div dir="ltr"><div>Hello,</div><div> </div><div>I'm confused by an issue that I am having with a project I have recently joined.</div><div> </div><div>We are cross compiling for ARM on linux.</div><div> </div><div>I have the cross compiler toolchain installed at /CC_TOOLCHAIN</div>
<div> </div><div>I set CMAKE_SYSROOT_PATH appropriately, then do this in my toolchain file:</div><div><br>set(CMAKE_FIND_ROOT_PATH "${CMAKE_SYSROOT_PATH}/usr/lib")<br>set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)<br>
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)<br>set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)</div><div> </div><div>upon launching cmake with this command:</div><div>cmake --debug-trycompile --debug-output -DCMAKE_TOOLCHAIN_FILE=CC_TOOLCHAIN/toolchain.cmake ../src</div>
<div> </div><div>I encounter this error</div><div> </div><div>/CC_TOOLCHAIN/arm-gcc<br> -D_POSIX_C_SOURCE=199506 -D_POSIX_VERSION=199506 -DGPT_VERSION="" -o<br> CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o -c<br>
/home/Me/build/CMakeTmp/testCCompiler.c</div><div> Linking C executable cmTryCompileExec</div><div> cmake -E cmake_link_script CMakeFiles/cmTryCompileExec.dir/link.txt --verbose=1</div><div> <br> /CC_TOOLCHAIN/arm-gcc<br>
CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o -o cmTryCompileExec<br> -rdynamic</div><div> <br> /CC_TOOLCHAIN/ld:<br> cannot find crt1.o: No such file or directory</div><div> </div><div> </div><div>Curious as to the contents of the cmake_link_script at CMakeFiles/cmTryCompileExec.dir/link.txt </div>
<div> </div><div>$cat link.txt</div><div> </div><div>/CC_TOOLCHAIN/arm-gcc CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o -o cmTryCompileExec -rdynamic </div><div> </div><div> </div><div>So, I guess my question is, where is the "-L" to specify link directories, or how do I know / specify where the linker thinks it is allowed to look for libraries ?</div>
<div> </div><div>Thanks.</div><div>Jack</div><div> </div></div>