7046316 locale and method shared objects can be built better
authorjenda
Fri, 03 Jun 2011 10:09:59 +0200
changeset 138 dff2e32f3bca
parent 137 fac8ced20d43
child 139 ab9fb5a8ad9a
7046316 locale and method shared objects can be built better
Makefile
--- a/Makefile	Tue May 31 14:08:24 2011 +0200
+++ b/Makefile	Fri Jun 03 10:09:59 2011 +0200
@@ -77,6 +77,7 @@
 #	CFLAGS*_common:	flags for both (i386/sparc) architectures
 #	CFLAGS*_sparc:	flags for sparc architecture only
 #	CFLAGS*_i386:	flags for i386 architecture only
+#
 CFLAGS_common	= -xO3 -Xa -xildoff -xc99=%none -v -K pic -D PIC -G -I. -z defs -z text -z ignore -D_REENTRANT
 CFLAGS32_common	= -m32
 CFLAGS64_common	= -m64
@@ -87,6 +88,15 @@
 CFLAGS32_i386	= -xspace
 CFLAGS64_i386	= -xarch=sse2 -Ui386 -U__i386  
 
+# dtto for LDFLAGS
+#
+LDFLAGS_common		= -Bdirect
+LDFLAGS32_common	= -R\\\$$ORIGIN/../common
+LDFLAGS64_common	= -R\\\$$ORIGIN/../../common/$(MACH64)
+
+LDFLAGS_sparc	= -M /usr/lib/ld/map.pagealign
+LDFLAGS_i386	= -M /usr/lib/ld/map.pagealign -M /usr/lib/ld/map.noexdata
+
 
 # java flags
 # for cldr posix locale generator
@@ -117,6 +127,9 @@
 CFLAGS32	?= $(CFLAGS_common) $(CFLAGS32_common) $(CFLAGS_$(MACH)) $(CFLAGS32_$(MACH))
 CFLAGS64	?= $(CFLAGS_common) $(CFLAGS64_common) $(CFLAGS_$(MACH)) $(CFLAGS64_$(MACH))
 
+LDFLAGS32	?= $(LDFLAGS_common) $(LDFLAGS32_common) $(LDFLAGS_$(MACH)) $(LDFLAGS32_$(MACH))
+LDFLAGS64	?= $(LDFLAGS_common) $(LDFLAGS64_common) $(LDFLAGS_$(MACH)) $(LDFLAGS64_$(MACH))
+
 
 # java flags for cldr posix locale generator
 #	'-DCLDR_DTD_CACHE=.dtd_cache':		cache dir for temporary files
@@ -199,13 +212,13 @@
 
 $(LOCALES:%=build/%/32bit.so.3): build/%/32bit.so.3: build/%/posix.src build/%/32bit/.methods_so
 	$(M)LOCALEDEF $@
-	$(Q)cd $(@D)/32bit; $(LOCALEDEF) $(if $(Q),,-v) -P $(dir $(CC)) -W cc,"$(CFLAGS32)" -L "-R\\\$$ORIGIN" -x ../../../misc/$(call charmap, $*).x -f ../../$(call charmap, $*).cm -i ../posix.src $*; mv $*.so.3 ../32bit.so.3
+	$(Q)cd $(@D)/32bit; $(LOCALEDEF) $(if $(Q),,-v) -P $(dir $(CC)) -W cc,"$(CFLAGS32)" -L "$(LDFLAGS32)" -x ../../../misc/$(call charmap, $*).x -f ../../$(call charmap, $*).cm -i ../posix.src $*; mv $*.so.3 ../32bit.so.3
 
 # localedef reads the 32bit library for function definitions
 # and then links against the 64bit library, so we need both 32bit and 64bit versions
 $(LOCALES:%=build/%/64bit.so.3): build/%/64bit.so.3: build/%/posix.src build/%/64bit/.methods_so build/%/64bit/$(MACH64)/.methods_so
 	$(M)LOCALEDEF $@
-	$(Q)cd $(@D)/64bit; $(LOCALEDEF) $(if $(Q),,-v) -P $(dir $(CC)) -W cc,"$(CFLAGS64)" -L "-R\\\$$ORIGIN" -m lp64 -x ../../../misc/$(call charmap, $*).x -f ../../$(call charmap, $*).cm -i ../posix.src $*; mv $*.so.3 ../64bit.so.3
+	$(Q)cd $(@D)/64bit; $(LOCALEDEF) $(if $(Q),,-v) -P $(dir $(CC)) -W cc,"$(CFLAGS64)" -L "$(LDFLAGS64)" -m lp64 -x ../../../misc/$(call charmap, $*).x -f ../../$(call charmap, $*).cm -i ../posix.src $*; mv $*.so.3 ../64bit.so.3