Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 6 additions & 1 deletion barretenberg/cpp/CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@
},
"cacheVariables": {
"CMAKE_SYSTEM_NAME": "Generic",
"CMAKE_SYSTEM_PROCESSOR": "aarch64",
"CMAKE_TRY_COMPILE_TARGET_TYPE": "STATIC_LIBRARY",
"HAVE_STD_REGEX": "ON",
"BB_LITE": "ON"
Expand All @@ -583,6 +584,7 @@
},
"cacheVariables": {
"CMAKE_SYSTEM_NAME": "Generic",
"CMAKE_SYSTEM_PROCESSOR": "aarch64",
"CMAKE_TRY_COMPILE_TARGET_TYPE": "STATIC_LIBRARY",
"HAVE_STD_REGEX": "ON",
"BB_LITE": "ON"
Expand All @@ -599,6 +601,7 @@
},
"cacheVariables": {
"CMAKE_SYSTEM_NAME": "Generic",
"CMAKE_SYSTEM_PROCESSOR": "aarch64",
"CMAKE_TRY_COMPILE_TARGET_TYPE": "STATIC_LIBRARY",
"HAVE_STD_REGEX": "ON",
"BB_LITE": "ON"
Expand All @@ -615,9 +618,11 @@
},
"cacheVariables": {
"CMAKE_SYSTEM_NAME": "Generic",
"CMAKE_SYSTEM_PROCESSOR": "x86_64",
"CMAKE_TRY_COMPILE_TARGET_TYPE": "STATIC_LIBRARY",
"HAVE_STD_REGEX": "ON",
"BB_LITE": "ON"
"BB_LITE": "ON",
"TARGET_ARCH": "skylake"
}
}
],
Expand Down
9 changes: 8 additions & 1 deletion barretenberg/cpp/cmake/arch.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,16 @@ endif()
# Use 'skylake' on x86_64 (matches our cross-compile presets) and 'generic' on ARM
# to avoid emitting CPU-specific instructions (e.g. SVE on Graviton) that break on
# other ARM machines like Apple Silicon.
# For ARM cross-compilation, skip -march entirely — the Zig compiler wrapper already
# specifies the correct target/cpu via -target and -mcpu flags.
if(NOT WASM AND NOT TARGET_ARCH)
if(ARM)
set(TARGET_ARCH "generic")
if(CMAKE_CROSSCOMPILING)
# Cross-compiling for ARM: zig already has -target/-mcpu set.
# Adding -march=generic would conflict (e.g. strip AES/NEON features).
else()
set(TARGET_ARCH "generic")
endif()
else()
set(TARGET_ARCH "skylake")
endif()
Expand Down
Loading