Commit 077b8b22 authored by Daniel P. Berrangé's avatar Daniel P. Berrangé

meson: enable stack protector on freebsd and windows

Fedora 33 rawhide no longer successfully builds GTK-VNC on mingw using
fortify source, without also having stack protector flags enabled/
Signed-off-by: default avatarDaniel P. Berrangé <>
parent 974c78f2
......@@ -231,12 +231,6 @@ check_cflags = [
if host_machine.system() == 'linux'
check_cflags += [
cflags = []
foreach cflag: check_cflags
......@@ -246,6 +240,21 @@ foreach cflag: check_cflags
if host_machine.system() in [ 'linux', 'freebsd', 'windows' ]
# we prefer -fstack-protector-strong but fallback to -fstack-protector-all
fstack_cflags = cc.first_supported_argument([
cflags += fstack_cflags
# When building with mingw using -fstack-protector requires libssp library
# which is included by using -fstack-protector with linker.
if fstack_cflags.length() == 1 and host_machine.system() == 'windows'
add_project_link_arguments(fstack_cflags, language: 'c')
add_project_arguments(cflags, language: 'c')
gtk_vnc_prefix = get_option('prefix')
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment