--- buildtools/wafsamba/samba_autoconf.py.orig 2019-12-16 19:14:22.000000000 +1000 +++ buildtools/wafsamba/samba_autoconf.py 2022-01-03 12:57:51.931928000 +1000 @@ -701,6 +701,7 @@ cflags=[ '-Werror', '-Wp,-D_FORTIFY_SOURCE=2', stack_protect_flag], mandatory=False, msg='Checking if compiler accepts %s' % (stack_protect_flag)) + break if flag_supported: conf.ADD_CFLAGS('%s' % (stack_protect_flag)) break