[csw-devel] SF.net SVN: gar:[17349] csw/mgar/pkg/spidermonkey/trunk

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Sat Mar 10 10:55:57 CET 2012


Revision: 17349
          http://gar.svn.sourceforge.net/gar/?rev=17349&view=rev
Author:   wahwah
Date:     2012-03-10 09:55:57 +0000 (Sat, 10 Mar 2012)
Log Message:
-----------
spidermonkey/trunk: nearly there. The soname is still wrong, it should be libmozjs185.so.1.0.0 but is libmozjs185.so

Modified Paths:
--------------
    csw/mgar/pkg/spidermonkey/trunk/Makefile

Added Paths:
-----------
    csw/mgar/pkg/spidermonkey/trunk/files/0001-Do-not-use-GNU-ld-flags-with-non-GNU-ld.patch
    csw/mgar/pkg/spidermonkey/trunk/files/0002-Do-not-use-fpclassify-on-Solaris.patch

Modified: csw/mgar/pkg/spidermonkey/trunk/Makefile
===================================================================
--- csw/mgar/pkg/spidermonkey/trunk/Makefile	2012-03-09 22:30:12 UTC (rev 17348)
+++ csw/mgar/pkg/spidermonkey/trunk/Makefile	2012-03-10 09:55:57 UTC (rev 17349)
@@ -14,29 +14,15 @@
 MASTER_SITES = http://ftp.mozilla.org/pub/mozilla.org/js/
 DISTFILES    = js185-$(VERSION).tar.gz
 
-# the sun5.8 x86 config file is missing so
-# we are using our own
-#DISTFILES += SunOS5.8_i86pc.mk
-
 PACKAGING_PLATFORMS = solaris10-sparc solaris10-i386
 prefix = $(BUILD_PREFIX)/gxx
 
 DISTNAME = js-1.8.5
 
-# # we find the os string used by the makefile by using
-# # the same code (from config.mk)
-# OS_ARCH := $(subst /,_,$(shell uname -s | sed /\ /s//_/))
-# # Attempt to differentiate between SunOS 5.4 and x86 5.4
-# OS_CPUARCH := $(shell uname -m)
-# ifeq ($(OS_CPUARCH),i86pc)
-# OS_RELEASE := $(shell uname -r)_$(OS_CPUARCH)
-# else
-# OS_RELEASE := $(shell uname -r)
-# endif
-# OS_CONFIG := $(OS_ARCH)$(OS_OBJTYPE)$(OS_RELEASE)
-
 CONFIGURE_ARGS = $(DIRPATHS)
 
+LICENSE = js/src/README.html
+
 CONFIGURE_SCRIPTS = custom
 BUILD_SCRIPTS = custom
 TEST_SCRIPTS = 
@@ -49,6 +35,17 @@
 BUILD_DEP_PKGS += CSWgcc4core
 BUILD_DEP_PKGS += CSWgcc4g++
 
+PACKAGES = CSWspidermonkey-dev
+SPKG_DESC_CSWspidermonkey-dev += $(DESCRIPTION), header files
+PKGFILES_CSWspidermonkey-dev += $(PKGFILES_DEVEL)
+PKGFILES_CSWspidermonkey-dev += $(libdir)/libmozjs185.so
+
+PACKAGES += CSWlibmozjs185-gxx
+PKGFILES_CSWlibmozjs185-gxx += $(call baseisadirs,$(libdir),libmozjs185\.so\.1\.0\.0)
+SPKG_DESC_CSWlibmozjs185-gxx += $(DESCRIPTION), libmozjs185.so
+RUNTIME_DEP_PKGS_CSWlibmozjs185-gxx += CSWlibgcc-s1
+RUNTIME_DEP_PKGS_CSWlibmozjs185-gxx += CSWlibstdc++6
+
 include gar/category.mk
 
 post-patch:
@@ -71,33 +68,21 @@
 	       --disable-pedantic \
 	       --with-nspr-prefix=/opt/csw \
 	       --prefix=/opt/csw/gxx \
-	       --with-system-nspr)
+	       --with-system-nspr \
+	       --enable-threadsasafe \
+	       --with-ctypes)
 	@$(MAKECOOKIE)
 
-disabled-pre-build:
-	# if we are on x86, we install our own config file
-	# and remove the lock_SunOS.s cause the makefile
-	# always tries to compile it (why so ?)
-	# ( if [ "$(OS_CPUARCH)" = "i86pc" ]; then \
-	# 	cp $(WORKDIR)/SunOS5.8_i86pc.mk $(WORKSRC)/src/config; \
-	# 	rm -f $(WORKSRC)/src/lock_SunOS.s; \
-	# fi )
-
 build-custom:
 	# cd $(WORKSRC)/js/src && DISABLE_JIT=1 BUILD_OPT=1 $(MAKE) -f Makefile.ref
 	cd $(WORKSRC)/js/objdir && $(MAKE)
 	@$(MAKECOOKIE)
 
 install-custom:
