From 882400b1f49f8ff7a387e68949652b9ae06c4b65 Mon Sep 17 00:00:00 2001 From: Yonggang Luo Date: Sun, 23 Oct 2022 23:00:09 +0800 Subject: [PATCH] xlib: Remove the linkage hack in lib.c by use meson link_whole option Signed-off-by: Yonggang Luo Ack-by: Eric Engestrom Reviewed-by: Adam Jackson Part-of: --- src/gallium/targets/libgl-xlib/meson.build | 3 ++- src/gallium/targets/libgl-xlib/xlib.c | 14 -------------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/src/gallium/targets/libgl-xlib/meson.build b/src/gallium/targets/libgl-xlib/meson.build index 2856bbd2d23..932a693f1e5 100644 --- a/src/gallium/targets/libgl-xlib/meson.build +++ b/src/gallium/targets/libgl-xlib/meson.build @@ -48,8 +48,9 @@ libgl = shared_library( gnu_symbol_visibility : 'hidden', link_args : [ld_args_bsymbolic, ld_args_gc_sections, gallium_xlib_ld_args], link_depends : gallium_xlib_link_depends, + link_whole : [libxlib, libglapi_static], link_with : [ - libgalliumvl_stub, libxlib, libws_xlib, libglapi_static, + libgalliumvl_stub, libws_xlib, libgallium, libmesa, gallium_xlib_link_with, ], dependencies : [dep_x11, dep_thread, dep_clock, dep_unwind, driver_swrast, driver_virgl, driver_asahi], diff --git a/src/gallium/targets/libgl-xlib/xlib.c b/src/gallium/targets/libgl-xlib/xlib.c index 757419899ef..5bff3f276d2 100644 --- a/src/gallium/targets/libgl-xlib/xlib.c +++ b/src/gallium/targets/libgl-xlib/xlib.c @@ -89,17 +89,3 @@ static void _init( void ) */ xmesa_set_driver( &xlib_driver ); } - - -/*********************************************************************** - * - * Butt-ugly hack to convince the linker not to throw away public GL - * symbols (they are all referenced from getprocaddress, I guess). - */ -extern void (*linker_foo(const unsigned char *procName))(); -extern void (*glXGetProcAddress(const unsigned char *procName))(); - -extern void (*linker_foo(const unsigned char *procName))() -{ - return glXGetProcAddress(procName); -}