mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 07:20:10 +01:00
mapi: Hide OpenGL functions to be exported when shared-glapi is disabled
Fixes the following test error: 135/154 mesa:gallium / osmesa-symbols-check FAIL 0.07s exit status 1 ``` src/gallium/targets/osmesa/libOSMesa.so.8.0.0: unknown symbol exported: glAreTexturesResidentEXT src/gallium/targets/osmesa/libOSMesa.so.8.0.0: unknown symbol exported: glDeleteTexturesEXT src/gallium/targets/osmesa/libOSMesa.so.8.0.0: unknown symbol exported: glGenTexturesEXT src/gallium/targets/osmesa/libOSMesa.so.8.0.0: unknown symbol exported: glIsTextureEXT ``` The build options is: ``` -D glx=xlib -D gles1=disabled -D gles2=disabled -D shared-glapi=disabled ``` Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Corentin Noël <corentin.noel@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23409>
This commit is contained in:
parent
a8b8324494
commit
d5a09bf594
6 changed files with 16 additions and 12 deletions
|
|
@ -779,10 +779,12 @@ if with_clc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
gl_pkgconfig_c_flags = []
|
gl_pkgconfig_c_flags = []
|
||||||
|
with_glx_indirect_rendering = false
|
||||||
if with_platform_x11
|
if with_platform_x11
|
||||||
if with_glx == 'xlib'
|
if with_glx == 'xlib'
|
||||||
pre_args += '-DUSE_XSHM'
|
pre_args += '-DUSE_XSHM'
|
||||||
else
|
else
|
||||||
|
with_glx_indirect_rendering = true
|
||||||
pre_args += '-DGLX_INDIRECT_RENDERING'
|
pre_args += '-DGLX_INDIRECT_RENDERING'
|
||||||
if with_glx_direct
|
if with_glx_direct
|
||||||
pre_args += '-DGLX_DIRECT_RENDERING'
|
pre_args += '-DGLX_DIRECT_RENDERING'
|
||||||
|
|
@ -797,6 +799,13 @@ if with_platform_x11
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
with_glapi_export_proto_entry_points = false
|
||||||
|
if with_shared_glapi and not with_glx_indirect_rendering
|
||||||
|
# Imply !defined(GLX_INDIRECT_RENDERING)
|
||||||
|
with_glapi_export_proto_entry_points = true
|
||||||
|
endif
|
||||||
|
pre_args += '-DGLAPI_EXPORT_PROTO_ENTRY_POINTS=@0@'.format(with_glapi_export_proto_entry_points ? '1' : '0')
|
||||||
|
|
||||||
with_android_stub = get_option('android-stub')
|
with_android_stub = get_option('android-stub')
|
||||||
if with_android_stub and not with_platform_android
|
if with_android_stub and not with_platform_android
|
||||||
error('`-D android-stub=true` makes no sense without `-D platforms=android`')
|
error('`-D android-stub=true` makes no sense without `-D platforms=android`')
|
||||||
|
|
|
||||||
|
|
@ -157,7 +157,7 @@ class PrintGenericStubs(gl_XML.gl_print_base):
|
||||||
text = '\tGL_STUB_ALIAS(gl%s, gl%s)' % (n, f.name)
|
text = '\tGL_STUB_ALIAS(gl%s, gl%s)' % (n, f.name)
|
||||||
|
|
||||||
if f.has_different_protocol(n):
|
if f.has_different_protocol(n):
|
||||||
print('#ifndef GLX_INDIRECT_RENDERING')
|
print('#if GLAPI_EXPORT_PROTO_ENTRY_POINTS')
|
||||||
print(text)
|
print(text)
|
||||||
print('#endif')
|
print('#endif')
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -238,10 +238,10 @@ _glapi_proc UNUSED_TABLE_NAME[] = {""")
|
||||||
for ent in normal_entries:
|
for ent in normal_entries:
|
||||||
print(' TABLE_ENTRY(%s),' % (ent))
|
print(' TABLE_ENTRY(%s),' % (ent))
|
||||||
print('#endif /* _GLAPI_SKIP_NORMAL_ENTRY_POINTS */')
|
print('#endif /* _GLAPI_SKIP_NORMAL_ENTRY_POINTS */')
|
||||||
print('#ifndef _GLAPI_SKIP_PROTO_ENTRY_POINTS')
|
print('#if GLAPI_EXPORT_PROTO_ENTRY_POINTS')
|
||||||
for ent in proto_entries:
|
for ent in proto_entries:
|
||||||
print(' TABLE_ENTRY(%s),' % (ent))
|
print(' TABLE_ENTRY(%s),' % (ent))
|
||||||
print('#endif /* _GLAPI_SKIP_PROTO_ENTRY_POINTS */')
|
print('#endif /* GLAPI_EXPORT_PROTO_ENTRY_POINTS */')
|
||||||
|
|
||||||
print('};')
|
print('};')
|
||||||
print('#endif /*UNUSED_TABLE_NAME*/')
|
print('#endif /*UNUSED_TABLE_NAME*/')
|
||||||
|
|
@ -291,13 +291,13 @@ _glapi_proc UNUSED_TABLE_NAME[] = {""")
|
||||||
print('#endif /* _GLAPI_SKIP_NORMAL_ENTRY_POINTS */')
|
print('#endif /* _GLAPI_SKIP_NORMAL_ENTRY_POINTS */')
|
||||||
print('')
|
print('')
|
||||||
print('/* these entry points might require different protocols */')
|
print('/* these entry points might require different protocols */')
|
||||||
print('#ifndef _GLAPI_SKIP_PROTO_ENTRY_POINTS')
|
print('#if GLAPI_EXPORT_PROTO_ENTRY_POINTS')
|
||||||
print('')
|
print('')
|
||||||
for func, ents in proto_entry_points:
|
for func, ents in proto_entry_points:
|
||||||
for ent in ents:
|
for ent in ents:
|
||||||
self.printFunction(func, ent)
|
self.printFunction(func, ent)
|
||||||
print('')
|
print('')
|
||||||
print('#endif /* _GLAPI_SKIP_PROTO_ENTRY_POINTS */')
|
print('#endif /* GLAPI_EXPORT_PROTO_ENTRY_POINTS */')
|
||||||
print('')
|
print('')
|
||||||
|
|
||||||
self.printInitDispatch(api)
|
self.printInitDispatch(api)
|
||||||
|
|
|
||||||
|
|
@ -222,7 +222,7 @@ class PrintGenericStubs(gl_XML.gl_print_base):
|
||||||
text = '\t.globl GL_PREFIX(%s) ; .set GL_PREFIX(%s), GL_PREFIX(%s)' % (n, n, dispatch)
|
text = '\t.globl GL_PREFIX(%s) ; .set GL_PREFIX(%s), GL_PREFIX(%s)' % (n, n, dispatch)
|
||||||
|
|
||||||
if f.has_different_protocol(n):
|
if f.has_different_protocol(n):
|
||||||
print('#ifndef GLX_INDIRECT_RENDERING')
|
print('#if GLAPI_EXPORT_PROTO_ENTRY_POINTS')
|
||||||
print(text)
|
print(text)
|
||||||
print('#endif')
|
print('#endif')
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -178,7 +178,7 @@ class PrintGenericStubs(gl_XML.gl_print_base):
|
||||||
text = '\tGL_STUB_ALIAS(%s, %d, %s, %s, %s)' % (n, f.offset, alt2, name, alt)
|
text = '\tGL_STUB_ALIAS(%s, %d, %s, %s, %s)' % (n, f.offset, alt2, name, alt)
|
||||||
|
|
||||||
if f.has_different_protocol(n):
|
if f.has_different_protocol(n):
|
||||||
print('#ifndef GLX_INDIRECT_RENDERING')
|
print('#if GLAPI_EXPORT_PROTO_ENTRY_POINTS')
|
||||||
print(text)
|
print(text)
|
||||||
print('#endif')
|
print('#endif')
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -74,11 +74,6 @@
|
||||||
|
|
||||||
#endif /* logging */
|
#endif /* logging */
|
||||||
|
|
||||||
#ifdef GLX_INDIRECT_RENDERING
|
|
||||||
/* those link to libglapi.a should provide the entry points */
|
|
||||||
#define _GLAPI_SKIP_PROTO_ENTRY_POINTS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Enable frame pointer elimination on Windows, otherwise forgetting to add
|
/* Enable frame pointer elimination on Windows, otherwise forgetting to add
|
||||||
* GLAPIENTRY to _mesa_* entrypoints will not cause crashes on debug builds, as
|
* GLAPIENTRY to _mesa_* entrypoints will not cause crashes on debug builds, as
|
||||||
* the initial ESP value is saved in the EBP in the function prologue, then
|
* the initial ESP value is saved in the EBP in the function prologue, then
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue