On 08/24/2010 03:20 AM, Michel Dänzer wrote:
On Don, 2010-08-19 at 18:11 -0700, Vinson Lee wrote:
Module: Mesa
Branch: master
Commit: 9b7480cd95c2d1259e23bfb5549cefaa94ebaca1
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9b7480cd95c2d1259e23bfb5549cefaa94ebaca1

Author: Vinson Lee<v...@vmware.com>
Date:   Thu Aug 19 18:09:24 2010 -0700

configs: Add -lstdc++ to default.

This fixes the following error when trying to run glxinfo or glxgears
with swrast.

undefined symbol: __cxa_pure_virtual

---

  configs/default |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/configs/default b/configs/default
index 4f6334b..cdfa811 100644
--- a/configs/default
+++ b/configs/default
@@ -116,7 +116,7 @@ EGL_CLIENT_APIS = $(GL_LIB)

  # Library dependencies
  #EXTRA_LIB_PATH ?=
-GL_LIB_DEPS     = $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread -ltalloc
+GL_LIB_DEPS     = $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread -ltalloc 
-lstdc++

If linking with libstdc++ can't be avoided, the standard solution is to
link with g++ instead of using gcc -lstdc++, which doesn't work on all
platforms.

I missed this message/commit while I was away.

The attached patch is how I would fix this problem.

Vinson, can you try reverting your patch and trying this change?

There may be other Makefiles where this change might be needed.

-Brian
diff --git a/src/gallium/targets/libgl-xlib/Makefile 
b/src/gallium/targets/libgl-xlib/Makefile
index e745023..fe05415 100644
--- a/src/gallium/targets/libgl-xlib/Makefile
+++ b/src/gallium/targets/libgl-xlib/Makefile
@@ -68,8 +68,9 @@ $(TOP)/$(LIB_DIR)/gallium:
 # Make the libGL.so library
 $(TOP)/$(LIB_DIR)/gallium/$(GL_LIB_NAME): $(XLIB_TARGET_OBJECTS) $(LIBS) 
Makefile
        $(TOP)/bin/mklib -o $(GL_LIB) \
-               -linker "$(CC)" \
+               -linker "$(CXX)" \
                -major $(GL_MAJOR) -minor $(GL_MINOR) -patch $(GL_TINY) \
+               -cplusplus \
                -install $(TOP)/$(LIB_DIR)/gallium \
                $(MKLIB_OPTIONS) $(XLIB_TARGET_OBJECTS) \
                -Wl,--start-group $(LIBS) -Wl,--end-group $(GL_LIB_DEPS)
diff --git a/src/glx/Makefile b/src/glx/Makefile
index 9a22d0c..ba5708f 100644
--- a/src/glx/Makefile
+++ b/src/glx/Makefile
@@ -71,8 +71,9 @@ default: depend $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)
 
 # Make libGL
 $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) $(GLAPI_LIB) Makefile
-       $(MKLIB) -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
-               -major 1 -minor 2 $(MKLIB_OPTIONS) \
+       $(MKLIB) -o $(GL_LIB) -linker '$(CXX)' -ldflags '$(LDFLAGS)' \
+               -major 1 -minor 2 \
+               -cplusplus $(MKLIB_OPTIONS) \
                -install $(TOP)/$(LIB_DIR) -id 
$(INSTALL_LIB_DIR)/lib$(GL_LIB).1.dylib \
                $(GL_LIB_DEPS) $(OBJECTS) $(GLAPI_LIB)
 
diff --git a/src/mesa/drivers/x11/Makefile b/src/mesa/drivers/x11/Makefile
index b5b0c1f..f759da0 100644
--- a/src/mesa/drivers/x11/Makefile
+++ b/src/mesa/drivers/x11/Makefile
@@ -57,9 +57,10 @@ default: $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)
 
 
 $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME): $(OBJECTS) $(CORE_MESA)
-       @ $(MKLIB) -o $(GL_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
+       @ $(MKLIB) -o $(GL_LIB) -linker '$(CXX)' -ldflags '$(LDFLAGS)' \
                -major $(GL_MAJOR) -minor $(GL_MINOR) -patch $(GL_TINY) \
-               -install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
+               -install $(TOP)/$(LIB_DIR) \
+               -cplusplus $(MKLIB_OPTIONS) \
                -id $(INSTALL_LIB_DIR)/lib$(GL_LIB).$(GL_MAJOR).dylib \
                $(GL_LIB_DEPS) $(OBJECTS) $(CORE_MESA)
 
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to