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

New cross target: i686-linux-android #27957

Merged
merged 3 commits into from Aug 25, 2015

Conversation

Projects
None yet
6 participants
@overminder
Copy link
Contributor

overminder commented Aug 23, 2015

  • All the libstd tests are passing in the optimized build against
    a Zenfone2 and the x86 Android emulator.

I haven't tested the other libraries though.

New cross target: i686-linux-android
- All the libstd tests are now passing in the optimized build against
  a Zenfone2 and the x86 Android simulator.
@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Aug 23, 2015

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nikomatsakis (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rkruppe

This comment has been minimized.

Copy link
Member

rkruppe commented Aug 23, 2015

If I read this correctly, this target won't use SSE and SSE2 instructions, instead restricting itself to x87. Correct?

That would be inconsistent with all other i686 targets (in tree, at least), leave performance on the table, and cause many floating point operations to occasionally be slightly inaccurate (i.e., have more rounding error than necessary), from basic arithmetic to the parsing of decimal strings. Assuming x86 Android phones don't use ancient hardware like Pentium < 4 or Athlon XP, there is no harm in using a baseline microarchitecture that has SSE and SSE2, such as Pentium 4. See the other i686 targets in librustc_back/target.

@overminder

This comment has been minimized.

Copy link
Contributor Author

overminder commented Aug 23, 2015

Thanks for the pointers! I didn't know that :P
I will set its CPU to 'pentium4' and test libstd again.

overminder added some commits Aug 23, 2015

i686-linux-android: set -mcpu to pentium4.
To allow SSE2 to be used.
i686-linux-android: Removing useless cfgs.
That line is in a `#[cfg(target_os = "macos")]` block..
@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Aug 24, 2015

@bors: r+ 6887d8c

Thanks!

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Aug 25, 2015

⌛️ Testing commit 6887d8c with merge 19aadd5...

bors added a commit that referenced this pull request Aug 25, 2015

Auto merge of #27957 - overminder:aug23-i686-android, r=alexcrichton
- All the libstd tests are passing in the optimized build against
  a Zenfone2 and the x86 Android emulator.

I haven't tested the other libraries though.

@bors bors merged commit 6887d8c into rust-lang:master Aug 25, 2015

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@overminder

This comment has been minimized.

Copy link
Contributor Author

overminder commented Aug 26, 2015

Thanks.

By the way, one of the most time-consuming work during the porting was to ensure that the FFI types defined in Rust (e.g., libc::stat) are exactly the same as defined in the target's C headers. I eventually just made a build script to generate C functions to return the sizeofs and offsets of some of the fields and structs, and compare them with the Rust ones. Do we have a more automatic way to do that?

Another thing that I didn't quite understand was that there were two stat definitions in Rust, one in liblibc and the other in libstd (std::os::unix::raw). That also caused me some troubles.. Could someone explain why it's the case?

@overminder overminder deleted the overminder:aug23-i686-android branch Aug 27, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.