tomtom69 wrote:Meanwhile I got a solution for the thumb problem.
For everyone who wants to program a TI stellaris launchpad with gentoo linux:
I built a toolchain with
crossdev -t arm-stellaris-eabi --genv 'EXTRA_ECONF="--with-cpu=cortex-m4 --with-tune=cortex-m4 --with-mode=thumb --with-fpu=fpv4-sp-d16 --with-float-abi=softfp"'
tomtom69's fix no-longer works, as of Aug 2018.
The EXTRA_ECONF causes crossdev to bomb out.
The reason tomtom69 was getting emulated floating point is because they used --softfloat
Softfloat means "software based floating point"
For hardware floating point instructions, the compiler needs --hardfloat
As of this date AUG 2018, the crossdev toolchains are complied by an eclass script; eg: default location /tmp/portage/eclass/toolchain.eclass
In that program, it assumes newlib is being compiled for any toolchain ending in -eabi.
You can see this in the code commented with: ### Cross-compiler options
Further down in the section labeled, ### arch options
The thumb switch is only set when ARM7-M microcontroller processor is specified.
So, it may not set --thumb for ARM6-M or earlier (eg: cortex M0) processors.
If you still get the bug, which this thread was opened for, and you use armv7.
I assume one of these commands would work for the original thread's question, depending on the processor you actually have:
crossdev armv7m-stellaris-eabi
crossdev armv7m-hardfloat-eabi
crossdev armv7m-softfloat-eabi
If the bug persists, and you have an arm v6 processor, you might be able to solve it by adding two lines after the armv7 detection, to allow armv6 detection as well.
This will cover arm cortex m0 processors...
FILE: /usr/portage/eclass/toolchain.eclass -- at around line #1142, you'll see the following two lines.
Code: Select all
# Convert armv7{a,r,m} to armv7-{a,r,m}
[[ ${arm_arch} == armv7? ]] && arm_arch=${arm_arch/7/7-}
Immediately after, add these two lines:
Code: Select all
# Convert armv6{a,r,m} to armv6-{a,r,m}
[[ ${arm_arch} == armv6? ]] && arm_arch=${arm_arch/6/6-}
And, that will cause crossdev to add these flags to the gcc compile: --arch=armv6-m --with-mode=thumb
Which means you could do:
crossdev armv6m-softfloat-eabi # for thumb code in a cortex m0.
What's the difference between a liar and a joker? A liar always claims what they said was just a joke, but a real joker just laughs.