Skip to content

Conversation

@DanShaders
Copy link
Collaborator

GitHub-provided CI runners are heterogeneous, so artifacts compiled with -march=native on a newer runner may fail to run on an older runner if ccache reuses same object files. To combat this, we introduce (and use in CI) TON_USE_CI_BASELINE_CPU CMake flag that overrides -march=native with some (relatively old) baseline CPU arch.

GitHub-provided CI runners are heterogeneous, so artifacts compiled
with -march=native on a newer runner may fail to run on an older runner
if ccache reuses same object files. To combat this, we introduce (and
use in CI) TON_USE_CI_BASELINE_CPU CMake flag that overrides
-march=native with some (relatively old) baseline CPU arch.
@github-actions
Copy link

github-actions bot commented Dec 4, 2025

Findings

  • CMakeLists.txt:83-93TON_USE_CI_BASELINE_CPU now unconditionally adds -mcpu=apple-m1 on macOS/arm64. Apple Clang <13 rejects that flag (previous code gated the M1 flag on clang≥13), so enabling the new option on older toolchains will break the build. Consider keeping the version guard or falling back to a more widely supported arch for older compilers.
  • CMakeLists.txt:95TON_ARCH is injected via add_compile_options(-march=${TON_ARCH}) without the prior CHECK_CXX_COMPILER_FLAG guard. A mistyped/unsupported arch (or an empty value) now fails during compilation with a less clear error instead of a configure-time check. Suggest restoring validation to give immediate, actionable feedback.

Notes

  • x86_64 baseline uses -march=x86-64-v3; if anyone enables the flag with a compiler too old to support that level, it will fail at compile time.

@DanShaders DanShaders marked this pull request as draft December 4, 2025 20:11
@DanShaders
Copy link
Collaborator Author

This requires passing -march=${TON_ARCH} carefully to all dependencies as well, which is extraordinarily annoying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant