Skip to content

Fix android build on Fedora 40. - #32532

Merged
mukilan merged 1 commit into
servo:mainfrom
jschwe:jschwender/fix_android
Jun 18, 2024
Merged

mukilan merged 1 commit into
servo:mainfrom
jschwe:jschwender/fix_android

Conversation

@jschwe

@jschwe jschwe commented Jun 17, 2024

Copy link
Copy Markdown
Member
  • 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 <[email protected]>
@jschwe

jschwe commented Jun 17, 2024

Copy link
Copy Markdown
Member Author

@jschwe jschwe mentioned this pull request Jun 17, 2024
2 of 3 tasks

@mukilan mukilan left a comment

Copy link
Copy Markdown
Member

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
@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.

2 participants