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

Fix Android build errors on macOS. #18031

Merged
merged 1 commit into from Sep 15, 2017

Conversation

Projects
None yet
5 participants
@jhlin
Copy link
Contributor

commented Aug 10, 2017

  • Add sysroot path to environment variable 'CPPFLAGS':
    When checking C preprocessor, the 'configure' script of libbacktrace uses 'CPPFLAGS' rather than 'CFLAGS' and doesn't get the correct search path. (#15758)
    This check passes on Linux because the '/lib/cpp' fallback is available there.

  • Introduce CMake toolchain file for Android cross compiling:
    CMake needs several variables [1] to cross compile for Android.
    It works (accidentally) on Linux because cmake-rs sets compilers correctly and binutils for Linux & Android are pretty much the same.

[1] https://cmake.org/cmake/help/v3.7/manual/cmake-toolchains.7.html#cross-compiling-for-android-with-the-ndk


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #15758 (github issue number if applicable).
  • There are tests for these changes OR
  • These changes do not require tests because it's a fix to build errors.

This change is Reviewable

Fix Android build errors on macOS.
- Add sysroot path to environment variable 'CPPFLAGS':
  When checking C preprocessor, the 'configure' script of libbacktrace uses 'CPPFLAGS' rather than 'CFLAGS' and doesn't get the correct search path. (#15758)
  This check passes on Linux because the '/lib/cpp' fallback is available there.

- Introduce CMake toolchain file for Android cross compiling:
  CMake needs several variables [1] to cross compile for Android.
  It works (accidentally) on Linux because cmake-rs sets compilers correctly and binutils for Linux & Android are pretty much the same.

[1] https://cmake.org/cmake/help/v3.7/manual/cmake-toolchains.7.html#cross-compiling-for-android-with-the-ndk
@highfive

This comment has been minimized.

Copy link

commented Aug 10, 2017

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

@highfive

This comment has been minimized.

Copy link

commented Aug 10, 2017

Heads up! This PR modifies the following files:

@MortimerGoro

This comment has been minimized.

Copy link
Contributor

commented Aug 17, 2017

This is great, thanks for doing it!

@jhlin

This comment has been minimized.

Copy link
Contributor Author

commented Sep 15, 2017

Hi @mbrubeck, it's been a while since this PR is created. What do you think of it?

@mbrubeck

This comment has been minimized.

Copy link
Contributor

commented Sep 15, 2017

@bors-servo r+

Oops, sorry for the delay. This looks good!

@bors-servo

This comment has been minimized.

Copy link
Contributor

commented Sep 15, 2017

📌 Commit fbdb209 has been approved by mbrubeck

@bors-servo

This comment has been minimized.

Copy link
Contributor

commented Sep 15, 2017

⌛️ Testing commit fbdb209 with merge e899a53...

bors-servo added a commit that referenced this pull request Sep 15, 2017

Auto merge of #18031 - jhlin:android-build-on-macos, r=mbrubeck
Fix Android build errors on macOS.

- Add sysroot path to environment variable 'CPPFLAGS':
  When checking C preprocessor, the 'configure' script of libbacktrace uses 'CPPFLAGS' rather than 'CFLAGS' and doesn't get the correct search path. (#15758)
  This check passes on Linux because the '/lib/cpp' fallback is available there.

- Introduce CMake toolchain file for Android cross compiling:
  CMake needs several variables [1] to cross compile for Android.
  It works (accidentally) on Linux because cmake-rs sets compilers correctly and binutils for Linux & Android are pretty much the same.

[1] https://cmake.org/cmake/help/v3.7/manual/cmake-toolchains.7.html#cross-compiling-for-android-with-the-ndk

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #15758 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because it's a fix to build errors.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18031)
<!-- Reviewable:end -->
@bors-servo

This comment has been minimized.

Copy link
Contributor

commented Sep 15, 2017

⛄️ The build was interrupted to prioritize another pull request.

@mbrubeck

This comment has been minimized.

Copy link
Contributor

commented Sep 15, 2017

@bors-servo treeclosed-

@bors-servo

This comment has been minimized.

Copy link
Contributor

commented Sep 15, 2017

⌛️ Testing commit fbdb209 with merge a3b85cb...

bors-servo added a commit that referenced this pull request Sep 15, 2017

Auto merge of #18031 - jhlin:android-build-on-macos, r=mbrubeck
Fix Android build errors on macOS.

- Add sysroot path to environment variable 'CPPFLAGS':
  When checking C preprocessor, the 'configure' script of libbacktrace uses 'CPPFLAGS' rather than 'CFLAGS' and doesn't get the correct search path. (#15758)
  This check passes on Linux because the '/lib/cpp' fallback is available there.

- Introduce CMake toolchain file for Android cross compiling:
  CMake needs several variables [1] to cross compile for Android.
  It works (accidentally) on Linux because cmake-rs sets compilers correctly and binutils for Linux & Android are pretty much the same.

[1] https://cmake.org/cmake/help/v3.7/manual/cmake-toolchains.7.html#cross-compiling-for-android-with-the-ndk

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #15758 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because it's a fix to build errors.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/18031)
<!-- Reviewable:end -->
@bors-servo

This comment has been minimized.

Copy link
Contributor

commented Sep 15, 2017

@bors-servo bors-servo merged commit fbdb209 into servo:master Sep 15, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
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.