From cb550bbda5add411c072802b48c731c6cb20458a Mon Sep 17 00:00:00 2001 From: Lukas Kurz Date: Sat, 4 Oct 2025 15:45:59 +0200 Subject: [PATCH 1/5] Use CMake v3.10 --- CMakeLists.txt | 2 +- lib/wabt/CMakeLists.txt | 2 +- lib/wabt/README.md | 2 +- pal/CMakeLists.txt | 2 +- pal/src/CMakeLists.txt | 2 +- tools/RecyclerChecker/CMakeLists.txt | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cd077075d4a..962074240cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.2) +cmake_minimum_required(VERSION 3.10) project (CHAKRACORE) set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g") diff --git a/lib/wabt/CMakeLists.txt b/lib/wabt/CMakeLists.txt index 994533f300e..1ea2dbf812e 100644 --- a/lib/wabt/CMakeLists.txt +++ b/lib/wabt/CMakeLists.txt @@ -14,7 +14,7 @@ # limitations under the License. # -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 3.10) project(WABT) set(COMPILER_IS_CLANG 1) diff --git a/lib/wabt/README.md b/lib/wabt/README.md index 80aca09e83e..f5516885c16 100644 --- a/lib/wabt/README.md +++ b/lib/wabt/README.md @@ -44,7 +44,7 @@ This will fetch the testsuite and gtest repos, which are needed for some tests. You'll need [CMake](https://cmake.org). If you just run `make`, it will run CMake for you, and put the result in `out/clang/Debug/` by default: -> Note: If you are on macOS, you will need to use CMake version 3.2 or higher +> Note: If you are on macOS, you will need to use CMake version 3.10 or higher ```console $ make diff --git a/pal/CMakeLists.txt b/pal/CMakeLists.txt index 8e2d32f84b1..97508a45e97 100644 --- a/pal/CMakeLists.txt +++ b/pal/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.2) +cmake_minimum_required(VERSION 3.10) project(COREPAL) diff --git a/pal/src/CMakeLists.txt b/pal/src/CMakeLists.txt index ca062add292..50bf556541f 100644 --- a/pal/src/CMakeLists.txt +++ b/pal/src/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.2) +cmake_minimum_required(VERSION 3.10) project(chakrapal) diff --git a/tools/RecyclerChecker/CMakeLists.txt b/tools/RecyclerChecker/CMakeLists.txt index 3c7904f2b9c..c3365a893a6 100644 --- a/tools/RecyclerChecker/CMakeLists.txt +++ b/tools/RecyclerChecker/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8) +cmake_minimum_required(VERSION 3.10) set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules) # set(CMAKE_VERBOSE_MAKEFILE on) From b5a7b0a6a10be73582b5fc3a6e688c5133b974be Mon Sep 17 00:00:00 2001 From: Lukas Kurz Date: Sat, 4 Oct 2025 21:04:30 +0200 Subject: [PATCH 2/5] Enable `CMAKE_ENABLE_EXPORTS` --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 962074240cd..775ca85f5e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -379,6 +379,9 @@ if(CLR_CMAKE_PLATFORM_XPLAT) # prevent the required interface is being exported # clang by default sets fvisibility=default + # Allow ch to export `OnChakraCoreLoadedEntry` + set(CMAKE_ENABLE_EXPORTS ON) + # CXX WARNING FLAGS set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \ -Wno-ignored-attributes\ From 93171d397f10004d0298844caf19b4e9eace00ff Mon Sep 17 00:00:00 2001 From: Lukas Kurz Date: Sun, 5 Oct 2025 14:52:21 +0200 Subject: [PATCH 3/5] Pin libicu version for now Set `EMBED_ICU` flag --- .cirrus.yml | 6 +++--- azure-pipelines.yml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 7000bf6816b..68223d7d5c4 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -8,7 +8,7 @@ task: macos_instance: image: ghcr.io/cirruslabs/macos-ventura-xcode Dependencies_script: brew install ninja icu4c && mkdir -p build - CMake_script: cd build && cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DSTATIC_LIBRARY=ON -DICU_INCLUDE_PATH=/opt/homebrew/opt/icu4c/include -DDISABLE_JIT=ON -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang .. + CMake_script: cd build && cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DSTATIC_LIBRARY=ON -DEMBED_ICU=ON -DDISABLE_JIT=ON -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang .. Build_script: cd build && ninja Test_script: cd build && ninja check @@ -17,7 +17,7 @@ task: macos_instance: image: ghcr.io/cirruslabs/macos-ventura-xcode Dependencies_script: brew install ninja icu4c && mkdir -p build - CMake_script: cd build && cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DICU_INCLUDE_PATH=/opt/homebrew/opt/icu4c/include -DDISABLE_JIT=ON -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang .. + CMake_script: cd build && cmake -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DEMBED_ICU=ON -DDISABLE_JIT=ON -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang .. Build_script: cd build && ninja Test_script: cd build && ninja check @@ -26,6 +26,6 @@ task: macos_instance: image: ghcr.io/cirruslabs/macos-ventura-xcode Dependencies_script: brew install ninja icu4c && mkdir -p build - CMake_script: cd build && cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DSTATIC_LIBRARY=ON -DICU_INCLUDE_PATH=/opt/homebrew/opt/icu4c/include -DDISABLE_JIT=ON -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang .. + CMake_script: cd build && cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DSTATIC_LIBRARY=ON -DEMBED_ICU=ON -DDISABLE_JIT=ON -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang .. Build_script: cd build && ninja Test_script: cd build && ninja check diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0d21565fd58..6d9228e9d34 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -71,12 +71,12 @@ jobs: image_name: 'macOS-latest' deps: 'brew install ninja icu4c' build_type: 'RelWithDebInfo' - libtype_flag: '-DICU_INCLUDE_PATH=/usr/local/opt/icu4c/include' + libtype_flag: '-DEMBED_ICU=ON' OSX.Release: image_name: 'macOS-latest' deps: 'brew install ninja icu4c' build_type: 'Release' - libtype_flag: '-DICU_INCLUDE_PATH=/usr/local/opt/icu4c/include' + libtype_flag: '-DEMBED_ICU=ON' pool: vmImage: $(image_name) From 433821a564888e28eb44414a3b78bc688edf926e Mon Sep 17 00:00:00 2001 From: Lukas Kurz Date: Sun, 5 Oct 2025 21:06:22 +0200 Subject: [PATCH 4/5] Convert jmp labels to private ones https://gitlab.winehq.org/wine/wine/-/merge_requests/4547 --- lib/Runtime/Language/amd64/amd64_Thunks.S | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Runtime/Language/amd64/amd64_Thunks.S b/lib/Runtime/Language/amd64/amd64_Thunks.S index 7fdadaf1aaf..8e7349e4346 100644 --- a/lib/Runtime/Language/amd64/amd64_Thunks.S +++ b/lib/Runtime/Language/amd64/amd64_Thunks.S @@ -64,10 +64,10 @@ NESTED_ENTRY _ZN2Js21InterpreterStackFrame33AsmJsDelayDynamicInterpreterThunkEPN call C_FUNC(_ZN2Js11WasmLibrary20EnsureWasmEntrypointEPNS_14ScriptFunctionE) test rax, rax - jne skipThunk + jne LOCAL_LABEL(skipThunk) mov rdi, [rbp-0x8] call C_FUNC(_ZN2Js21InterpreterStackFrame29EnsureDynamicInterpreterThunkEPNS_14ScriptFunctionE) -skipThunk: +LOCAL_LABEL(skipThunk): pop r9 pop r8 @@ -267,7 +267,7 @@ NESTED_ENTRY _ZN2Js23AsmJsExternalEntryPointEPNS_16RecyclableObjectENS_8CallInfo call C_FUNC(_ZN2Js19BoxAsmJsReturnValueEPNS_14ScriptFunctionEldfDv4_f) mov rsp, r13 // restore stack pointer - Epilogue: +LOCAL_LABEL(Epilogue): mov r12, [rsp + 0x28] .cfi_restore r12 mov r13, [rsp + 0x30] From 1f90c3c3f1549c6acf1d65a7e213b0d6cbdac0d5 Mon Sep 17 00:00:00 2001 From: Lukas Kurz Date: Sun, 5 Oct 2025 21:28:31 +0200 Subject: [PATCH 5/5] Add CC copyright --- lib/Runtime/Language/amd64/amd64_Thunks.S | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Runtime/Language/amd64/amd64_Thunks.S b/lib/Runtime/Language/amd64/amd64_Thunks.S index 8e7349e4346..a20adf78f9e 100644 --- a/lib/Runtime/Language/amd64/amd64_Thunks.S +++ b/lib/Runtime/Language/amd64/amd64_Thunks.S @@ -1,5 +1,6 @@ //------------------------------------------------------------------------------------------------------- // Copyright (C) Microsoft. All rights reserved. +// Copyright (c) ChakraCore Project Contributors. All rights reserved. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information. //------------------------------------------------------------------------------------------------------- .intel_syntax noprefix