Skip to content

Commit

Permalink
mozjs upgrade: fixes for Android
Browse files Browse the repository at this point in the history
Android NDK's layout has changed in r26 and 'lib64' no longer
exists under `toolchain/llvm/prebuilt/linux-x86_64. The
libraries that used to be under that pass are not present
in `lib` folder itself.

This patch updates the build configuration to use
the `lib` folder instead when configuring the LIBCLANG_PATH
environment variable.

This patch also updates to a newer mozjs version that includes
fixes for linker errors faced on Android (see servo#32769).

Signed-off-by: Mukilan Thiyagarajan <[email protected]>
  • Loading branch information
mukilan committed Jul 26, 2024
1 parent 58bd231 commit d4727c1
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions etc/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ let
systemImageTypes = [ "google_apis" ];
abiVersions = [ "x86" "armeabi-v7a" ];
includeNDK = true;
ndkVersion = "25.2.9519653";
ndkVersion = "26.2.11394342";
useGoogleAPIs = false;
useGoogleTVAddOns = false;
includeExtras = [
Expand Down Expand Up @@ -158,7 +158,7 @@ stdenv.mkDerivation (androidEnvironment // {
# Provide libraries that aren’t linked against but somehow required
LD_LIBRARY_PATH = lib.makeLibraryPath [
# Fixes missing library errors
zlib xorg.libXcursor xorg.libXrandr xorg.libXi libxkbcommon
xorg.libXcursor xorg.libXrandr xorg.libXi libxkbcommon

# [WARN script::dom::gpu] Could not get GPUAdapter ("NotFound")
# TLA Err: Error: Couldn't request WebGPU adapter.
Expand Down
2 changes: 1 addition & 1 deletion python/servo/command_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ def to_ndk_bin(prog):
env['TARGET_STRIP'] = to_ndk_bin("llvm-strip")
env['RUST_FONTCONFIG_DLOPEN'] = "on"

env["LIBCLANG_PATH"] = path.join(llvm_toolchain, "lib64")
env["LIBCLANG_PATH"] = path.join(llvm_toolchain, "lib")
env["CLANG_PATH"] = to_ndk_bin("clang")

# A cheat-sheet for some of the build errors caused by getting the search path wrong...
Expand Down
2 changes: 1 addition & 1 deletion support/android/apk/jni/Application.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
NDK_TOOLCHAIN_VERSION := clang
APP_MODULES := c++_shared servojni
APP_MODULES := servojni
APP_PLATFORM := android-30
APP_STL := c++_shared
APP_ABI := armeabi-v7a x86 x86_64
Expand Down

0 comments on commit d4727c1

Please sign in to comment.