Jan Hoogerbrugge
2013-Oct-11 18:23 UTC
[LLVMdev] Generate code for ARM Cortex m0, m3, and m4.
Hi, I am trying to cross compile code for ARM Cortex m0, m3, and m4. For m0, I use: -target armv6--eabi -mcpu=cortex-m0 That seems to work. For m3 and m4, I use the following which does not work (fatal error: error in backend: CPU: 'cortex-m3' does not support ARM mode): -target armv7m--eabi -mcpu=cortex-m3 and -target armv7em--eabi -mcpu=cortex-m4 Who can help me with the right command line arguments for m3 and m4? Thanks, Jan
Add -mthumb. It’s also probably a bug in the driver that that’s required. It should be implied by the v7m triple and/or cpu. Mind filing a PR to that effect? -Jim On Oct 11, 2013, at 11:23 AM, Jan Hoogerbrugge <jan.hoogerbrugge at biface-tools.com> wrote:> Hi, > > I am trying to cross compile code for ARM Cortex m0, m3, and m4. > > For m0, I use: > > -target armv6--eabi -mcpu=cortex-m0 > > That seems to work. For m3 and m4, I use the following which does not work > (fatal error: error in backend: CPU: 'cortex-m3' does not support ARM mode): > > -target armv7m--eabi -mcpu=cortex-m3 > > and > > -target armv7em--eabi -mcpu=cortex-m4 > > Who can help me with the right command line arguments for m3 and m4? > > Thanks, > Jan > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Amara Emerson
2013-Oct-12 22:00 UTC
[LLVMdev] Generate code for ARM Cortex m0, m3, and m4.
Hi Jan, For Cortex-M0, you should probably use the armv6m string in the target triple. For M3 and M4 you need to use the thumbv7m arch string, -mthumb won't be necessary. Amara On 11 October 2013 19:23, Jan Hoogerbrugge < jan.hoogerbrugge at biface-tools.com> wrote:> Hi, > > I am trying to cross compile code for ARM Cortex m0, m3, and m4. > > For m0, I use: > > -target armv6--eabi -mcpu=cortex-m0 > > That seems to work. For m3 and m4, I use the following which does not work > (fatal error: error in backend: CPU: 'cortex-m3' does not support ARM > mode): > > -target armv7m--eabi -mcpu=cortex-m3 > > and > > -target armv7em--eabi -mcpu=cortex-m4 > > Who can help me with the right command line arguments for m3 and m4? > > Thanks, > Jan > > > ______________________________**_________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/**mailman/listinfo/llvmdev<http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131012/5872a4c4/attachment.html>
On 12 October 2013 23:00, Amara Emerson <amara.emerson at gmail.com> wrote:> Hi Jan, > > For Cortex-M0, you should probably use the armv6m string in the target > triple. For M3 and M4 you need to use the thumbv7m arch string, -mthumb > won't be necessary. >Yes, but I agree with Jim that a bug must be filled. Jan, would you mind filling a bug? http://llvm.org/bugs/enter_bug.cgi?product=clang cheers, --renato -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131012/fcf942ad/attachment.html>
Seemingly Similar Threads
- [LLVMdev] Generate code for ARM Cortex m0, m3, and m4.
- [LLVMdev] Generate code for ARM Cortex m0, m3, and m4.
- [LLVMdev] Generate code for ARM Cortex m0, m3, and m4.
- [LLVMdev] Generate code for ARM Cortex m0, m3, and m4.
- [LLVMdev] Setting up a cross-compiler for cortex-m3