Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add arm64 build #94

Merged
merged 35 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
5a6db3b
ci: add arm64 build
supervacuus Nov 29, 2023
aa7e1b4
unique build-dir
supervacuus Nov 29, 2023
1aaf2ba
check cmake version
supervacuus Nov 29, 2023
8060c5e
check armasm64
supervacuus Nov 29, 2023
b0a560f
Log whether ARM64 target detected
supervacuus Nov 29, 2023
6e40a1d
add check log to util build script
supervacuus Nov 29, 2023
e37fa5d
establish arm64 toolset in ps
supervacuus Nov 29, 2023
0d05612
remove armasm64 invocation check
supervacuus Nov 29, 2023
d610372
check on generator platform for asm language
supervacuus Nov 29, 2023
d54d15e
switch utils asm sources to cond on CMAKE_GENERATOR_PLATFORM
supervacuus Nov 29, 2023
c2778c8
Remove cmake version and env setup
supervacuus Dec 5, 2023
8f9c6fb
Revert to use CMAKE_SYSTEM_PROCESSOR
supervacuus Dec 5, 2023
7f5b9ce
add toolchain file
supervacuus Dec 5, 2023
7ec1351
revert checks
supervacuus Dec 5, 2023
4507c4e
since we string match use consistent safety for undefined
supervacuus Dec 5, 2023
8d89398
clean toolchain path
supervacuus Dec 5, 2023
a022c23
explicit arch generator
supervacuus Dec 5, 2023
cb387a8
try running devenv as windows conditional steps
supervacuus Dec 5, 2023
5cce3dc
only setup env for the last build step
supervacuus Dec 5, 2023
36226f7
revert to direct vcvars invocation
supervacuus Dec 5, 2023
ce00f33
add logs
supervacuus Dec 5, 2023
a5fff4b
get rid of any cli parameter
supervacuus Dec 5, 2023
2d8d674
dquotes
supervacuus Dec 5, 2023
d8483d0
remove vcvars
supervacuus Dec 5, 2023
16206dd
prevent overwrite without system-name
supervacuus Dec 5, 2023
716cb4c
remove vcvars
supervacuus Dec 5, 2023
00ee826
with vcvars
supervacuus Dec 5, 2023
bdb9f4d
explicit platform at cli
supervacuus Dec 5, 2023
c37638e
add config + platform to build invocation
supervacuus Dec 5, 2023
d94aefa
remove logs + remove vsvars
supervacuus Dec 5, 2023
06676ae
reenable other build steps
supervacuus Dec 5, 2023
0632599
try tools + client stack traces
supervacuus Dec 5, 2023
2d4207e
add arm64 stack-walk support
supervacuus Dec 5, 2023
255c66f
fix struct access
supervacuus Dec 5, 2023
8f0374c
distinct stacks arm64 build folder
supervacuus Dec 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ jobs:
cmake -B cmake-build-stacks -D CRASHPAD_ENABLE_STACKTRACE=ON
cmake --build cmake-build-stacks --parallel

- name: Build crashpad Windows ARM64
if: ${{ runner.os == 'Windows' }}
run: |
cmake -B cmake-build-arm64 -DCMAKE_TOOLCHAIN_FILE="cmake/toolchains/win_arm64.cmake" -DCRASHPAD_BUILD_TOOLS=On
cmake --build cmake-build-arm64 --config RelWithDebInfo -- /p:Platform=ARM64

- name: Build crashpad with client-side stack traces Windows ARM64
if: ${{ runner.os == 'Windows' }}
run: |
cmake -B cmake-build-stacks-arm64 -DCMAKE_TOOLCHAIN_FILE="cmake/toolchains/win_arm64.cmake" -DCRASHPAD_ENABLE_STACKTRACE=ON
cmake --build cmake-build-stacks-arm64 --config RelWithDebInfo -- /p:Platform=ARM64

build-ios:
runs-on: macos-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function(crashpad_install_dev)
endfunction()

if(WIN32)
if(CMAKE_SYSTEM_PROCESSOR MATCHES ARM64)
if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES ARM64)
enable_language(ASM_MARMASM)
else()
enable_language(ASM_MASM)
Expand Down
6 changes: 6 additions & 0 deletions cmake/toolchains/win_arm64.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Toolchain file that should provide required and non-conflicting build-
# parameters to allow normal and cross-compilation to ARM64 targets on
# Windows using any generator.
SET(CMAKE_GENERATOR_PLATFORM "ARM64")
SET(CMAKE_SYSTEM_PROCESSOR "ARM64")
SET(CMAKE_SYSTEM_NAME "Windows")
9 changes: 6 additions & 3 deletions snapshot/win/process_reader_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,12 @@ void DoStackWalk(ProcessReaderWin::Thread* thread,
// ctx = (LPVOID)ctx_;
// }

// TODO: we dont support this right away, maybe in the future
// #elif defined(ARCH_CPU_ARM64)
// machine_type = IMAGE_FILE_MACHINE_ARM64;
#elif defined(ARCH_CPU_ARM64)
machine_type = IMAGE_FILE_MACHINE_ARM64;
ctx = *thread->context.context<CONTEXT>();
stack_frame.AddrPC.Offset = ctx.Pc;
stack_frame.AddrFrame.Offset = ctx.Fp;
stack_frame.AddrStack.Offset = ctx.Sp;
#else
#error Unsupported Windows Arch
#endif // ARCH_CPU_X86
Expand Down
2 changes: 1 addition & 1 deletion util/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ if(WIN32)
win/traits.h
win/xp_compat.h
)
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm|ARM64")
if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm|ARM64")
target_sources(crashpad_util PRIVATE
misc/capture_context_win_arm64.asm
)
Expand Down