Mesa (i965g-restart): ws/i965: add butt-ugly linker hack

Keith Whitwell keithw at kemper.freedesktop.org
Wed Nov 4 21:38:28 UTC 2009


Module: Mesa
Branch: i965g-restart
Commit: b549bbb49868702d45fbcf5d75d2c14ffeca692b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b549bbb49868702d45fbcf5d75d2c14ffeca692b

Author: Keith Whitwell <keithw at vmware.com>
Date:   Wed Nov  4 13:59:59 2009 +0000

ws/i965: add butt-ugly linker hack

Need more linker magic to keep the glX symbols externally visible even
though they started off in a .a file.

---

 src/gallium/winsys/drm/i965/xlib/xlib_i965.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/src/gallium/winsys/drm/i965/xlib/xlib_i965.c b/src/gallium/winsys/drm/i965/xlib/xlib_i965.c
index 60ab8e1..c55ba6b 100644
--- a/src/gallium/winsys/drm/i965/xlib/xlib_i965.c
+++ b/src/gallium/winsys/drm/i965/xlib/xlib_i965.c
@@ -360,3 +360,18 @@ struct xm_driver xlib_i965_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);
+}




More information about the mesa-commit mailing list