Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 413545 - default confgcc for armv7m should include " --with-mode=thumb"
Summary: default confgcc for armv7m should include " --with-mode=thumb"
Status: RESOLVED DUPLICATE of bug 264534
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: ARM Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-25 17:07 UTC by Christopher Friedt
Modified: 2012-04-27 01:15 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
toolchain_eclass-default-to-thumb-mode-for-armv7m.patch (toolchain_eclass-default-to-thumb-mode-for-armv7m.patch,485 bytes, patch)
2012-04-25 17:07 UTC, Christopher Friedt
Details | Diff
/tmp/toolchain_eclass-default-to-thumb-mode-for-armv7m.patch v2 (toolchain_eclass-default-to-thumb-mode-for-armv7m.patch,483 bytes, patch)
2012-04-25 19:52 UTC, Christopher Friedt
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Friedt 2012-04-25 17:07:02 UTC
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.
Comment 1 Christopher Friedt 2012-04-25 17:07:57 UTC
Created attachment 310093 [details, diff]
toolchain_eclass-default-to-thumb-mode-for-armv7m.patch
Comment 2 Christopher Friedt 2012-04-25 17:12:33 UTC
see #413547 for the newlib patch
Comment 3 Christopher Friedt 2012-04-25 17:13:07 UTC
bug #413547 ... hyperlink?
Comment 4 Christopher Friedt 2012-04-25 19:52:07 UTC
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 '?'
Comment 5 SpanKY gentoo-dev 2012-04-27 01:15:29 UTC
not an exact dupe, but largely the same issue

*** This bug has been marked as a duplicate of bug 264534 ***