env_test = environment()
env_test.set('NM', find_program('nm').path())
+# This quirk needs to be applied to sources with functions defined in assembly
+# as GCC LTO drops them. See: https://bugs.freedesktop.org/show_bug.cgi?id=109391
+gcc_lto_quirk = (cc.get_id() == 'gcc') ? ['-fno-lto'] : []
+
subdir('include')
subdir('bin')
subdir('src')
c_args : [
c_msvc_compat_args, c_vis_args, '-DMAPI_MODE_BRIDGE',
'-DMAPI_ABI_HEADER="@0@"'.format(es1_glapi_mapi_tmp_h.full_path()),
+ gcc_lto_quirk,
],
link_args : [ld_args_gc_sections],
include_directories : [inc_src, inc_include, inc_mapi],
c_args : [
c_msvc_compat_args, c_vis_args, '-DMAPI_MODE_BRIDGE',
'-DMAPI_ABI_HEADER="@0@"'.format(es2_glapi_mapi_tmp_h.full_path()),
+ gcc_lto_quirk,
],
link_args : [ld_args_gc_sections],
include_directories : [inc_src, inc_include, inc_mapi],
static_glapi_args += [
'-DMAPI_MODE_BRIDGE',
'-DMAPI_ABI_HEADER="@0@"'.format(glapi_mapi_tmp_h.full_path()),
+ gcc_lto_quirk,
]
else
static_glapi_args += '-DMAPI_MODE_UTIL'
c_args : [
c_msvc_compat_args, c_vis_args, '-DMAPI_MODE_GLAPI',
'-DMAPI_ABI_HEADER="@0@"'.format(shared_glapi_mapi_tmp_h.full_path()),
+ gcc_lto_quirk,
],
link_args : [ld_args_gc_sections],
include_directories : [inc_src, inc_include, inc_mapi],