llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.36k stars 11.71k forks source link

targeting ARM Cortex M3/M4 needs -mthumb #17933

Closed llvmbot closed 10 years ago

llvmbot commented 10 years ago
Bugzilla Link 17559
Resolution FIXED
Resolved on Dec 13, 2013 08:41
Version trunk
OS Linux
Reporter LLVM Bugzilla Contributor
CC @rengolin

Extended Description

See: http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-October/066379.html

llvmbot commented 10 years ago

Fixed by commits 197151 and 197152.

llvmbot commented 10 years ago

Two patches up for review on Phabricator:

http://llvm-reviews.chandlerc.com/D2061 http://llvm-reviews.chandlerc.com/D2062

It's not beautiful, but I believe it works and is at least better than where we are now.

rengolin commented 10 years ago

Hi Bernie,

I've done that, but the problem is that the function that chooses CPU from Arch ends up not recognizing "thumbv7m" and picks ARM7TDMI as the CPU, which is completely wrong.

You need to add CPU checks on your tests to make sure all arch strings pick the right CPU on either ARM and Thumb mode.

llvmbot commented 10 years ago

Candidate patch to make thumb the default for v7(e)m in clang Attached a patch, which I've also posted for review on cfe-commits.

rengolin commented 10 years ago

Sorry, I meant, "armv7m".

rengolin commented 10 years ago

Basically, we need to make "armv6m" to default to Thumb mode.