meson.build: fix build without stack-protector

Check for -fstack-protector-strong availability through
has_link_argument as some compilers could missed the needed library
(-lssp or -lssp_nonshared) at linking step resulting in a build failure.

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
This commit is contained in:
Fabrice Fontaine
2020-11-25 07:38:03 +01:00
parent 948c21647b
commit b8ac99dd48

View File

@ -140,10 +140,6 @@ else
test_c_args += ['-Werror=incompatible-pointer-types']
endif
if get_option('buildtype') != 'plain'
test_c_args += '-fstack-protector-strong'
endif
foreach arg: test_c_args
if cc.has_multi_arguments(arg)
global_c_args += arg
@ -158,6 +154,11 @@ test_link_args = [
'-Wl,-z,relro',
'-Wl,-z,now',
]
if get_option('buildtype') != 'plain'
test_link_args += '-fstack-protector-strong'
endif
if not get_option('buildtype').startswith('debug')
release_flags += [
'-DG_DISABLE_CAST_CHECKS',