[PATCH] D125827: [cmake] Don't try creating an executable when detecting the linker

Shoaib Meenai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 24 13:19:24 PDT 2022


smeenai added a comment.

In D125827#3534224 <https://reviews.llvm.org/D125827#3534224>, @ldionne wrote:

> In D125827#3525570 <https://reviews.llvm.org/D125827#3525570>, @smeenai wrote:
>
>> LGTM, thanks.
>>
>> In D125827#3525320 <https://reviews.llvm.org/D125827#3525320>, @ldionne wrote:
>>
>>> In D125827#3520509 <https://reviews.llvm.org/D125827#3520509>, @smeenai wrote:
>>>
>>>> I think this might potentially break cross-compilation on Windows. We're in a `NOT WIN32` block here, but that means you're not targeting Windows; you could still be targeting e.g. Linux but building on a Windows machine. I think `NUL` is the Windows equivalent, and you could have a `CMAKE_HOST_WIN32` block, but it'll depend on how CMake invokes an `execute_process` command. (I have a Windows machine handy and can experiment with that, if you'd like.) That being said
>>>
>>> Hmm, I just tried it out on a Windows machine and it seems to work.
>>
>> To be clear, were you building for Windows on a Windows machine, or targeting some other platform? The `NOT WIN32` above would have already taken care of the building for Windows on Windows case.
>
> Ugh, yeah, then I guess my testing wasn't sound. Do you have a setup to target Linux from a windows host?

I think Android might be the easiest thing to target. You can download the Android NDK <https://developer.android.com/ndk/downloads> and target it with `-DCMAKE_TOOLCHAIN_FILE=path_to_ndk/build/cmake/android.toolchain.cmake`; I don't know how much of LLVM will build, but you should at least be able to test the CMake configure that way.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125827/new/

https://reviews.llvm.org/D125827



More information about the llvm-commits mailing list