在 2025-7-13 21:25, Pali Rohár 写道:
And throws warning: ‘no_stack_protector’ attribute directive ignored 
[-Wattributes]


If I understand correctly the code at 3d-4c is the stack protection
check, which should have been disabled for that function. But because
the ___stack_chk_guard is being changed in the function, it cause
calling the ___stack_chk_fail.

So the warning is NOT harmless and cannot be ignored. It is a real issue.

The CRT should not be built with stack protector.

Otherwise, even if we don't use the attribute there and don't see a warning, compiling the CRT with GCC 8 and with `-fstack-protector` will still cause crashes.

One possible workaround is to introduce a specific Makefile recipe for 'stack_chk_guard.c' which doesn't use `CFLAGS`. However as said above, just don't build the CRT with stack protector.


--
Best regards,
LIU Hao

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to