diff options
author | Povilas Kanapickas <povilas@radix.lt> | 2021-04-07 22:16:43 +0300 |
---|---|---|
committer | Povilas Kanapickas <povilas@radix.lt> | 2021-04-09 11:18:54 +0000 |
commit | d231ce2d9ce9644e77e8dbe8c5a23eeb11e85b55 (patch) | |
tree | 573d5cfa1003e88832184d4bd604790db5633e41 | |
parent | 68c2cfadd6d31f0787bc35dbafe32d7dfd638e27 (diff) |
meson: Disable LTO for tests
`-flto=auto` together with `-Wl,-wrap` causes link errors at least in
certain compilers (e.g. GCC 10.2.0). Since this is reoccurring issue
(internet search shows similar problems with GCC 4.6 a decade ago) let's
disable LTO for tests even if it's disabled elsewhere.
Fixes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1116
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
-rw-r--r-- | test/meson.build | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/meson.build b/test/meson.build index f1ab2576a..91ea15723 100644 --- a/test/meson.build +++ b/test/meson.build @@ -144,7 +144,10 @@ if build_xorg unit_defines += ['-DRES_TESTS'] endif + unit_c_args = unit_defines if meson.get_compiler('c').has_link_argument('-Wl,-wrap') + # LTO breaks with -Wl,-wrap on certain configurations + unit_c_args += ['-fno-lto'] unit_sources += [ 'xi1/protocol-xchangedevicecontrol.c', 'xi2/protocol-common.c', @@ -178,7 +181,7 @@ if build_xorg unit = executable('tests', unit_sources, - c_args: unit_defines, + c_args: unit_c_args, dependencies: [pixman_dep, randrproto_dep, inputproto_dep], include_directories: unit_includes, link_args: ldwraps, |