Mesa (master): mesa: Prepend "-Wl," to linking options

Brian Paul brianp at kemper.freedesktop.org
Thu Apr 30 23:04:38 UTC 2009


Module: Mesa
Branch: master
Commit: 9cb3cdec76b679f15c591955084bd48e91a32142
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9cb3cdec76b679f15c591955084bd48e91a32142

Author: Tormod Volden <debian.tormod at gmail.com>
Date:   Thu Apr 30 16:52:56 2009 -0600

mesa: Prepend "-Wl," to linking options

Let mklib ignore -Wl options inside the object list when building
static libraries

---

 bin/mklib                            |   17 +++++++++++++++++
 src/gallium/winsys/egl_xlib/Makefile |    2 +-
 src/gallium/winsys/xlib/Makefile     |    2 +-
 3 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/bin/mklib b/bin/mklib
index a3e826a..db3bc83 100755
--- a/bin/mklib
+++ b/bin/mklib
@@ -176,6 +176,23 @@ if [ ${ARCH} = "auto" ] ; then
 fi
 
 
+if [ $STATIC = 1 ]; then
+    # filter out linker options inside object list
+    NEWOBJECTS=""
+    for OBJ in $OBJECTS ; do
+	case $OBJ in
+	    -Wl,*)
+		echo "mklib: warning: ignoring $OBJ for static library"
+		;;
+	    *)
+		NEWOBJECTS="$NEWOBJECTS $OBJ"
+		;;
+	esac
+    done
+    OBJECTS=$NEWOBJECTS
+fi
+
+
 #
 # Error checking
 #
diff --git a/src/gallium/winsys/egl_xlib/Makefile b/src/gallium/winsys/egl_xlib/Makefile
index 02ac47c..8646ee3 100644
--- a/src/gallium/winsys/egl_xlib/Makefile
+++ b/src/gallium/winsys/egl_xlib/Makefile
@@ -60,7 +60,7 @@ $(TOP)/$(LIB_DIR)/$(DRIVER_NAME): $(WINSYS_OBJECTS) $(LIBS)
 		-noprefix \
 		-install $(TOP)/$(LIB_DIR) \
 		$(MKLIB_OPTIONS) $(WINSYS_OBJECTS) \
-		--whole-archive $(LIBS) --no-whole-archive
+		-Wl,--whole-archive $(LIBS) -Wl,--no-whole-archive
 
 
 depend: $(ALL_SOURCES)
diff --git a/src/gallium/winsys/xlib/Makefile b/src/gallium/winsys/xlib/Makefile
index bb187cc..04309e6 100644
--- a/src/gallium/winsys/xlib/Makefile
+++ b/src/gallium/winsys/xlib/Makefile
@@ -74,7 +74,7 @@ $(TOP)/$(LIB_DIR)/gallium/$(GL_LIB_NAME): $(XLIB_WINSYS_OBJECTS) $(LIBS) Makefil
 		-major $(GL_MAJOR) -minor $(GL_MINOR) -patch $(GL_TINY) \
 		-install $(TOP)/$(LIB_DIR)/gallium \
 		$(MKLIB_OPTIONS) $(XLIB_WINSYS_OBJECTS) \
-		--start-group $(LIBS) --end-group $(GL_LIB_DEPS)
+		-Wl,--start-group $(LIBS) -Wl,--end-group $(GL_LIB_DEPS)
 
 
 depend: $(XLIB_WINSYS_SOURCES)




More information about the mesa-commit mailing list