From cad901547b53cd94011350e86a9d219d40a347bf Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Mon, 23 Mar 2020 11:37:28 +0100 Subject: [PATCH] meson.build: compile with -fno-strict-aliasing I tested that older compilers don't refuse this option: - gcc 4.8 (as that's the default in CentOS 7) - llvm 3.8 (year 2016 is enough, I hope) --- meson.build | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/meson.build b/meson.build index bddbe49ec..aa961aa70 100644 --- a/meson.build +++ b/meson.build @@ -118,6 +118,14 @@ add_project_arguments( '-Werror=implicit-function-declaration', # Probably messed up includes; implicit functions are evil! '-fvisibility=hidden', '-DHAVE_ASPRINTF=' + have_asprintf.to_int().to_string(), + + # libuv handles have aliasing problems; see: + # https://github.com/libuv/libuv/pull/2588/files#diff-04c6e90faac2675aa89e2176d2eec7d8 + # https://github.com/libuv/libuv/issues/1230#issuecomment-569030944 + # Performance impact in our case seems OK: + # https://gitlab.labs.nic.cz/knot/knot-resolver/-/merge_requests/962#note_147407 + '-fno-strict-aliasing', + language: 'c', ) -- 2.47.2