[cfe-dev] Building for target armv7a-win32-eabi not possible
Peter Smith via cfe-dev
cfe-dev at lists.llvm.org
Tue Oct 2 03:04:35 PDT 2018
Hello Jayvee,
On Tue, 2 Oct 2018 at 10:30, Jayvee Neumann via cfe-dev
<cfe-dev at lists.llvm.org> wrote:
>
> Hello together,
>
> I have a question regarding the the target triple armv7a-win32-eabi. I want to emit ARM code (not thumb code) for windows. The object file should be in COFF.
> When calling clang++ with that target and the "--verbose" switch, I can see that the generated triple is "tumbv7--windows-eabi". This is explicitly not what I specified as a target.
> I then went ahead and changed the generated call to use "-triple armv7a--windows-eabi". This resulted in the compiler error:
> > error: Function 'func' uses ARM instructions, but the target does not support ARM mode execution.
> > fatal error: error in backend: unsupported relocation type: fixup_arm_uncondbl
>
> The question I have is, why is it prohibited to export ARM code for win32? When I replace "win32" with "none" I get no such error.
>
My, somewhat limited, understanding is that Windows for Arm is
designed only for Thumb, for example there may be places in the tools
and the OS that don't handle interworking between Arm and Thumb
correctly. This prevents Arm instructions from being used safely on
the platform. When you remove the win32 with none you are removing
that platform specific restriction, however you are probably not
getting a Windows compatible COFF file out either.
I think you'll also not want EABI in your triple as that is the ELF
ABI and not the Windows compatible COFF ABI that you'll need on
Windows. You may want to try a target like thumbv7a-windows-msvc
Peter
> Best regards,
> Jayvee
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
More information about the cfe-dev
mailing list