OSDN Git Service

mapi: work around GCC LTO dropping assembly-defined functions
authorKonstantin Kharlamov <Hi-Angel@yandex.ru>
Sun, 3 Feb 2019 18:36:32 +0000 (21:36 +0300)
committerEric Engestrom <eric@engestrom.ch>
Wed, 13 Feb 2019 14:20:51 +0000 (14:20 +0000)
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>
meson.build
src/mapi/es1api/meson.build
src/mapi/es2api/meson.build
src/mapi/glapi/meson.build
src/mapi/shared-glapi/meson.build

index 8c24ef2..fbc0297 100644 (file)
@@ -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')
index b0416e7..016090d 100644 (file)
@@ -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],
index a7f0904..c6e9261 100644 (file)
@@ -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],
index 7e8bc38..6a4f9f5 100644 (file)
@@ -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'
index 828d14b..af0c68a 100644 (file)
@@ -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],