Skip to content

Commit 89991e9

Browse files
authored
ci: add arm64 build (#94)
1 parent 40875ed commit 89991e9

File tree

5 files changed

+26
-5
lines changed

5 files changed

+26
-5
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,18 @@ jobs:
3434
cmake -B cmake-build-stacks -D CRASHPAD_ENABLE_STACKTRACE=ON
3535
cmake --build cmake-build-stacks --parallel
3636
37+
- name: Build crashpad Windows ARM64
38+
if: ${{ runner.os == 'Windows' }}
39+
run: |
40+
cmake -B cmake-build-arm64 -DCMAKE_TOOLCHAIN_FILE="cmake/toolchains/win_arm64.cmake" -DCRASHPAD_BUILD_TOOLS=On
41+
cmake --build cmake-build-arm64 --config RelWithDebInfo -- /p:Platform=ARM64
42+
43+
- name: Build crashpad with client-side stack traces Windows ARM64
44+
if: ${{ runner.os == 'Windows' }}
45+
run: |
46+
cmake -B cmake-build-stacks-arm64 -DCMAKE_TOOLCHAIN_FILE="cmake/toolchains/win_arm64.cmake" -DCRASHPAD_ENABLE_STACKTRACE=ON
47+
cmake --build cmake-build-stacks-arm64 --config RelWithDebInfo -- /p:Platform=ARM64
48+
3749
build-ios:
3850
runs-on: macos-latest
3951
steps:

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function(crashpad_install_dev)
5050
endfunction()
5151

5252
if(WIN32)
53-
if(CMAKE_SYSTEM_PROCESSOR MATCHES ARM64)
53+
if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES ARM64)
5454
enable_language(ASM_MARMASM)
5555
else()
5656
enable_language(ASM_MASM)

cmake/toolchains/win_arm64.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Toolchain file that should provide required and non-conflicting build-
2+
# parameters to allow normal and cross-compilation to ARM64 targets on
3+
# Windows using any generator.
4+
SET(CMAKE_GENERATOR_PLATFORM "ARM64")
5+
SET(CMAKE_SYSTEM_PROCESSOR "ARM64")
6+
SET(CMAKE_SYSTEM_NAME "Windows")

snapshot/win/process_reader_win.cc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,12 @@ void DoStackWalk(ProcessReaderWin::Thread* thread,
174174
// ctx = (LPVOID)ctx_;
175175
// }
176176

177-
// TODO: we dont support this right away, maybe in the future
178-
// #elif defined(ARCH_CPU_ARM64)
179-
// machine_type = IMAGE_FILE_MACHINE_ARM64;
177+
#elif defined(ARCH_CPU_ARM64)
178+
machine_type = IMAGE_FILE_MACHINE_ARM64;
179+
ctx = *thread->context.context<CONTEXT>();
180+
stack_frame.AddrPC.Offset = ctx.Pc;
181+
stack_frame.AddrFrame.Offset = ctx.Fp;
182+
stack_frame.AddrStack.Offset = ctx.Sp;
180183
#else
181184
#error Unsupported Windows Arch
182185
#endif // ARCH_CPU_X86

util/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ if(WIN32)
385385
win/traits.h
386386
win/xp_compat.h
387387
)
388-
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm|ARM64")
388+
if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm|ARM64")
389389
target_sources(crashpad_util PRIVATE
390390
misc/capture_context_win_arm64.asm
391391
)

0 commit comments

Comments
 (0)