Commit fccc9d3d authored by Konstantin Kharlamov's avatar Konstantin Kharlamov Committed by Eric Engestrom
Browse files

mapi: work around GCC LTO dropping assembly-defined functions

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109391

Signed-off-by: Konstantin Kharlamov's avatarKonstantin Kharlamov <Hi-Angel@yandex.ru>
Acked-by: Eric Engestrom's avatarEric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker's avatarDylan Baker <dylan@pnwbakers.com>
Reviewed-by: Eric Engestrom's avatarEric Engestrom <eric.engestrom@intel.com>
parent 01734999
Pipeline #18958 passed with stage
in 173 minutes and 21 seconds
......@@ -1465,6 +1465,10 @@ pkg = import('pkgconfig')
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')
......@@ -33,6 +33,7 @@ libglesv1_cm = shared_library(
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],
......
......@@ -33,6 +33,7 @@ libgles2 = shared_library(
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],
......
......@@ -44,6 +44,7 @@ if with_shared_glapi
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'
......
......@@ -42,6 +42,7 @@ libglapi = shared_library(
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],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment