| Summary: | default confgcc for armv7m should include " --with-mode=thumb" | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Christopher Friedt <chrisfriedt> |
| Component: | Eclasses | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | normal | ||
| Priority: | Normal | ||
| Version: | unspecified | ||
| Hardware: | ARM | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
| Attachments: |
toolchain_eclass-default-to-thumb-mode-for-armv7m.patch
/tmp/toolchain_eclass-default-to-thumb-mode-for-armv7m.patch v2 |
||
Created attachment 310093 [details, diff]
toolchain_eclass-default-to-thumb-mode-for-armv7m.patch
see #413547 for the newlib patch bug #413547 ... hyperlink? Created attachment 310115 [details, diff]
/tmp/toolchain_eclass-default-to-thumb-mode-for-armv7m.patch v2
This patch has a couple of minor corrections that I noticed after testing
1) eliminate space after +=
2) remove '?'
not an exact dupe, but largely the same issue *** This bug has been marked as a duplicate of bug 264534 *** |
When creating a toolchain targeting an armv7-m core, such as cortex-m3 or cortex-m4, toolchain.eclass should configure gcc to default to thumb mode, otherwise any simple compilation unit fails with "error: target CPU does not support ARM mode". $ echo "int foo() { return 0; }" > conftest.c $ armv7m-elf-eabi-gcc -c conftest.c conftest.c:1:0: error: target CPU does not support ARM mode $ armv7m-elf-eabi-gcc -mthumb -c conftest.c $ echo $? 0 Please see the attached patch for the fix, which simply adds " --with-mode=thumb" to GCC's configure line. *Note*: newlib requires a patch for newlib/configure.host (use "arm*)" instead of "arm)") in order to properly compile... how this was overlooked, I have no idea. I'll submit that patch in a separate bug report. Reproducible: Always Steps to Reproduce: 1. crossdev --g 4.6.1-r1 --target armv7m-elf-eabi -P -v 2. 3.