mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-10-11 20:59:22 +08:00
Cygwin cannot properly support weak symbols. If a weak symbol is weakly referenced, the linker never patches up the call, leaving a garbage call instruction that jumps into unmapped memory and immediately segfaults. This apparently has never worked, as various weak symbols (including `panic` and `millis16`) had hacks added to address this over the years. The recent introduction of `mem_realloc` in PR #30572 completely broke ArduPilot SITL builds for cygwin as this function is called during arming through ExpandingString preparing information for logging. Therefore, arming always crashed. Fix this problem for good by never making a weak symbol on cygwin. Fortunately this is rare in ArduPilot so no symbol conflicts are caused.