Revision: 9132
Author: [email protected]
Date: Fri Oct 22 04:28:03 2010
Log: For the xpcom plugin, detect if the system linker is GNU gold. If so, try to use compat-ld instead

Review at http://gwt-code-reviews.appspot.com/1008801

http://code.google.com/p/google-web-toolkit/source/detail?r=9132

Modified:
 /trunk/plugins/xpcom/Makefile

=======================================
--- /trunk/plugins/xpcom/Makefile       Thu Jun 17 11:57:35 2010
+++ /trunk/plugins/xpcom/Makefile       Fri Oct 22 04:28:03 2010
@@ -24,7 +24,7 @@
 DEFAULT_FIREFOX_LIBS ?= /Applications/Firefox.app/Contents/MacOS
 RUN_PATH_FLAG = -executable_path
 DLL_SUFFIX = .dylib
-DLLFLAGS = -bundle $(ALLARCHCFLAGS)
+DLLFLAGS += -bundle $(ALLARCHCFLAGS)
 CFLAGS += $(ALLARCHCFLAGS)
 CXXFLAGS += $(ALLARCHCFLAGS)
 TARGET_PLATFORM = Darwin-gcc3
@@ -35,13 +35,13 @@
 DEFAULT_FIREFOX_LIBS ?= /usr/lib/firefox
 RUN_PATH_FLAG = -rpath-link
 DLL_SUFFIX = .so
-DLLFLAGS = -shared -m$(FLAG32BIT)
+DLLFLAGS += -shared -m$(FLAG32BIT)
 TARGET_PLATFORM = Linux_$(ARCH)-gcc3
 else
 ifeq ($(OS),sun)
 TARGET_PLATFORM = SunOS_$(ARCH)-sunc
 RUN_PATH_FLAG = -rpath-link
-DLLFLAGS=
+DLLFLAGS ?= ""
 endif
 endif
 endif
@@ -53,6 +53,18 @@
 BROWSER=ff3
 endif

+# Gold doesn't play nice with xpcom libs
+LINKER=$(shell ld -v | awk '{print $$2}')
+ifeq ($(LINKER), gold)
+ifeq ($(wildcard /usr/lib/compat-ld),)
+$(error cannot link with gold, use the BFD ld instead)
+else
+CFLAGS += -B/usr/lib/compat-ld/
+CXXFLAGS += -B/usr/lib/compat-ld/
+DLLFLAGS += -B/usr/lib/compat-ld/
+endif
+endif
+
 CFLAGS += -DBROWSER=$(BROWSER)
 GECKO_MINOR_VERSION=
 ifeq ($(BROWSER),ff2)

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to