Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use armv6t2 instead of armv6 #149

Closed
wants to merge 1 commit into from
Closed

Conversation

TimNN
Copy link
Contributor

@TimNN TimNN commented Apr 1, 2017

This is required to correctly build compiler-rt of rust-lang/rust with LLVM 4.0.

I don't know what exactly the consequences of this change are, however in general armv6t2 seems to be widely supported. However note that the raspberry pi 1, for example, apparently does not support Thumb 2. See also the Wikipedia List of ARM Microarchitectures.

cc @nagisa: You have done some research into this as well, I believe.

cc rust-lang/rust#40123

@nagisa
Copy link
Member

nagisa commented Apr 1, 2017

Is there a way to disable both the thumbs? If not, then this seems like an obvious sol'n to me.

@TimNN
Copy link
Contributor Author

TimNN commented Apr 1, 2017

Is there a way to disable both the thumbs?

I have no idea. Gcc accepts armv6 armv6-m armv6j armv6k armv6kz armv6s-m armv6t2 armv6z armv6zk for -march however I think they all imply at least Thumb1, with some implying only a subset of Thumb2.

@alexcrichton
Copy link
Member

This comment seems quite relevent perhaps?

Currently arm-unknown-linux-gnu is sort of our "maxially compatible ARM" target, so if we're slicing out platforms (esp rpi) we may want to try to work around this another way unfortunately :(

@nagisa
Copy link
Member

nagisa commented Apr 2, 2017

So I tried to use a number of options to see if any of them would remove the define for thumb, sadly none of them except redefining the environment variable manually helped:

  -marm                       Generate code in 32 bit ARM state. (does not disable the THUMB define, though)
  -mno-thumb                  (CLANG ONLY: does not disable the thumb define either)
  -march=*                    Some thumb gets defined for all of them
  -D__ARM_ARCH_ISA_THUMB=0    (WORKS) Redefine manually to something else.

This is how I was testing it:

arm-none-eabi-gcc -dM -E -xc {PARAMS} /dev/null | grep THUMB

So I suppose simply adding this define for our own compiler-rt compilation is the way to go, leaving gcc-rs alone.

@nagisa
Copy link
Member

nagisa commented Apr 2, 2017

A small aside, I read a recommendation in multiple locations that if thumb2 is not available, -marm should be used, because thumb1 by itself is terrible and everything.

@TimNN TimNN mentioned this pull request Apr 2, 2017
5 tasks
@TimNN
Copy link
Contributor Author

TimNN commented Apr 2, 2017

Using a different fix for now (-D__ARM_ARCH_ISA_THUMB=0 ).

@TimNN TimNN closed this Apr 2, 2017
@TimNN TimNN deleted the armv6t2 branch April 2, 2017 10:38
@MineFuehrer
Copy link

@TimNN
Stop running with scissors man! The only practical user of this target is the Rpi(A,B,zero). Learn the basics before proposing any more "fixes" like this.

@MineFuehrer
Copy link

MineFuehrer commented Apr 2, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants