Meson: build failure with gcc10 on Win32
Due to some changes in gcc 10, CI run for meson-mingw-w64-build started to fail: https://gitlab.freedesktop.org/xiota/fontconfig/-/pipelines/219700
We use Fedora in CI and this has already been brought up as a topic on the maling list too: https://www.spinics.net/lists/fedora-devel/msg275591.html
So according to that, we need to add both _FORTIFY_SOURCE=2 and -fstack-protector. FWIW why did this happen in meson only? it was done for autotools by the line of:
- eval
rpm --eval %{mingw64_env}
and then that sets the proper LDFLAGS. but adding that line for meson-mingw-w64-build seems not enough. that failure still happens and the linker options in LDFLAGS (nor compiler options in CFLAGS) wasn't used for building. even though meson recognize it is:
The Meson build system
Version: 0.55.3
Source dir: /builds/tagoh/fontconfig
Build dir: /builds/tagoh/fontconfig/build-fontconfig-02d2027d5ede225bb9d6c7e693eae7a79be332ff-5284257
Build type: cross build
Project name: fontconfig
Project version: 2.13.91
C compiler for the build machine: cc (gcc 10.2.1 "cc (GCC) 10.2.1 20201005 (Red Hat 10.2.1-5)")
C linker for the build machine: cc ld.bfd 2.35-11
Using 'CFLAGS' from environment with value: ' -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4'
Using 'LDFLAGS' from environment with value: '-fstack-protector -lssp'
Using 'CPPFLAGS' from environment with value: ''