mapi: work around GCC LTO dropping assembly-defined functions
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109391 Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru> Acked-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
This commit is contained in:

committed by
Eric Engestrom

parent
017349997f
commit
fccc9d3de6
@@ -1465,6 +1465,10 @@ pkg = import('pkgconfig')
|
|||||||
env_test = environment()
|
env_test = environment()
|
||||||
env_test.set('NM', find_program('nm').path())
|
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('include')
|
||||||
subdir('bin')
|
subdir('bin')
|
||||||
subdir('src')
|
subdir('src')
|
||||||
|
@@ -33,6 +33,7 @@ libglesv1_cm = shared_library(
|
|||||||
c_args : [
|
c_args : [
|
||||||
c_msvc_compat_args, c_vis_args, '-DMAPI_MODE_BRIDGE',
|
c_msvc_compat_args, c_vis_args, '-DMAPI_MODE_BRIDGE',
|
||||||
'-DMAPI_ABI_HEADER="@0@"'.format(es1_glapi_mapi_tmp_h.full_path()),
|
'-DMAPI_ABI_HEADER="@0@"'.format(es1_glapi_mapi_tmp_h.full_path()),
|
||||||
|
gcc_lto_quirk,
|
||||||
],
|
],
|
||||||
link_args : [ld_args_gc_sections],
|
link_args : [ld_args_gc_sections],
|
||||||
include_directories : [inc_src, inc_include, inc_mapi],
|
include_directories : [inc_src, inc_include, inc_mapi],
|
||||||
|
@@ -33,6 +33,7 @@ libgles2 = shared_library(
|
|||||||
c_args : [
|
c_args : [
|
||||||
c_msvc_compat_args, c_vis_args, '-DMAPI_MODE_BRIDGE',
|
c_msvc_compat_args, c_vis_args, '-DMAPI_MODE_BRIDGE',
|
||||||
'-DMAPI_ABI_HEADER="@0@"'.format(es2_glapi_mapi_tmp_h.full_path()),
|
'-DMAPI_ABI_HEADER="@0@"'.format(es2_glapi_mapi_tmp_h.full_path()),
|
||||||
|
gcc_lto_quirk,
|
||||||
],
|
],
|
||||||
link_args : [ld_args_gc_sections],
|
link_args : [ld_args_gc_sections],
|
||||||
include_directories : [inc_src, inc_include, inc_mapi],
|
include_directories : [inc_src, inc_include, inc_mapi],
|
||||||
|
@@ -44,6 +44,7 @@ if with_shared_glapi
|
|||||||
static_glapi_args += [
|
static_glapi_args += [
|
||||||
'-DMAPI_MODE_BRIDGE',
|
'-DMAPI_MODE_BRIDGE',
|
||||||
'-DMAPI_ABI_HEADER="@0@"'.format(glapi_mapi_tmp_h.full_path()),
|
'-DMAPI_ABI_HEADER="@0@"'.format(glapi_mapi_tmp_h.full_path()),
|
||||||
|
gcc_lto_quirk,
|
||||||
]
|
]
|
||||||
else
|
else
|
||||||
static_glapi_args += '-DMAPI_MODE_UTIL'
|
static_glapi_args += '-DMAPI_MODE_UTIL'
|
||||||
|
@@ -42,6 +42,7 @@ libglapi = shared_library(
|
|||||||
c_args : [
|
c_args : [
|
||||||
c_msvc_compat_args, c_vis_args, '-DMAPI_MODE_GLAPI',
|
c_msvc_compat_args, c_vis_args, '-DMAPI_MODE_GLAPI',
|
||||||
'-DMAPI_ABI_HEADER="@0@"'.format(shared_glapi_mapi_tmp_h.full_path()),
|
'-DMAPI_ABI_HEADER="@0@"'.format(shared_glapi_mapi_tmp_h.full_path()),
|
||||||
|
gcc_lto_quirk,
|
||||||
],
|
],
|
||||||
link_args : [ld_args_gc_sections],
|
link_args : [ld_args_gc_sections],
|
||||||
include_directories : [inc_src, inc_include, inc_mapi],
|
include_directories : [inc_src, inc_include, inc_mapi],
|
||||||
|
Reference in New Issue
Block a user