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>
This commit is contained in:
parent
68c2cfadd6
commit
d231ce2d9c
|
@ -144,7 +144,10 @@ if build_xorg
|
||||||
unit_defines += ['-DRES_TESTS']
|
unit_defines += ['-DRES_TESTS']
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
unit_c_args = unit_defines
|
||||||
if meson.get_compiler('c').has_link_argument('-Wl,-wrap')
|
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 += [
|
unit_sources += [
|
||||||
'xi1/protocol-xchangedevicecontrol.c',
|
'xi1/protocol-xchangedevicecontrol.c',
|
||||||
'xi2/protocol-common.c',
|
'xi2/protocol-common.c',
|
||||||
|
@ -178,7 +181,7 @@ if build_xorg
|
||||||
|
|
||||||
unit = executable('tests',
|
unit = executable('tests',
|
||||||
unit_sources,
|
unit_sources,
|
||||||
c_args: unit_defines,
|
c_args: unit_c_args,
|
||||||
dependencies: [pixman_dep, randrproto_dep, inputproto_dep],
|
dependencies: [pixman_dep, randrproto_dep, inputproto_dep],
|
||||||
include_directories: unit_includes,
|
include_directories: unit_includes,
|
||||||
link_args: ldwraps,
|
link_args: ldwraps,
|
||||||
|
|
Loading…
Reference in New Issue