7043393 various parts of the X gate have compilation errors in debug mode
authorAlan Coopersmith <Alan.Coopersmith@Oracle.COM>
Tue, 09 Aug 2011 22:42:59 -0700
changeset 1183 4e4ec215542f
parent 1182 16126dc6c0c9
child 1184 ae3294af5641
7043393 various parts of the X gate have compilation errors in debug mode
open-src/driver/Makefile.inc
open-src/driver/xf86-video-r128/Makefile
open-src/lib/fontconfig/Makefile
open-src/xserver/xorg/Makefile
--- a/open-src/driver/Makefile.inc	Thu Aug 04 22:42:12 2011 -0700
+++ b/open-src/driver/Makefile.inc	Tue Aug 09 22:42:59 2011 -0700
@@ -88,6 +88,10 @@
 	-M $(TOP)/open-src/xserver/xorg/$(BUILD_DIR)/mapfile-Xorg-externs
 MODTYPE_LD_OPTIONS=-z defs $(XORG_EXTERNS_FLAG) -lc
 
+$(BUILD_DEBUG:yes=)			MODTYPE_DEBUG_LD_OPTIONS = -lpixman-1
+$(BUILD_DEBUG:yes=$(POUND_SIGN))	MODTYPE_DEBUG_LD_OPTIONS =
+MODTYPE_LD_OPTIONS += $(MODTYPE_DEBUG_LD_OPTIONS)
+
 # Need to fix libtool interference with our linker flags
 DELIBTOOLIZE=yes
 
--- a/open-src/driver/xf86-video-r128/Makefile	Thu Aug 04 22:42:12 2011 -0700
+++ b/open-src/driver/xf86-video-r128/Makefile	Tue Aug 09 22:42:59 2011 -0700
@@ -62,5 +62,5 @@
 include ../Makefile.inc
 
 install_docs: $(INSTALL_DEPS)
-	mkdir -p $(PROTODIR)$(X11_DOC_DIR)
-	cp -p $(SOURCE_DIR)/README.r128 $(PROTODIR)$(X11_DOC_DIR)/
+	$(INSTALL_SCRIPT) -m 0444 $(SOURCE_DIR)/README.r128 \
+		$(PROTODIR)$(X11_DOC_DIR)/README.r128
--- a/open-src/lib/fontconfig/Makefile	Thu Aug 04 22:42:12 2011 -0700
+++ b/open-src/lib/fontconfig/Makefile	Tue Aug 09 22:42:59 2011 -0700
@@ -183,6 +183,7 @@
 
 fontconfig-sunman-install: $(INSTALL_RULES)
 	mkdir -p $(FC_MAN_DIR)/man4 $(FC_MAN_DIR)/man3lib
+	-rm -f $(FC_MAN_DIR)/man4/fonts.conf.4
 	sed -e 's/.TH "FONTS-CONF" "5"/.TH "fonts.conf" "4"/' 	\
 	  $(FC_MAN_DIR)/man5/fonts-conf.5 > $(FC_MAN_DIR)/man4/fonts.conf.4
 	-rm -f $(FC_MAN_DIR)/man3lib/libfontconfig.3lib
--- a/open-src/xserver/xorg/Makefile	Thu Aug 04 22:42:12 2011 -0700
+++ b/open-src/xserver/xorg/Makefile	Tue Aug 09 22:42:59 2011 -0700
@@ -156,6 +156,13 @@
 
 include ../Makefile.inc
 
+# Debug builds disable optimization that removes unused inline functions,
+# leaving many binaries referencing pixman symbols that normally don't
+# need them.
+$(BUILD_DEBUG:yes=)			DEBUG_CONFIG_OPTS = LIBS="-lpixman-1"
+$(BUILD_DEBUG:yes=$(POUND_SIGN))	DEBUG_CONFIG_OPTS =
+MODULE_CONFIG_OPTS += $(DEBUG_CONFIG_OPTS)
+
 $(XORGSERVER_BIN): default_build
 
 SDK_INCLUDES_DIR=$(PROTODIR)$(X11_INCLUDES_DIR)/xorg/
@@ -193,12 +200,23 @@
 	    ../$(SUBDIR64)$(PKGCONFIG_DIR_suffix)/xorg-server-uninstalled.pc \
 		$(PROTODIR)$(PKGCONFIG_DIR_32)/
 
+# Generate a list of exported functions & data objects so that we can verify
+# loadable modules don't reference symbols that have been deleted or renamed.
+SYMBOL_AWK_SCRIPT  = \
+'BEGIN { print "\043 Functions exported by Xorg server to loadable modules" ; \
+	 print "\n{\n  global:" } \
+ END   { print "};" } \
+ $$7 ~ /UNDEF|\.tdata/  { next } \
+ $$5 !~ /GLOB/  { next } \
+ $$8 ~ /^(__|_end|_etext|_start|_environ|_lib_version)/ { next } \
+ $$4 ~ /FUNC/ && $$7 ~ /\.text/ { printf "    %s = FUNCTION extern;\n", $$8 } \
+ $$4 ~ /OBJT/ && $$7 ~ /data|bss/ { printf "    %s = DATA extern;\n", $$8}'
+
 $(BUILD_DIR)/mapfile-Xorg-externs: $(XORGSERVER_BIN)
 	-rm -f $@
-	printf '# Functions exported by Xorg server to loadable modules\n\n' > $@
-	printf '{\n  global:\n' >> $@
-	/usr/ccs/bin/nm -g $(XORGSERVER_BIN) $(PROTODIR)$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR)/libXfont.so | grep -v UNDEF | sed -n -e 's/^.*\|FUNC \|GLOB \|.*\|\([A-Za-z].*\)$$/    \1 = FUNCTION extern;/p' -e 's/^.*\|OBJT \|GLOB \|.*\|\([A-Za-z].*\)$$/    \1 = DATA extern;/p' >> $@
-	printf '};\n' >> $@
+	/usr/bin/nm -gs $(XORGSERVER_BIN) \
+	    $(PROTODIR)$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR)/libXfont.so | \
+	    gawk -F\| $(SYMBOL_AWK_SCRIPT) > $@
 
 # Fix paths in proto area to match paths in packages / installed systems
 install_fix_paths_X: default_install