Issues with _FORTIFY_SOURCE=3

Description:

The recent change to -D_FORTIFY_SOURCE=3 led to a build failure in the kitty-git AUR package. What happens is that kitty's build script prepends -D_FORTIFY_SOURCE=2 and -Werror to the env CFLAGS, and this means we'll end up with two conflicting definitions of -D_FORTIFY_SOURCE=2 on the command line, which together with -Werror is a failure:

<command-line>: error: "_FORTIFY_SOURCE" redefined [-Werror]
<command-line>: note: this is the location of the previous definition

Now, this is a bit unfortunate. kitty correctly prepends to give our flags precedence, and usually, later CFLAGS override earlier CFLAGS, but not in the case of -D.

It's not entirely clear to me who should be responsible for dealing with redefinitions. But I'd like to suggest changing our CFLAGS to -U_FORTIFY_SOURCE D_FORTIFY_SOURCE=3 to avoid such issues entirely in the future. This looks a bit invasive at first glance, but I think it's really no more invasive than what happens with every other flag in CFLAGS.

Additional info: