crt: Fix compile of __stack_chk_guard when compiling with Link Time Optimization At some point gcc started enforcing that __stack_chk_guard must have certain properties, but unfortunately a side effect seems to be that the compiler now hits an assert in its Link Time Optimizer, specifically the serializer when __stack_chk_guard is declared in the code without being explicitly initialized. We can just initialize it to 0 to make the assert go away. mingw-w64-crt/ssp/ChangeLog: * stack_chk_guard.c (__stack_chk_guard): Initialize to 0. Signed-off-by: TheShermanTanker <tanksherman27@gmail.com> Reference: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126773 Signed-off-by: LIU Hao <lh_mouse@126.com>
diff --git a/mingw-w64-crt/ssp/stack_chk_guard.c b/mingw-w64-crt/ssp/stack_chk_guard.c index 9d961e3..499f003 100644 --- a/mingw-w64-crt/ssp/stack_chk_guard.c +++ b/mingw-w64-crt/ssp/stack_chk_guard.c
@@ -8,7 +8,7 @@ #include <stdlib.h> #include <stdint.h> -uintptr_t __stack_chk_guard; +uintptr_t __stack_chk_guard = 0; #if defined __SSP__ || defined __SSP_STRONG__ || defined __SSP_ALL__ // This function requires `no_stack_protector` because it changes the