Skip to content

Commit

Permalink
Update macOS build including both x64 and arm64
Browse files Browse the repository at this point in the history
Signed-off-by: HyukWoo Park <hyukwoo.park@samsung.com>
  • Loading branch information
clover2123 authored and ksh8281 committed Oct 23, 2024
1 parent 2f3ba80 commit 98a7eaf
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 6 deletions.
32 changes: 31 additions & 1 deletion .github/workflows/es-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,36 @@ jobs:
env:
BUILD_OPTIONS: -DESCARGOT_WASM=ON -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja
run: |
# check cpu
sysctl -a | grep machdep.cpu
# add icu path to pkg_config_path
export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig:$PKG_CONFIG_PATH"
cmake -H. -Bout/debug/ -DESCARGOT_MODE=debug $BUILD_OPTIONS
ninja -Cout/debug/
$RUNNER --engine="./out/debug/escargot" new-es
cmake -H. -Bout/release/ -DESCARGOT_MODE=release $BUILD_OPTIONS
ninja -Cout/release/
cp test/octane/*.js .
./out/release/escargot run.js
build-on-macos-arm64:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Packages
run: |
brew update
brew install cmake ninja pkg-config icu4c
- name: Build arm64
env:
BUILD_OPTIONS: -DESCARGOT_WASM=ON -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja
run: |
# check cpu
sysctl -a | grep machdep.cpu
# add icu path to pkg_config_path
export PKG_CONFIG_PATH="/opt/homebrew/opt/icu4c/lib/pkgconfig:$PKG_CONFIG_PATH"
cmake -H. -Bout/debug/ -DESCARGOT_MODE=debug $BUILD_OPTIONS
ninja -Cout/debug/
$RUNNER --engine="./out/debug/escargot" new-es
Expand Down Expand Up @@ -365,7 +395,7 @@ jobs:
submodules: true
- name: Build
env:
BUILD_OPTIONS: -DESCARGOT_HOST=linux -DESCARGOT_THREADING=ON -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja
BUILD_OPTIONS: -DESCARGOT_THREADING=ON -DESCARGOT_TEMPORAL=ON -DESCARGOT_TCO=ON -DESCARGOT_TEST=ON -DESCARGOT_OUTPUT=shell -GNinja
run: |
LDFLAGS=" -L/usr/icu32/lib/ -Wl,-rpath=/usr/icu32/lib/" PKG_CONFIG_PATH="/usr/icu32/lib/pkgconfig/" cmake -H./ -Bbuild/out_linux -DESCARGOT_ARCH=x86 -DESCARGOT_MODE=debug -DESCARGOT_TCO_DEBUG=ON $BUILD_OPTIONS
LDFLAGS=" -L/usr/icu32/lib/ -Wl,-rpath=/usr/icu32/lib/" PKG_CONFIG_PATH="/usr/icu32/lib/pkgconfig/" cmake -H./ -Bbuild/out_linux_release -DESCARGOT_ARCH=x86 $BUILD_OPTIONS
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Escargot is an open-source project that allows developers to contribute to its d
| **OS** | **Architecture** |
|-|-|
| **Linux(Ubuntu)** | x86/x64/arm/aarch64 |
| macOS | x64 |
| macOS | x64/aarch64 |
| Windows | x86 |
| Android | x86/x64/arm/aarch64 |

Expand Down Expand Up @@ -82,6 +82,11 @@ ninja
General build prerequisites:
```sh
brew install autoconf automake cmake icu4c libtool ninja pkg-config

# add icu path to pkg_config_path (x64)
export PKG_CONFIG_PATH="/usr/local/opt/icu4c/lib/pkgconfig:$PKG_CONFIG_PATH"
# add icu path to pkg_config_path (arm64)
export PKG_CONFIG_PATH="/opt/homebrew/opt/icu4c/lib/pkgconfig:$PKG_CONFIG_PATH"
```

Build Escargot:
Expand Down
7 changes: 4 additions & 3 deletions build/target.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,11 @@ ELSEIF (${ESCARGOT_HOST} STREQUAL "android")
# bdwgc android amd64 cannot support keeping back ptrs
SET (ESCARGOT_THIRDPARTY_CFLAGS ${ESCARGOT_THIRDPARTY_CFLAGS} -UKEEP_BACK_PTRS -USAVE_CALL_COUNT -UDBG_HDRS_ALL)
ENDIF()
ELSEIF (${ESCARGOT_HOST} STREQUAL "darwin" AND ${ESCARGOT_ARCH} STREQUAL "x64")
ELSEIF (${ESCARGOT_HOST} STREQUAL "darwin")
FIND_PACKAGE (PkgConfig REQUIRED)
IF ((NOT ${ESCARGOT_ARCH} STREQUAL "x64") AND (NOT ${ESCARGOT_ARCH} STREQUAL "aarch64"))
MESSAGE (FATAL_ERROR ${ESCARGOT_ARCH} " is unsupported")
ENDIF()
SET (ESCARGOT_LDFLAGS -lpthread -Wl,-dead_strip)
SET (ESCARGOT_BUILD_64BIT_LARGE ON)
# bdwgc mac cannot support pthread_getattr_np
Expand All @@ -162,8 +165,6 @@ ELSEIF (${ESCARGOT_HOST} STREQUAL "darwin" AND ${ESCARGOT_ARCH} STREQUAL "x64")
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)
IF ((${ESCARGOT_ARCH} STREQUAL "x64") OR (${ESCARGOT_ARCH} STREQUAL "x86_64"))
Expand Down
2 changes: 1 addition & 1 deletion third_party/walrus
Submodule walrus updated 47 files
+48 −44 .github/workflows/actions.yml
+0 −4 build/config.cmake
+4 −1 build/target.cmake
+281 −230 src/interpreter/ByteCode.h
+78 −14 src/interpreter/Interpreter.cpp
+56 −32 src/jit/Backend.cpp
+312 −140 src/jit/ByteCodeParser.cpp
+1 −1 src/jit/CallInl.h
+43 −0 src/jit/Compiler.h
+7 −5 src/jit/FloatConvInl.h
+1 −1 src/jit/FloatMathInl.h
+13 −15 src/jit/IntMath32Inl.h
+4 −5 src/jit/IntMath64Inl.h
+695 −81 src/jit/MemoryInl.h
+29 −18 src/jit/MemoryUtilInl.h
+15 −11 src/jit/SimdArm32Inl.h
+1 −1 src/jit/SimdArm64Inl.h
+2 −4 src/jit/SimdInl.h
+210 −24 src/jit/SimdX86Inl.h
+42 −39 src/jit/TableInl.h
+2 −2 src/jit/TryCatchInl.h
+16 −39 src/parser/WASMParser.cpp
+15 −2 src/runtime/Instance.cpp
+6 −1 src/runtime/Instance.h
+3 −11 src/runtime/JITExec.cpp
+2 −18 src/runtime/JITExec.h
+36 −4 src/runtime/Memory.cpp
+37 −25 src/runtime/Memory.h
+12 −1 src/runtime/Module.cpp
+0 −2 src/runtime/Store.cpp
+0 −8 src/runtime/Store.h
+44 −17 src/shell/Shell.cpp
+14 −2 src/util/MathOperation.h
+28 −0 test/extended/relaxed-simd/i16x8_relaxed_q15mulr_s.wast
+124 −0 test/extended/relaxed-simd/i32x4_relaxed_trunc.wast
+45 −0 test/extended/relaxed-simd/i8x16_relaxed_swizzle.wast
+107 −0 test/extended/relaxed-simd/relaxed_dot_product.wast
+103 −0 test/extended/relaxed-simd/relaxed_laneselect.wast
+224 −0 test/extended/relaxed-simd/relaxed_madd_nmadd.wast
+184 −0 test/extended/relaxed-simd/relaxed_min_max.wast
+24 −0 test/extended/threads/atomic_wait_notify_with_offsets.wast
+130 −0 test/extended/threads/atomic_with_offsets.wast
+39 −0 test/jit/trycatch-mem.wast
+1 −1 third_party/sljit
+2 −0 third_party/wabt/src/walrus/binary-reader-walrus.cc
+7 −0 tools/jit_exclude_list.txt
+1 −1 tools/run-tests.py

0 comments on commit 98a7eaf

Please sign in to comment.