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 on Fedora 40. #32532

Merged
merged 1 commit into from
Jun 18, 2024
Merged

Conversation

jschwe
Copy link
Contributor

@jschwe jschwe commented Jun 17, 2024

  • Postfix PATH with android toolchain: We only need to edit path for the linker specified in the .cargo/config.toml to be found. Adding the NDK clang to the end of PATH is sufficient for that. Adding the NDK clang to the front can cause problems however, since it causes the NDK clang to be preferred over the system clang. This can cause problems on some systems, where compiling e.g. buildscripts for HOST subsequently fails.
  • Prefix target compiler and compiler flags variables with TARGET_ so as not to influence compilation for HOST targets.
  • SET CLANG_PATH to avoid bindgen #2682

  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix building for android in some cases

* Postfix PATH with android toolchain:
  We only need to edit path for the linker specified
  in the `.cargo/config.toml` to be found. Adding the
  NDK clang to the end of PATH is sufficient for that.
  Adding the NDK clang to the front can cause problems
  however, since it causes the NDK `clang` to be
  preferred over the system clang. This can cause
  problems on some systems, where compiling
  e.g. buildscripts for HOST subsequently fails.
* Prefix target compiler and compiler flags variables
  with `TARGET_` so as not to influence compilation
  for HOST targets.
 * SET `CLANG_PATH` to avoid [bindgen servo#2682]

 [bindgen servo#2682]: rust-lang/rust-bindgen#2682

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
@jschwe
Copy link
Contributor Author

jschwe commented Jun 17, 2024

Copy link
Member

@mukilan mukilan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks for this fix!

@mukilan mukilan added this pull request to the merge queue Jun 18, 2024
Merged via the queue into servo:main with commit 79cd87a Jun 18, 2024
10 checks passed
@jschwe jschwe deleted the jschwender/fix_android branch June 19, 2024 14:04
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.

None yet

2 participants