[stack-canaries] fixed stack canaries on arm linux

This commit is contained in:
A1029384756
2026-06-13 01:52:19 -04:00
parent 3598e351a4
commit 8bd95d4082
3 changed files with 32 additions and 32 deletions

View File

@@ -1952,18 +1952,9 @@ gb_internal void init_build_context(TargetMetrics *cross_target, Subtarget subta
}
}
// note: there are some stack protection toolchain issues on arm
// platforms that will clash with PIC/PIE:
// `unresolvable R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol`
if (metrics->os == TargetOs_linux &&
metrics->arch != TargetArch_arm32 &&
metrics->arch != TargetArch_arm64
) {
if (bc->stack_protector == StackProtector_Default) {
bc->stack_protector = StackProtector_Ssp;
}
} else if (metrics->os == TargetOs_windows ||
if (metrics->os == TargetOs_windows ||
metrics->os == TargetOs_darwin ||
metrics->os == TargetOs_linux ||
metrics->os == TargetOs_freebsd ||
metrics->os == TargetOs_openbsd ||
metrics->os == TargetOs_netbsd) {