RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: j...@rpm5.org Module: rpm Date: 06-Jul-2017 17:02:00 Branch: rpm-5_4 Handle: 2017070615015901 Added files: (Branch: rpm-5_4) rpm/js rpmjs45.cpp Modified files: (Branch: rpm-5_4) rpm/js .cvsignore Makefile.am extract.sh gen-config.sh Log: - rpmjs: revert to mozjs-45 for now. Summary: Revision Changes Path 1.4.4.2 +2 -0 rpm/js/.cvsignore 1.44.2.10 +40 -4 rpm/js/Makefile.am 1.1.2.4 +31 -68 rpm/js/extract.sh 1.1.2.2 +15 -1 rpm/js/gen-config.sh 1.1.2.1 +76 -0 rpm/js/rpmjs45.cpp ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/js/.cvsignore ============================================================================ $ cvs diff -u -r1.4.4.1 -r1.4.4.2 .cvsignore --- rpm/js/.cvsignore 5 Jul 2017 15:34:28 -0000 1.4.4.1 +++ rpm/js/.cvsignore 6 Jul 2017 15:01:59 -0000 1.4.4.2 @@ -16,3 +16,5 @@ include extract platform +rpmjs45 +rpmjs52 @@ . patch -p0 <<'@@ .' Index: rpm/js/Makefile.am ============================================================================ $ cvs diff -u -r1.44.2.9 -r1.44.2.10 Makefile.am --- rpm/js/Makefile.am 5 Jul 2017 20:23:26 -0000 1.44.2.9 +++ rpm/js/Makefile.am 6 Jul 2017 15:01:59 -0000 1.44.2.10 @@ -4,7 +4,10 @@ LINT = splint -EXTRA_DIST = +EXTRA_DIST = + rpmjs45.cpp \ + rpmjs52.cpp + # $(srcdir)/Makefile.* \ # $(srcdir)/*.[ch] \ # $(srcdir)/legacy.cudf \ @@ -80,9 +83,23 @@ rpmsx-js.c rpmsys-js.c rpmte-js.c rpmts-js.c rpmtxn-js.c rpmxar-js.c \ syck-js.c uuid-js.c -EXTRA_PROGRAMS = v8 +EXTRA_PROGRAMS = rpmjs45 rpmjs52 v8 noinst_PROGRAMS = tjs +rpmjs45_SOURCES = rpmjs45.cpp +rpmjs45_CPPFLAGS = -I./include -include js/RequiredDefines.h -fPIC -DRPMJSS_SELF_TEST +rpmjs45_LDADD = \ + -L${abs_top_builddir}/js/mozilla-release/js/src/dist/sdk/lib -lmozjs-45 -lmozglue -lmemory +rpmjs45_LDFLAGS = \ + -R${abs_top_builddir}/js/mozilla-release/js/src/dist/sdk/lib +#rpmjs45_CPPFLAGS = -include /usr/include/mozjs-45/js/RequiredDefines.h -I/usr/include/mozjs-45 -fPIC -DRPMJSS_SELF_TEST +#rpmjs45_LDADD = -L/usr/lib64 -lmozjs-45 + +rpmjs52_SOURCES = rpmjs52.cpp +#rpmjs52_CPPFLAGS = -I./include -include js/RequiredDefines.h -fPIC -DRPMJSS_SELF_TEST +rpmjs52_CPPFLAGS = -include /usr/include/mozjs-52/js/RequiredDefines.h -I/usr/include/mozjs-52 -fPIC -DRPMJSS_SELF_TEST +rpmjs52_LDADD = -L/usr/lib64 -lmozjs-52 mozilla-release/js/src/dist/sdk/lib/libmozglue.a + tjs_SOURCES = tjs.c tjs_LDADD = librpmjsm.la $(RPM_LDADD_COMMON) @@ -90,9 +107,28 @@ v8_CPPFLAGS = ${CPPFLAGS} -fPIC v8_LDFLAGS = -fsanitize=address -lv8 +#MOZJS_VERSION = 45.0esr +#MOZJS_VERSION = 45.0.1esr +#MOZJS_VERSION = 45.0.2esr +#MOZJS_VERSION = 45.1.0esr +#MOZJS_VERSION = 45.1.1esr +#MOZJS_VERSION = 45.2.0esr +#MOZJS_VERSION = 45.3.0esr #MOZJS_VERSION = 45.4.0esr -#MOZJS_VERSION = 45.9.0esr -MOZJS_VERSION = 52.2.1esr +#MOZJS_VERSION = 45.5.0esr +#MOZJS_VERSION = 45.5.1esr +#MOZJS_VERSION = 45.6.0esr +#MOZJS_VERSION = 45.7.0esr +#MOZJS_VERSION = 45.8.0esr +MOZJS_VERSION = 45.9.0esr +#MOZJS_VERSION = 52.1.0esr +#MOZJS_VERSION = 52.0esr +#MOZJS_VERSION = 52.0.1esr +#MOZJS_VERSION = 52.0.2esr +#MOZJS_VERSION = 52.1.1esr +#MOZJS_VERSION = 52.1.2esr +#MOZJS_VERSION = 52.2.0esr +#MOZJS_VERSION = 52.2.1esr MOZJS_TARBALL = firefox-${MOZJS_VERSION}.source.tar.xz MOZJS_URL = https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${MOZJS_VERSION}/source/${MOZJS_TARBALL} @@ . patch -p0 <<'@@ .' Index: rpm/js/extract.sh ============================================================================ $ cvs diff -u -r1.1.2.3 -r1.1.2.4 extract.sh --- rpm/js/extract.sh 5 Jul 2017 20:23:26 -0000 1.1.2.3 +++ rpm/js/extract.sh 6 Jul 2017 15:01:59 -0000 1.1.2.4 @@ -28,47 +28,40 @@ #PYTHON=python ./configure --without-intl-api --enable-posix-nspr-emulation PYTHON=python ./configure \ --host=x86_64-redhat-linux-gnu --target=x86_64-redhat-linux-gnu \ + --program-prefix= \ + --disable-dependency-tracking \ --prefix=/usr \ + --exec-prefix=/usr \ + --bindir=/usr/bin \ + --sbindir=/usr/sbin \ + --sysconfdir=/etc \ + --datadir=/usr/share \ + --includedir=/usr/include \ --libdir=/usr/lib64 \ + --libexecdir=/usr/libexec \ + --localstatedir=/var \ + --sharedstatedir=/var/lib \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ --enable-optimize \ --enable-pie \ --enable-posix-nspr-emulation \ --enable-readline \ --enable-release \ --enable-shared-js \ + --enable-system-ffi \ + --enable-xterm-updates \ --with-pthreads \ + --with-system-icu \ --with-system-zlib \ - --without-intl-api \ - --enable-gczeal - -# --enable-gczeal -# --enable-more-deterministic + --with-intl-api \ + --enable-gczeal \ + --enable-more-deterministic # --enable-ctypes # --enable-gc-trace # --enable-jitspew -# --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu -# --program-prefix= -# --disable-dependency-tracking -# --exec-prefix=/usr -# --bindir=/usr/bin -# --sbindir=/usr/sbin -# --sysconfdir=/etc -# --datadir=/usr/share -# --includedir=/usr/include -# --libexecdir=/usr/libexec -# --localstatedir=/var -# --sharedstatedir=/var/lib -# --mandir=/usr/share/man -# --infodir=/usr/share/info -# --enable-system-ffi -# --enable-xterm-updates -# --with-system-icu -# --with-intl-api -# --enable-gczeal -# --enable-more-deterministic - -#echo "CPPSRCS += \$(DEPTH)/mfbt/Unified_cpp_mfbt0.cpp \$(DEPTH)/../../mfbt/Compression.cpp \$(DEPTH)/../../mfbt/decimal/Decimal.cpp" >> js/src/backend.mk +echo "CPPSRCS += \$(DEPTH)/mfbt/Unified_cpp_mfbt0.cpp \$(DEPTH)/../../mfbt/Compression.cpp \$(DEPTH)/../../mfbt/decimal/Decimal.cpp" >> js/src/backend.mk #echo "STATIC_LIBS += \$(DEPTH)/mfbt/libmfbt.a" >> js/src/backend.mk # skipping icu and relying on posix nspr emulation all helps. After that we @@ -82,19 +75,12 @@ cp mozilla-release/js/src/js/src/jsautokw.h extract/js/src # mfbt doesn't change by arch or platform, so keep the same unified cpp -if [ -f mozilla-release/js/src/mfbt/Unified_cpp_mfbt0.cpp ]; then - mkdir -p extract/js/src/mfbt +mkdir extract/js/src/mfbt +cp mozilla-release/js/src/mfbt/Unified_cpp_mfbt0.cpp extract/js/src/mfbt - cp mozilla-release/js/src/mfbt/Unified_cpp_mfbt0.cpp extract/js/src/mfbt - sed 's/#include ".*\/mfbt\//#include "/' < extract/js/src/mfbt/Unified_cpp_mfbt0.cpp > t1 - sed 's/#error ".*\/mfbt\//#error "/' < t1 > extract/js/src/mfbt/Unified_cpp_mfbt0.cpp - rm t1 - - cp mozilla-release/js/src/mfbt/Unified_cpp_mfbt1.cpp extract/js/src/mfbt - sed 's/#include ".*\/mfbt\//#include "/' < extract/js/src/mfbt/Unified_cpp_mfbt1.cpp > t1 - sed 's/#error ".*\/mfbt\//#error "/' < t1 > extract/js/src/mfbt/Unified_cpp_mfbt1.cpp - rm t1 -fi +sed 's/#include ".*\/mfbt\//#include "/' < extract/js/src/mfbt/Unified_cpp_mfbt0.cpp > t1 +sed 's/#error ".*\/mfbt\//#error "/' < t1 > extract/js/src/mfbt/Unified_cpp_mfbt0.cpp +rm t1 # stuff we can toss rm -rf \ @@ -144,6 +130,8 @@ # this is all of the EXPORTS files from the moz.build's mkdir -p include +cp mozilla-release/js/src/js/src/js-config.h include + FILES=" js.msg jsalloc.h @@ -174,12 +162,8 @@ Conversions.h Date.h Debug.h - GCAnnotations.h GCAPI.h GCHashTable.h - GCPolicyAPI.h - GCVariant.h - GCVector.h HashTable.h HeapAPI.h Id.h @@ -190,12 +174,10 @@ ProfilingFrameIterator.h ProfilingStack.h Proxy.h - Realm.h RequiredDefines.h RootingAPI.h SliceBudget.h StructuredClone.h - SweepingAPI.h TraceKind.h TraceableVector.h TracingAPI.h @@ -204,10 +186,6 @@ UbiNode.h UbiNodeBreadthFirst.h UbiNodeCensus.h - UbiNodeDominatorTree.h - UbiNodePostOrder.h - UbiNodeShortestPaths.h - UniquePtr.h Utility.h Value.h Vector.h @@ -217,6 +195,7 @@ [ -f extract/js/public/$F ] && cp extract/js/public/$F include/js done + # this is all of the EXPORTS.mozilla files from the moz.build's mkdir -p include/mozilla FILES=" @@ -230,7 +209,6 @@ Attributes.h BinarySearch.h BloomFilter.h - BufferList.h Casting.h ChaosMode.h Char16.h @@ -238,21 +216,16 @@ Compiler.h Compression.h DebugOnly.h - decimal/Decimal.h double-conversion/double-conversion.h double-conversion/utils.h Endian.h - EndianUtils.h EnumeratedArray.h EnumeratedRange.h EnumSet.h - EnumTypeTraits.h FastBernoulliTrial.h FloatingPoint.h - Function.h GuardObjects.h HashFunctions.h - IndexSequence.h IntegerPrintfMacros.h IntegerRange.h IntegerTypeTraits.h @@ -260,6 +233,7 @@ Likely.h LinkedList.h LinuxSignal.h + WindowsVersion.h MacroArgs.h MacroForEach.h MathAlgorithms.h @@ -268,24 +242,19 @@ MemoryChecking.h MemoryReporting.h Move.h - NotNull.h NullPtr.h NumericLimits.h Opaque.h - OperatorNewExtensions.h Pair.h PodOperations.h Poison.h Range.h - RangedArray.h RangedPtr.h - ReentrancyGuard.h - RefCounted.h RefCountType.h + ReentrancyGuard.h RefPtr.h ReverseIterator.h RollingMean.h - Saturate.h Scoped.h ScopeExit.h SegmentedVector.h @@ -293,24 +262,18 @@ SizePrintfMacros.h Snprintf.h SplayTree.h - Sprintf.h - StaticAnalysisFunctions.h TaggedAnonymousMemory.h TemplateLib.h ThreadLocal.h ToString.h - Tuple.h TypedEnumBits.h Types.h TypeTraits.h UniquePtr.h - UniquePtrExtensions.h - unused.h - Unused.h Variant.h Vector.h WeakPtr.h - WindowsVersion.h + unused.h XorShift128PlusRNG.h " for F in $FILES; do @@ . patch -p0 <<'@@ .' Index: rpm/js/gen-config.sh ============================================================================ $ cvs diff -u -r1.1.2.1 -r1.1.2.2 gen-config.sh --- rpm/js/gen-config.sh 5 Jul 2017 15:34:28 -0000 1.1.2.1 +++ rpm/js/gen-config.sh 6 Jul 2017 15:02:00 -0000 1.1.2.2 @@ -12,7 +12,21 @@ cd mozilla-release/js/src -PYTHON=python ./configure --without-intl-api --enable-posix-nspr-emulation --disable-trace-logging +#PYTHON=python ./configure --without-intl-api --enable-posix-nspr-emulation --disable-trace-logging +PYTHON=python ./configure \ + --host=x86_64-redhat-linux-gnu --target=x86_64-redhat-linux-gnu \ + --prefix=/usr \ + --libdir=/usr/lib64 \ + --enable-optimize \ + --enable-pie \ + --enable-posix-nspr-emulation \ + --enable-readline \ + --enable-release \ + --enable-shared-js \ + --with-pthreads \ + --with-system-zlib \ + --without-intl-api \ + --enable-gczeal cd ../../.. @@ . patch -p0 <<'@@ .' Index: rpm/js/rpmjs45.cpp ============================================================================ $ cvs diff -u -r0 -r1.1.2.1 rpmjs45.cpp --- /dev/null 2017-07-06 17:01:52.000000000 +0200 +++ rpmjs45.cpp 2017-07-06 17:02:00.286503805 +0200 @@ -0,0 +1,76 @@ +// following code might be needed in some case +// #define __STDC_LIMIT_MACROS +// #include <stdint.h> + +#pragma GCC diagnostic ignored "-Winvalid-offsetof" + +#include "jsapi.h" +#include "js/Initialization.h" + +/* The class of the global object. */ +static JSClass global_class = { + "global", + JSCLASS_GLOBAL_FLAGS, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + JS_GlobalObjectTraceHook +}; + +int main(int argc, const char *argv[]) +{ + JS_Init(); + + JSRuntime *rt = JS_NewRuntime(8L * 1024 * 1024); + if (!rt) + return 1; + + JSContext *cx = JS_NewContext(rt, 8192); + if (!cx) + return 1; + + { // Scope for our various stack objects (JSAutoRequest, RootedObject), so they all go + // out of scope before we JS_DestroyContext. + + JSAutoRequest ar(cx); // In practice, you would want to exit this any + // time you're spinning the event loop + + JS::RootedObject global(cx, JS_NewGlobalObject(cx, &global_class, nullptr, JS::FireOnNewGlobalHook)); + if (!global) + return 1; + + JS::RootedValue rval(cx); + + { // Scope for JSAutoCompartment + JSAutoCompartment ac(cx, global); + JS_InitStandardClasses(cx, global); + + const char *script = "'hello'+'world, it is '+new Date()"; + const char *filename = "noname"; + int lineno = 1; + JS::CompileOptions opts(cx); + opts.setFileAndLine(filename, lineno); + bool ok = JS::Evaluate(cx, opts, script, strlen(script), &rval); + if (!ok) + return 1; + } + + JSString *str = rval.toString(); + char * t = JS_EncodeString(cx, str); + printf("%s\n", t); + free(t); + } + + JS_DestroyContext(cx); + JS_DestroyRuntime(rt); + JS_ShutDown(); + return 0; +} @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org