-	ginstall -d $(DESTDIR)$(includedir)
-	cp $(WORKSRC)/src/*.h $(DESTDIR)$(includedir)
-	cp $(WORKSRC)/src/$(OS_CONFIG)_OPT.OBJ/*.h $(DESTDIR)$(includedir)
-	# 
-	ginstall -d $(DESTDIR)$(libdir)
-	ginstall -D $(WORKSRC)/src/$(OS_CONFIG)_OPT.OBJ/libjs.so $(DESTDIR)$(libdir)/libjs.so
-	ginstall -D $(WORKSRC)/src/$(OS_CONFIG)_OPT.OBJ/libjs.a $(DESTDIR)$(libdir)/libjs.a
-	#
-	ginstall -d $(DESTDIR)$(bindir)
-	ginstall -D $(WORKSRC)/src/$(OS_CONFIG)_OPT.OBJ/js $(DESTDIR)$(bindir)/js
-	ginstall -D $(WORKSRC)/src/$(OS_CONFIG)_OPT.OBJ/jscpucfg $(DESTDIR)$(bindir)/jscpucfg
-
+	cd $(WORKSRC)/js/objdir && $(MAKE) $(INSTALL_ENV) install
+	# Symlinks after installation are broken: they use absolute paths.
+	grm -v $(DESTDIR)/opt/csw/gxx/lib/libmozjs185.so
+	grm -v $(DESTDIR)/opt/csw/gxx/lib/libmozjs185.so.1.0
+	gln -vs libmozjs185.so.1.0 $(DESTDIR)/opt/csw/gxx/lib/libmozjs185.so
+	gln -vs libmozjs185.so.1.0.0 $(DESTDIR)/opt/csw/gxx/lib/libmozjs185.so.1.0
+	@$(MAKECOOKIE)

Added: csw/mgar/pkg/spidermonkey/trunk/files/0001-Do-not-use-GNU-ld-flags-with-non-GNU-ld.patch
===================================================================
--- csw/mgar/pkg/spidermonkey/trunk/files/0001-Do-not-use-GNU-ld-flags-with-non-GNU-ld.patch	                        (rev 0)
+++ csw/mgar/pkg/spidermonkey/trunk/files/0001-Do-not-use-GNU-ld-flags-with-non-GNU-ld.patch	2012-03-10 09:55:57 UTC (rev 17349)
@@ -0,0 +1,99 @@
+From e89d165866a9877b708fc853136d3125aa1e17a7 Mon Sep 17 00:00:00 2001
+From: Maciej Blizinski <maciej at opencsw.org>
+Date: Sat, 10 Mar 2012 10:28:33 +0100
+Subject: [PATCH 1/2] Do not use GNU ld flags with non-GNU ld
+
+Fails on Solaris:
+
+rm -f libmozjs185.so 
+/opt/csw/bin/g++  -fno-rtti -fno-exceptions -fshort-enums 
+-DJS_C_STRINGS_ARE_UTF8 -fno-strict-aliasing -pthread  -DNDEBUG -DTRIMMED 
+-O3 -fstrict-aliasing -fomit-frame-pointer -mcpu=v9 -DUSE_SYSTEM_MALLOC=1 
+-DENABLE_ASSEMBLER=1 -DENABLE_JIT=1 -fPIC -shared -Wl,-h,libmozjs185.so -o 
+libmozjs185.so  jsanalyze.o jsapi.o jsarena.o jsarray.o jsatom.o jsbool.o 
+jsclone.o jscntxt.o jscompartment.o jsdate.o jsdbgapi.o jsdhash.o jsdtoa.o 
+jsemit.o jsexn.o jsfriendapi.o jsfun.o jsgc.o jsgcchunk.o jsgcstats.o 
+jshash.o jsinterp.o jsinvoke.o jsiter.o jslock.o jslog2.o jsmath.o 
+jsnativestack.o jsnum.o jsobj.o json.o jsopcode.o jsparse.o jsproxy.o 
+jsprf.o jsprobes.o jspropertycache.o jspropertytree.o jsreflect.o 
+jsregexp.o jsscan.o jsscope.o jsscript.o jsstr.o jstypedarray.o jsutil.o 
+jswrapper.o jsxdrapi.o jsxml.o prmjtime.o sharkctl.o jstracer.o Assembler.o 
+Allocator.o CodeAlloc.o Containers.o Fragmento.o LIR.o njconfig.o 
+RegAlloc.o avmplus.o NativeSparc.o jsbuiltins.o VMPI.o Writer.o checks.o 
+conversions.o diy-fp.o v8-dtoa.o fast-dtoa.o platform.o utils.o 
+pcre_compile.o pcre_exec.o pcre_tables.o pcre_xclass.o 
+pcre_ucp_searchfuncs.o jsperf.o pm_stub.o     -lpthread  -Wl,-z,ignore 
+-Wl,-R,'$ORIGIN:$ORIGIN/..' -Wl,-z,lazyload -Wl,-z,combreloc -Wl,-z,muldefs 
+   -Wl,-R/opt/csw/lib -L/opt/csw/lib -lplds4 -lplc4 -lnspr4 -L/opt/csw/lib 
+-lpthread -ldl -lposix4 -Wl,-soname,libmozjs185.so.1.0 -lsocket -lc  -lm 
+-lpos 
+ix4 -ldl -lnsl -lsocket 
+ld: warning: option -o appears more than once, first setting taken 
+ld: fatal: file libmozjs185.so.1.0: open failed: No such file or directory 
+ld: fatal: File processing errors. No output written to libmozjs185.so 
+gmake[3]: *** [libmozjs185.so] Error 1 
+gmake[3]: Leaving directory 
+`/home/maciej/src/opencsw/pkg/spidermonkey/trunk/work/solaris10-sparc/build-isa-sparcv8plus/js-1.8.5/js/objdir' 
+
+The workaround is to remove the "-Wl,-soname,libmozjs185.so.1.0" bit, since 
+the soname is already defined by -Wl,-h,libmozjs185.so. 
+
+After removing the "-Wl,-soname,libmozjs185.so.1.0" options, linking 
+succeeds and the library is there: 
+
+/usr/ccs/bin/dump -Lv libmozjs185.so | grep SONAME 
+[11]    SONAME          libmozjs185.so 
+
+Perhaps the "-Wl,-soname,libmozjs185.so.1.0" flag needs to be only added 
+conditionally, when using GNU ld. Also, the soname passed by the -h flag is 
+out of sync with the one passed by -Wl 
+
+---
+ js/src/Makefile.in           |    2 ++
+ js/src/config/autoconf.mk.in |    1 +
+ js/src/configure.in          |    1 +
+ 3 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/js/src/Makefile.in b/js/src/Makefile.in
+index a85e055..2ca1ebe 100644
+--- a/js/src/Makefile.in
++++ b/js/src/Makefile.in
+@@ -871,9 +871,11 @@ else
+ SHLIB_ANY_VER   := $(DESTDIR)$(libdir)/$(SHARED_LIBRARY)
+ SHLIB_ABI_VER   := $(DESTDIR)$(libdir)/$(SHARED_LIBRARY).$(SRCREL_ABI_VERSION)
+ SHLIB_EXACT_VER := $(DESTDIR)$(libdir)/$(SHARED_LIBRARY).$(SRCREL_VERSION)
++ifeq (1,$(GCC_USE_GNU_LD))
+ $(SHARED_LIBRARY): EXTRA_DSO_LDOPTS += -Wl,-soname,$(notdir $(SHLIB_ABI_VER))
+ endif
+ endif
++endif
+ 
+ install:: $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY)
+ ifneq (,$(LIBRARY))
+diff --git a/js/src/config/autoconf.mk.in b/js/src/config/autoconf.mk.in
+index f4c8150..9ecccf6 100644
+--- a/js/src/config/autoconf.mk.in
++++ b/js/src/config/autoconf.mk.in
+@@ -202,6 +202,7 @@ CXX_VERSION	= @CXX_VERSION@
+ 
+ GNU_AS		= @GNU_AS@
+ GNU_LD		= @GNU_LD@
++GCC_USE_GNU_LD  = @GCC_USE_GNU_LD@
+ GNU_CC		= @GNU_CC@
+ GNU_CXX		= @GNU_CXX@
+ HAVE_GCC3_ABI	= @HAVE_GCC3_ABI@
+diff --git a/js/src/configure.in b/js/src/configure.in
+index 5d5365b..a96b2ff 100644
+--- a/js/src/configure.in
++++ b/js/src/configure.in
+@@ -549,6 +549,7 @@ fi
+ if test "$GNU_CC"; then
+     if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
+         GCC_USE_GNU_LD=1
++        AC_SUBST(GCC_USE_GNU_LD)
+     fi
+ fi
+ 
+-- 
+1.7.9
+

Added: csw/mgar/pkg/spidermonkey/trunk/files/0002-Do-not-use-fpclassify-on-Solaris.patch
===================================================================
--- csw/mgar/pkg/spidermonkey/trunk/files/0002-Do-not-use-fpclassify-on-Solaris.patch	                        (rev 0)
+++ csw/mgar/pkg/spidermonkey/trunk/files/0002-Do-not-use-fpclassify-on-Solaris.patch	2012-03-10 09:55:57 UTC (rev 17349)
@@ -0,0 +1,84 @@
+From 6970ef60a3217ef5d3af9aa9af6dcd258f63a563 Mon Sep 17 00:00:00 2001
+From: Maciej Blizinski <maciej at opencsw.org>
+Date: Sat, 10 Mar 2012 10:29:42 +0100
+Subject: [PATCH 2/2] Do not use fpclassify on Solaris
+
+This one comes up when building with GCC 4.6.2 on Solaris 10:
+
+/opt/csw/bin/g++ -o conversions.o -c   -DOSTYPE=\"SunOS5\" -DOSARCH=SunOS
+-DEXPORT_JS_API -D__STDC_LIMIT_MACROS  -I../src -I. -I./dist/include
+-I./dist/include/nsprpub  -I/opt/csw/include/nspr   -I../src
+-I../src/assembler -I../src/yarr  -fPIC  -fno-rtti -fno-exceptions
+-fshort-enums -DJS_C_STRINGS_ARE_UTF8 -fno-strict-aliasing -pthread
+ -DNDEBUG -DTRIMMED -O3 -fstrict-aliasing -fomit-frame-pointer -mcpu=v9
+-DUSE_SYSTEM_MALLOC=1 -DENABLE_ASSEMBLER=1 -DENABLE_JIT=1
+-DMOZILLA_CLIENT -include ./js-confdefs.h -MD -MF .deps/conversions.pp
+../src/v8-dtoa/conversions.cc
+In file included from ../src/v8-dtoa/v8.h:47:0,
+                 from ../src/v8-dtoa/conversions.cc:30:
+../src/v8-dtoa/platform.h:70:5: error: expected unqualified-id before
+'__extension__'
+gmake[3]: *** [conversions.o] Error 1
+
+I looked up this file: js/src/v8-dtoa/platform.h:70
+
+And saw:
+
+  #ifdef SOLARIS
+  int fpclassify(double x);
+  #endif // SOLARIS
+
+This looks innocent enough. But there's nothing about __extension__. So I
+ran it through the preprocessor and saw what it expands to:
+
+  # 70 "../src/v8-dtoa/platform.h"
+int __extension__( { __typeof(double x) __x_c = (double x);
+__builtin_isnan(__x_c) ? 4 : __builtin_isinf(__x_c) ? 3 : __extension__( {
+__typeof(__x_c) __x_r = (__x_c); __extension__( { __typeof(__x_r) __x_f =
+(__x_r); !__builtin_isnan(__x_f) && !__builtin_isinf(__x_f); }) && (sizeof
+(__x_r) == sizeof (float) ? __builtin_fabsf(__x_r) >=
+1.17549435082228750796873653722224568e-38F : sizeof (__x_r) == sizeof
+(double) ? __builtin_fabs(__x_r) >=
+double(2.22507385850720138309023271733240406e-308L) :
+__builtin_fabsl(__x_r) >= 3.36210314311209350626267781732175260e-4932L); })
+? 2 : __x_c == (__typeof(__x_c)) 0 ? 0 : 1; });
+
+This is rather scary. Also, seems like this bit of code is activated
+specifically on Solaris. There is a similar ifdef in the platform.cc file.
+I changed both "#ifdef SOLARIS" lines into "#ifdef
+DO_NOT_TREAT_SOLARIS_DIFFERENTLY" and this made the compilation pass in
+these files.
+---
+ js/src/v8-dtoa/platform.cc |    2 +-
+ js/src/v8-dtoa/platform.h  |    2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/js/src/v8-dtoa/platform.cc b/js/src/v8-dtoa/platform.cc
+index 97ec6b9..6af17af 100644
+--- a/js/src/v8-dtoa/platform.cc
++++ b/js/src/v8-dtoa/platform.cc
+@@ -110,7 +110,7 @@ int fpclassify(double x) {
+ 
+ #endif  // _MSC_VER
+ 
+-#ifdef SOLARIS
++#ifdef DO_NOT_TREAT_SOLARIS_DIFFERENTLY
+ 
+ #include <ieeefp.h>
+ 
+diff --git a/js/src/v8-dtoa/platform.h b/js/src/v8-dtoa/platform.h
+index 047f75a..69ace08 100644
+--- a/js/src/v8-dtoa/platform.h
++++ b/js/src/v8-dtoa/platform.h
+@@ -66,7 +66,7 @@ int strncasecmp(const char* s1, const char* s2, int n);
+ 
+ #endif  // WIN32
+ 
+-#ifdef SOLARIS
++#ifdef DO_NOT_TREAT_SOLARIS_DIFFERENTLY
+ int fpclassify(double x);
+ #endif // SOLARIS
+ 
+-- 
+1.7.9
+

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list