Chris Lovett via llvm-dev
2017-Sep-16 03:00 UTC
[llvm-dev] LLVM mtriple for aarch64-win32-msvc ?
Thanks Martin, I'm generating the code using LLVM (writing llvm::Triple myself and llvm::TargetRegistry::lookupTarget is working), and that's how my bitcode is generated then using LLC to cross-compile that. So using armv7-win32-msvc is getting me a bit closer, but what CPU, raspberry pi 3 is running a Cortext-A53, but when I specify that in -mcpu argument I get this error:> llc.exe test.bc -o test.obj -filetype=obj -O3 -mtriple=armv7-win32-msvc-mcpu=cortex-a53 -relocation-model=pic> llc.exe failed: LLVM ERROR: CPU: 'cortex-a53' does not support ARM modeexecution! On Fri, Sep 15, 2017 at 2:20 PM, Martin Storsjö <martin at martin.st> wrote:> On Fri, 15 Sep 2017, Chris Lovett via llvm-dev wrote: > > Is there a way to use LLC to cross-compile some code to run on Windows IOT >> on Raspberry Pi ? >> I was able to convince LLVM to spit out some bitcode for this, but when I >> try llc it dumps: >> >> llc.exe test.bc -o test.obj -filetype=obj -O3 -mtriple=aarch64-win32-msvc >> -mcpu=cortex-a53 >> > > Windows 10 IoT on Raspberry Pi (or anywhere else) is just 32 bit arm for > now, so you want to try the armv7-win32-msvc target triplet instead. > > (There is some preliminary support for aarch64-win32 targets also; it > seems to work for C code for things I've tested so far, but e.g. C++ > support is incomplete. And there's no public aarch64 windows version out at > all yet, it's supposedly coming late this year though. So far I've been > testing it with wine.) > > // Martin >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170915/72a55100/attachment.html>
Tim Northover via llvm-dev
2017-Sep-16 15:36 UTC
[llvm-dev] LLVM mtriple for aarch64-win32-msvc ?
On 16 September 2017 at 04:00, Chris Lovett via llvm-dev <llvm-dev at lists.llvm.org> wrote:> So using armv7-win32-msvc is getting me a bit closer, but what CPU, > raspberry pi 3 is running a Cortext-A53, but when I specify that in -mcpu > argument I get this error: > >> llc.exe test.bc -o test.obj -filetype=obj -O3 -mtriple=armv7-win32-msvc >> -mcpu=cortex-a53 -relocation-model=pic >> llc.exe failed: LLVM ERROR: CPU: 'cortex-a53' does not support ARM mode >> execution!I think I remember from discussions with Saleem that Windows only supports code running in Thumb mode, so using "thumbv7" at the start of the triple is probably a lot more likely to work. That said, I have no idea why it's complaining about the Cortex-A53 CPU, that definitely supports ARM mode. It put it down to gremlins producing random, non-helpful messages. Cheers. Tim.
Martin Storsjö via llvm-dev
2017-Sep-16 18:33 UTC
[llvm-dev] LLVM mtriple for aarch64-win32-msvc ?
On Sat, 16 Sep 2017, Tim Northover wrote:> On 16 September 2017 at 04:00, Chris Lovett via llvm-dev > <llvm-dev at lists.llvm.org> wrote: >> So using armv7-win32-msvc is getting me a bit closer, but what CPU, >> raspberry pi 3 is running a Cortext-A53, but when I specify that in -mcpu >> argument I get this error: >> >>> llc.exe test.bc -o test.obj -filetype=obj -O3 -mtriple=armv7-win32-msvc >>> -mcpu=cortex-a53 -relocation-model=pic >>> llc.exe failed: LLVM ERROR: CPU: 'cortex-a53' does not support ARM mode >>> execution! > > I think I remember from discussions with Saleem that Windows only > supports code running in Thumb mode, so using "thumbv7" at the start > of the triple is probably a lot more likely to work.Indeed, that's correct. Within the clang frontend, we remap all armv7-win32 to thumbv7-win32 internally, and for various reasons I've kept using the armv7 named triplet in my own command lines. // Martin
Saleem Abdulrasool via llvm-dev
2017-Sep-16 21:19 UTC
[llvm-dev] LLVM mtriple for aarch64-win32-msvc ?
Yeah, Windows 10 is a pure thumb2 environment. Although it is possible to execute ARM mode code, any context switch into kernel space can cause problems (they do not guarantee that you will be in ARM mode when you come back). For that reason, we simply force everything is generated in thumb mode only. When using clang, we allow the user to specify `armv7-unknown-windows-msvc` as the triple and map that to `thumbv7-unknown-windows-msvc`. On Sat, Sep 16, 2017 at 8:36 AM, Tim Northover via llvm-dev < llvm-dev at lists.llvm.org> wrote:> On 16 September 2017 at 04:00, Chris Lovett via llvm-dev > <llvm-dev at lists.llvm.org> wrote: > > So using armv7-win32-msvc is getting me a bit closer, but what CPU, > > raspberry pi 3 is running a Cortext-A53, but when I specify that in -mcpu > > argument I get this error: > > > >> llc.exe test.bc -o test.obj -filetype=obj -O3 -mtriple=armv7-win32-msvc > >> -mcpu=cortex-a53 -relocation-model=pic > >> llc.exe failed: LLVM ERROR: CPU: 'cortex-a53' does not support ARM mode > >> execution! > > I think I remember from discussions with Saleem that Windows only > supports code running in Thumb mode, so using "thumbv7" at the start > of the triple is probably a lot more likely to work. > > That said, I have no idea why it's complaining about the Cortex-A53 > CPU, that definitely supports ARM mode. It put it down to gremlins > producing random, non-helpful messages. > > Cheers. > > Tim. > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-- Saleem Abdulrasool compnerd (at) compnerd (dot) org -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170916/f1dfce3e/attachment.html>