Chuck Atkins via llvm-dev
2015-Nov-19 18:17 UTC
[llvm-dev] [PATCH] [CMAKE] Allow a toolchain file for the host when cross-compiling
The current behavior is to not specify any toolchain and invoke CMake without additional arguments for configuring the NATIVE portion of the build. However, CMake will actually set the CC, CXX, and FC environment variables to full paths of the compilers in the CMAKE_{C,CXX,Fortran}_COMPILER CMake variables inside the CMake process. This results in those variables being propagated to any execute_process calls so without explicitly providing a separate toolchain file, the configure step for the NATIVE host will pick up the compilers used by the cross-compile toolchain intended for the target CPU. --- cmake/modules/CrossCompile.cmake | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-CMAKE-Allow-a-toolchain-file-for-the-host-when-cross.patch Type: text/x-patch Size: 1754 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151119/5b755b84/attachment.bin>
Chuck Atkins via llvm-dev
2015-Nov-19 19:35 UTC
[llvm-dev] [PATCH] [CMAKE] Allow a toolchain file for the host when cross-compiling
Scratch the first one, it's got some typos. This is the one I meant to upload. I've been using it for cross-compiling on Cray. - Chuck On Thu, Nov 19, 2015 at 1:17 PM, Chuck Atkins <chuck.atkins at kitware.com> wrote:> The current behavior is to not specify any toolchain and invoke CMake > without additional arguments for configuring the NATIVE portion of the > build. However, CMake will actually set the CC, CXX, and FC > environment variables to full paths of the compilers in the > CMAKE_{C,CXX,Fortran}_COMPILER CMake variables inside the CMake process. > This results in those variables being propagated to any execute_process > calls so without explicitly providing a separate toolchain file, the > configure step for the NATIVE host will pick up the compilers used by > the cross-compile toolchain intended for the target CPU. > --- > cmake/modules/CrossCompile.cmake | 14 ++++++++++---- > 1 file changed, 10 insertions(+), 4 deletions(-) >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151119/9b010e2f/attachment-0001.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-CMAKE-Allow-a-toolchain-file-for-the-host-when-cross.patch Type: text/x-patch Size: 2691 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151119/9b010e2f/attachment-0001.bin>
Chris Bieneman via llvm-dev
2015-Dec-09 17:30 UTC
[llvm-dev] [PATCH] [CMAKE] Allow a toolchain file for the host when cross-compiling
Sorry for the delay in responding to this, I’m WAY behind on my email. The patch looks good to me. Thanks for doing this, it is a nice improvement over the existing code! -Chris> On Nov 19, 2015, at 11:35 AM, Chuck Atkins via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > Scratch the first one, it's got some typos. This is the one I meant to upload. I've been using it for cross-compiling on Cray. > > - Chuck > > On Thu, Nov 19, 2015 at 1:17 PM, Chuck Atkins <chuck.atkins at kitware.com <mailto:chuck.atkins at kitware.com>> wrote: > The current behavior is to not specify any toolchain and invoke CMake > without additional arguments for configuring the NATIVE portion of the > build. However, CMake will actually set the CC, CXX, and FC > environment variables to full paths of the compilers in the > CMAKE_{C,CXX,Fortran}_COMPILER CMake variables inside the CMake process. > This results in those variables being propagated to any execute_process > calls so without explicitly providing a separate toolchain file, the > configure step for the NATIVE host will pick up the compilers used by > the cross-compile toolchain intended for the target CPU. > --- > cmake/modules/CrossCompile.cmake | 14 ++++++++++---- > 1 file changed, 10 insertions(+), 4 deletions(-) > > <0001-CMAKE-Allow-a-toolchain-file-for-the-host-when-cross.patch>_______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20151209/b94bc875/attachment.html>