Subject: bug#37852: Build failure on MSYS2 (undefined reference to _chk functions)

From: Paul Eggert <[email-masked]>
Date: Tue, 22 Oct 2019 11:27:48 -0700

On 10/21/19 7:37 PM, Eli Zaretskii wrote:

>> I don't understand MSYS2 well enough to suggest fixes for Emacs, other
>> than "don't configure with --enable-gcc-warnings and don't compile with
>> _FORTIFY_SOURCE defined".
> 
> Should we perhaps test for -lssp, and if it is found, add it to the
> link command when we define _FORTIFY_SOURCE?

If this is done only on MSYS2 platforms, and if -lssp is used only when 
it causes otherwise-failing programs to work, then it should be OK. I 
wouldn't do it elsewhere because on Fedora at any rate, -lssp used to be 
trouble and was best avoided.

It vaguely sounds like MSYS2 is trailing Fedora and so is experiencing 
problems Fedora had a few years ago (see, e.g., 
<https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-4973>).