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']
|
||||
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,
|
||||
|
|
Loading…
Reference in New Issue
Block a user