Skip to content

Commit

Permalink
PATCH: Use ndk r23c to build v8 for android.
Browse files Browse the repository at this point in the history
  • Loading branch information
dumganhar committed Oct 9, 2023
1 parent 7836c82 commit ec866b5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -280,19 +280,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Install NDK r21e
- name: Install NDK r23c
uses: nttld/setup-ndk@v1
id: setup-ndk-r21e
id: setup-ndk
with:
ndk-version: r21e
add-to-path: false
local-cache: true

- name: Install NDK r26
uses: nttld/setup-ndk@v1
id: setup-ndk-r26
with:
ndk-version: r26
ndk-version: r23c
add-to-path: false
local-cache: true

Expand Down Expand Up @@ -339,6 +331,15 @@ jobs:
python3 build/linux/sysroot_scripts/install-sysroot.py --arch=${INSTALL_SYSROOT_ARCH}
- name: Patch
run: |
sed -i "s@\"-gsimple-template-names\"@@g" build/config/compiler/BUILD.gn
sed -i "s@\"-ffile-compilation-dir=.\"@@g" build/config/compiler/BUILD.gn
rm $NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/12.0.9/lib/linux/x86_64/libatomic.a
env:
NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }}

- name: Build ${{ matrix.arch }}
run: |
export PATH=${{ env.DEPOT_TOOLS_PATH }}:$PATH
Expand All @@ -347,8 +348,7 @@ jobs:
./build-android.sh ${{ matrix.arch }}
env:
NDK_ROOT_R21: ${{ steps.setup-ndk-r21e.outputs.ndk-path }}
NDK_ROOT_R26: ${{ steps.setup-ndk-r26.outputs.ndk-path }}
NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }}

- name: Copy to dist folder
run: |
Expand Down
9 changes: 4 additions & 5 deletions build-android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ fi
# If there is 1 argument and its value is "arm64" or "x64", continue with the rest of the script
echo "Valid architecture: ${ARCH}"

echo "NDK_ROOT_R21=${NDK_ROOT_R21}"
echo "NDK_ROOT_R26=${NDK_ROOT_R26}"
echo "NDK_ROOT=${NDK_ROOT}"

ARGS="target_os=\"android\"
target_cpu=\"${ARCH}\"
Expand All @@ -42,9 +41,9 @@ symbol_level=0
v8_enable_webassembly=true
use_cxx17=true
v8_enable_sandbox=false
android_ndk_root=\"${NDK_ROOT_R21}\"
clang_base_path=\"${NDK_ROOT_R26}/toolchains/llvm/prebuilt/linux-x86_64\"
android_ndk_version=\"r21e\"
android_ndk_root=\"${NDK_ROOT}\"
clang_base_path=\"${NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64\"
android_ndk_version=\"r23c\"
android_ndk_major_version=21
android32_ndk_api_level=19
android64_ndk_api_level=21
Expand Down

0 comments on commit ec866b5

Please sign in to comment.