https://bugs.winehq.org/show_bug.cgi?id=48161
--- Comment #11 from Paul Gofman gofmanp@gmail.com --- (In reply to Alexandre Julliard from comment #10)
Yes, CFLAGS take precedence. Don't add such flags in there.
I don't do that for my own builds, but the official builds do add this flag somewhere.
I'm not aware of any mingw version that enables cf-protection by default, is there such a thing?
gcc does not enable this flag by default either. If Wine is built with default configure options (no messing with flags at all), it was already ok. The flag is added explicitly in official builds.
E. g., https://dl.winehq.org/wine-builds/fedora/30/x86_64/wine-devel64-4.21-1.1.x86...:
rpm -q --queryformat="%{NAME}: %{OPTFLAGS}\n" ./wine-devel64-4.21-1.1.x86_64.rpm:
-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection