diff --git a/.mozjs17.metadata b/.mozjs17.metadata new file mode 100644 index 0000000..9638fb1 --- /dev/null +++ b/.mozjs17.metadata @@ -0,0 +1 @@ +7805174898c34e5d3c3b256117af9944ba825c89 SOURCES/mozjs17.0.0.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 0e7897f..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 - -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/js17-build-fixes.patch b/SOURCES/js17-build-fixes.patch new file mode 100644 index 0000000..4ef5123 --- /dev/null +++ b/SOURCES/js17-build-fixes.patch @@ -0,0 +1,38 @@ +From 0e27b45a3409e0a5c23e63af9e86048e1e7661da Mon Sep 17 00:00:00 2001 +From: Colin Walters +Date: Wed, 18 Jan 2012 22:25:47 -0500 +Subject: [PATCH] build: Add toplevel trampoline configure/Makefile + +These just invoke the ones in js/src. +--- + Makefile | 5 +++++ + configure | 5 +++++ + 2 files changed, 10 insertions(+), 0 deletions(-) + create mode 100644 Makefile + create mode 100755 configure + +diff --git a/Makefile b/Makefile +new file mode 100644 +index 0000000..98de844 +--- /dev/null ++++ b/Makefile +@@ -0,0 +1,5 @@ ++all: ++ cd js/src && $(MAKE) ++ ++install: ++ cd js/src && $(MAKE) install DESTDIR=$(DESTDIR) +diff --git a/configure b/configure +new file mode 100755 +index 0000000..93ef339 +--- /dev/null ++++ b/configure +@@ -0,0 +1,5 @@ ++#!/bin/sh ++# http://people.gnome.org/~walters/docs/build-api.txt ++echo \#buildapi-variable-no-builddir >/dev/null ++cd js/src ++exec ./configure "$@" +-- +1.7.1 + diff --git a/SOURCES/js17-jsval.patch b/SOURCES/js17-jsval.patch new file mode 100644 index 0000000..149ea86 --- /dev/null +++ b/SOURCES/js17-jsval.patch @@ -0,0 +1,11 @@ +diff -up mozjs17.0.0/js/src/jsval.h.jsval mozjs17.0.0/js/src/jsval.h +--- mozjs17.0.0/js/src/jsval.h.jsval 2013-05-17 16:31:03.000000000 +0200 ++++ mozjs17.0.0/js/src/jsval.h 2013-05-17 16:31:13.000000000 +0200 +@@ -304,7 +304,6 @@ typedef union jsval_layout + int32_t i32; + uint32_t u32; + JSWhyMagic why; +- jsuword word; + } payload; + } s; + double asDouble; diff --git a/SOURCES/mozbug746112-no-decommit-on-large-pages.patch b/SOURCES/mozbug746112-no-decommit-on-large-pages.patch new file mode 100644 index 0000000..0e859d8 --- /dev/null +++ b/SOURCES/mozbug746112-no-decommit-on-large-pages.patch @@ -0,0 +1,98 @@ +# See https://bugzilla.redhat.com/show_bug.cgi?id=971519 +# HG changeset patch +# User Terrence Cole +# Date 1346874025 25200 +# Node ID 0558ede9693e57663e4836c7e678b55465ddc2ab +# Parent d28e07f4bec6c16b32ae4743eaeeae2a9e2f6381 +Bug 746112 - Don't decommit if page size is too large; r=billm + +The powerpc architecture has 64KiB pages, which is too large to represent in the +free list. This patch splits the page size from the arena size and disabled +decommit logic in that case. + +diff -up xulrunner-17.0/mozilla-beta/js/src/gc/Heap.h.746112 xulrunner-17.0/mozilla-beta/js/src/gc/Heap.h +--- a/js/src/gc/Heap.h.746112 2012-10-17 16:32:43.000000000 +0200 ++++ b/js/src/gc/Heap.h 2012-10-24 14:48:12.186640489 +0200 +@@ -103,26 +103,31 @@ struct Cell + }; + + /* +- * Page size is 4096 by default, except for SPARC, where it is 8192. ++ * Page size must be static to support our arena pointer optimizations, so we ++ * are forced to support each platform with non-4096 pages as a special case. ++ * Note: The freelist supports a maximum arena shift of 15. + * Note: Do not use JS_CPU_SPARC here, this header is used outside JS. + * Bug 692267: Move page size definition to gc/Memory.h and include it + * directly once jsgc.h is no longer an installed header. + */ + #if defined(SOLARIS) && (defined(__sparc) || defined(__sparcv9)) + const size_t PageShift = 13; ++const size_t ArenaShift = PageShift; ++#elif defined(__powerpc__) ++const size_t PageShift = 16; ++const size_t ArenaShift = 12; + #else + const size_t PageShift = 12; ++const size_t ArenaShift = PageShift; + #endif + const size_t PageSize = size_t(1) << PageShift; ++const size_t ArenaSize = size_t(1) << ArenaShift; ++const size_t ArenaMask = ArenaSize - 1; + + const size_t ChunkShift = 20; + const size_t ChunkSize = size_t(1) << ChunkShift; + const size_t ChunkMask = ChunkSize - 1; + +-const size_t ArenaShift = PageShift; +-const size_t ArenaSize = PageSize; +-const size_t ArenaMask = ArenaSize - 1; +- + /* + * This is the maximum number of arenas we allow in the FreeCommitted state + * before we trigger a GC_SHRINK to release free arenas to the OS. +diff -up xulrunner-17.0/mozilla-beta/js/src/jsgc.cpp.746112 xulrunner-17.0/mozilla-beta/js/src/jsgc.cpp +--- a/js/src/jsgc.cpp.746112 2012-10-17 16:32:44.000000000 +0200 ++++ b/js/src/jsgc.cpp 2012-10-24 14:46:28.253638095 +0200 +@@ -251,6 +251,13 @@ static const int BackgroundPhaseLength[] + sizeof(BackgroundPhaseStrings) / sizeof(AllocKind) + }; + ++/* Unused memory decommiting requires the arena size match the page size. */ ++static bool ++DecommitEnabled() ++{ ++ return PageSize == ArenaSize; ++} ++ + #ifdef DEBUG + void + ArenaHeader::checkSynchronizedWithFreeList() const +@@ -742,7 +749,8 @@ Chunk::fetchNextDecommittedArena() + decommittedArenas.unset(offset); + + Arena *arena = &arenas[offset]; +- MarkPagesInUse(arena, ArenaSize); ++ if (DecommitEnabled()) ++ MarkPagesInUse(arena, ArenaSize); + arena->aheader.setAsNotAllocated(); + + return &arena->aheader; +@@ -2731,7 +2739,7 @@ DecommitArenasFromAvailableList(JSRuntim + chunk->removeFromAvailableList(); + + size_t arenaIndex = Chunk::arenaIndex(aheader->arenaAddress()); +- bool ok; ++ bool ok = true; + { + /* + * If the main thread waits for the decommit to finish, skip +@@ -2741,7 +2749,8 @@ DecommitArenasFromAvailableList(JSRuntim + Maybe maybeUnlock; + if (!rt->isHeapBusy()) + maybeUnlock.construct(rt); +- ok = MarkPagesUnused(aheader->getArena(), ArenaSize); ++ if (DecommitEnabled()) ++ ok = MarkPagesUnused(aheader->getArena(), ArenaSize); + } + + if (ok) { diff --git a/SPECS/mozjs17.spec b/SPECS/mozjs17.spec new file mode 100644 index 0000000..0534057 --- /dev/null +++ b/SPECS/mozjs17.spec @@ -0,0 +1,105 @@ +Summary: JavaScript interpreter and libraries +Name: mozjs17 +Version: 17.0.0 +Release: 7%{?dist} +License: GPLv2+ or LGPLv2+ or MPLv1.1 +Group: Development/Languages +URL: http://www.mozilla.org/js/ +Source0: http://ftp.mozilla.org/pub/mozilla.org/js/mozjs%{version}.tar.gz +BuildRequires: pkgconfig(nspr) +BuildRequires: readline-devel +BuildRequires: /usr/bin/zip +BuildRequires: /usr/bin/python +BuildRequires: /usr/bin/autoconf-2.13 + +Patch0: js17-build-fixes.patch +# makes mozjs to match js from xul 21 +Patch1: js17-jsval.patch +Patch2: mozbug746112-no-decommit-on-large-pages.patch + +%description +JavaScript is the Netscape-developed object scripting language used in millions +of web pages and server applications worldwide. Netscape's JavaScript is a +superset of the ECMA-262 Edition 3 (ECMAScript) standard scripting language, +with only mild differences from the published standard. + +%package devel +Summary: Header files, libraries and development documentation for %{name} +Group: Development/Libraries +Requires: %{name} = %{version}-%{release} + +%description devel +This package contains the header files, static libraries and development +documentation for %{name}. If you like to develop programs using %{name}, +you will need to install %{name}-devel. + +%prep +%setup -q -n mozjs%{version} +# Delete bundled sources +rm js/src/editline -rf +rm js/src/ctypes/libffi -rf +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +chmod a+x configure +(cd js/src && autoconf-2.13) + +%build +%configure --disable-static --with-system-nspr --enable-threadsafe --enable-readline +make %{?_smp_mflags} + +%check +cat > js/src/config/find_vanilla_new_calls << EOF +#!/bin/bash +exit 0 +EOF +make -C js/src check + +%install +make install DESTDIR=%{buildroot} +# For some reason the headers and pkg-config file are executable +find %{buildroot}%{_includedir} -type f -exec chmod a-x {} \; +chmod a-x %{buildroot}%{_libdir}/pkgconfig/*.pc +# Upstream does not honor --disable-static yet +rm -f %{buildroot}%{_libdir}/*.a +# This is also statically linked; once that is fixed that we could +# consider shipping it. +rm -f %{buildroot}%{_bindir}/js17 + +# However, delete js-config since everything should use +# the pkg-config file. +rm -f %{buildroot}%{_bindir}/js17-config + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%doc LICENSE README +%{_libdir}/*.so + +%files devel +%{_libdir}/pkgconfig/*.pc +%{_includedir}/js-17.0 + +%changelog +* Mon Jun 17 2013 Dennis Gilmore 17.0.0-7 +- disable failing find_vanilla_new_calls test + +* Fri Jun 07 2013 Colin Walters 17.0.0-6 +- Add patch for ppc/ppc64: https://bugzilla.redhat.com/show_bug.cgi?id=971519 + +* Fri Jun 07 2013 Colin Walters 17.0.0-5 +- Enable check: https://bugzilla.redhat.com/show_bug.cgi?id=971519 + +* Fri May 17 2013 Dan HorĂ¡k - 17.0.0-4 +- fix build on 64-bit big-endians + +* Mon Apr 15 2013 Colin Walters 17.0.0-3 +- Delete js17, it is not used + +* Sun Apr 14 2013 Peter Robinson 17.0.0-2 +- Add disttag + +* Mon Apr 01 2013 Colin Walters - 17.0.0-1 +- Spec file inherited from js.spec