From 585cdebde3fe6a95bce7c7bc6a42b838850e7bdb Mon Sep 17 00:00:00 2001 From: Seonghyun Kim Date: Thu, 14 Sep 2023 17:11:07 +0900 Subject: [PATCH] Update mac android build files * Fix TypedArrayObject.prototye.indexOf bug Signed-off-by: Seonghyun Kim --- .github/workflows/es-actions.yml | 14 ++++++++------ build/android/app/build.gradle | 4 ++-- build/android/escargot/build.gradle | 4 ++-- build/target.cmake | 8 +++++++- src/builtins/BuiltinTypedArray.cpp | 2 ++ third_party/GCutil | 2 +- 6 files changed, 22 insertions(+), 12 deletions(-) diff --git a/.github/workflows/es-actions.yml b/.github/workflows/es-actions.yml index 94ed683e2..46e7df563 100644 --- a/.github/workflows/es-actions.yml +++ b/.github/workflows/es-actions.yml @@ -36,12 +36,14 @@ jobs: brew install cmake ninja pkg-config icu4c - name: Build x64 env: - BUILD_OPTIONS: -DESCARGOT_MODE=debug -DESCARGOT_LIBICU_SUPPORT_WITH_DLOPEN=OFF -DESCARGOT_WASM=ON -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja - run: | - export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig" - cmake -H. -Bout/mac/x64 $BUILD_OPTIONS - ninja -Cout/mac/x64 - ./tools/run-tests.py --engine="./out/mac/x64/escargot" new-es + BUILD_OPTIONS: -DESCARGOT_WASM=ON -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja + run: | + cmake -H. -Bout/debug/ -DESCARGOT_MODE=debug $BUILD_OPTIONS + ninja -Cout/debug/ + ./tools/run-tests.py --engine="./out/debug/escargot" new-es + cmake -H. -Bout/release/ -DESCARGOT_MODE=release $BUILD_OPTIONS + ninja -Cout/release/ + ./tools/run-tests.py --engine="./out/release/escargot" octane build-test-on-android: runs-on: macos-12 diff --git a/build/android/app/build.gradle b/build/android/app/build.gradle index 5c7552ca7..b3281928f 100644 --- a/build/android/app/build.gradle +++ b/build/android/app/build.gradle @@ -4,12 +4,12 @@ plugins { android { namespace 'com.samsung.lwe.escargot.shell' - compileSdk 33 + compileSdk 34 defaultConfig { applicationId "com.samsung.lwe.escargot.shell" minSdk 28 - targetSdk 33 + targetSdk 34 versionCode 1 versionName "1.0" diff --git a/build/android/escargot/build.gradle b/build/android/escargot/build.gradle index 31434fea8..bfc1ce24c 100644 --- a/build/android/escargot/build.gradle +++ b/build/android/escargot/build.gradle @@ -9,11 +9,11 @@ ext { android { namespace 'com.samsung.lwe.escargot' - compileSdk 33 + compileSdk 34 defaultConfig { minSdk 28 - targetSdk 33 + targetSdk 34 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles "consumer-rules.pro" diff --git a/build/target.cmake b/build/target.cmake index ffbe1b045..2f2975dcf 100644 --- a/build/target.cmake +++ b/build/target.cmake @@ -14,7 +14,7 @@ SET (ESCARGOT_BUILD_64BIT_LARGE OFF) SET (COMPILER_CLANG_CL OFF) IF (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") IF (DEFINED CMAKE_CXX_COMPILER_FRONTEND_VARIANT) - IF (${CMAKE_CXX_COMPILER_FRONTEND_VARIANT} STREQUAL "MSVC") + IF (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC") SET (COMPILER_CLANG_CL ON) ENDIF() ENDIF() @@ -154,6 +154,12 @@ ELSEIF (${ESCARGOT_HOST} STREQUAL "darwin" AND ${ESCARGOT_ARCH} STREQUAL "x64") SET (ESCARGOT_BUILD_64BIT_LARGE ON) # bdwgc mac cannot support pthread_getattr_np SET (ESCARGOT_THIRDPARTY_CFLAGS ${ESCARGOT_THIRDPARTY_CFLAGS} -UHAVE_PTHREAD_GETATTR_NP) + # dlopen version not working correctly on mac + IF (NOT DEFINED ESCARGOT_LIBICU_SUPPORT_WITH_DLOPEN) + SET (ESCARGOT_LIBICU_SUPPORT_WITH_DLOPEN OFF) + ENDIF() + # add pkg_config_path icu install path of brew + SET (ENV{PKG_CONFIG_PATH} "/usr/local/opt/icu4c/lib/pkgconfig:$ENV{PKG_CONFIG_PATH}") ELSEIF (${ESCARGOT_HOST} STREQUAL "windows") SET (ESCARGOT_LDFLAGS ${ESCARGOT_LDFLAGS} icu.lib) SET (ESCARGOT_CXXFLAGS ${ESCARGOT_CXXFLAGS} -DSTACK_LIMIT_FROM_BASE=1048576) # in windows, default stack limit is 1MB diff --git a/src/builtins/BuiltinTypedArray.cpp b/src/builtins/BuiltinTypedArray.cpp index a5024ea09..3549374f4 100644 --- a/src/builtins/BuiltinTypedArray.cpp +++ b/src/builtins/BuiltinTypedArray.cpp @@ -495,6 +495,8 @@ static Value fastTypedArrayIndexSearch(TypedArrayObject* arr, size_t k, size_t l } } else if (UNLIKELY(!value.isNumber())) { return Value(-1); + } else if (UNLIKELY(arr->rawBuffer() == nullptr)) { + return Value(-1); } uint8_t* buffer = arr->rawBuffer(); diff --git a/third_party/GCutil b/third_party/GCutil index da71abca1..117a694c0 160000 --- a/third_party/GCutil +++ b/third_party/GCutil @@ -1 +1 @@ -Subproject commit da71abca1dfbea15029a4e39b317f9a41454e60e +Subproject commit 117a694c026c109f2efc93e46b59db8b6906a772