Skip to content

Commit 8f5916f

Browse files
author
Samuel Groß
committed
Updated JSC and Spidermonkey patches and buildfiles
1 parent 1ff8d38 commit 8f5916f

File tree

8 files changed

+27
-34
lines changed

8 files changed

+27
-34
lines changed

Cloud/Docker/JSCBuilder/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ENV DEBIAN_FRONTEND=noninteractive
44
ENV SHELL=bash
55

66
RUN apt-get -y update && apt-get -y upgrade
7-
RUN apt-get install -y git cmake clang ruby libicu-dev
7+
RUN apt-get install -y git cmake clang-10 ruby libicu-dev
88

99
RUN useradd -m builder
1010

Cloud/Docker/SpidermonkeyBuilder/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ENV DEBIAN_FRONTEND=noninteractive
44
ENV SHELL=bash
55

66
RUN apt-get -y update && apt-get -y upgrade
7-
RUN apt-get install -y git python3 python3-virtualenv clang
7+
RUN apt-get install -y git python3 python3-virtualenv clang-10
88

99
RUN useradd -m builder
1010

Targets/JavaScriptCore/Patches/webkit.patch

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git a/Source/JavaScriptCore/jsc.cpp b/Source/JavaScriptCore/jsc.cpp
2-
index 4eb5f412e2ea..cb4596aa521e 100644
2+
index 2e0d0a30df5f..36cc3b7457f9 100644
33
--- a/Source/JavaScriptCore/jsc.cpp
44
+++ b/Source/JavaScriptCore/jsc.cpp
55
@@ -150,7 +150,96 @@ struct MemoryFootprint {
@@ -134,7 +134,7 @@ index 4eb5f412e2ea..cb4596aa521e 100644
134134
addFunction(vm, "setUnhandledRejectionCallback", functionSetUnhandledRejectionCallback, 1);
135135

136136
addFunction(vm, "asDoubleNumber", functionAsDoubleNumber, 1);
137-
@@ -1248,6 +1342,54 @@ fail:
137+
@@ -1195,6 +1289,54 @@ fail:
138138

139139
EncodedJSValue JSC_HOST_CALL functionPrintStdOut(JSGlobalObject* globalObject, CallFrame* callFrame) { return printInternal(globalObject, callFrame, stdout); }
140140
EncodedJSValue JSC_HOST_CALL functionPrintStdErr(JSGlobalObject* globalObject, CallFrame* callFrame) { return printInternal(globalObject, callFrame, stderr); }
@@ -189,7 +189,7 @@ index 4eb5f412e2ea..cb4596aa521e 100644
189189

190190
EncodedJSValue JSC_HOST_CALL functionDebug(JSGlobalObject* globalObject, CallFrame* callFrame)
191191
{
192-
@@ -2786,7 +2928,15 @@ static void runWithOptions(GlobalObject* globalObject, CommandLine& options, boo
192+
@@ -2758,7 +2900,15 @@ static void runWithOptions(GlobalObject* globalObject, CommandLine& options, boo
193193
for (size_t i = 0; i < scripts.size(); i++) {
194194
JSInternalPromise* promise = nullptr;
195195
bool isModule = options.m_module || scripts[i].scriptType == Script::ScriptType::Module;
@@ -206,15 +206,15 @@ index 4eb5f412e2ea..cb4596aa521e 100644
206206
fileName = scripts[i].argument;
207207
if (scripts[i].strictMode == Script::StrictMode::Strict)
208208
scriptBuffer.append("\"use strict\";\n", strlen("\"use strict\";\n"));
209-
@@ -2935,6 +3085,7 @@ static NO_RETURN void printUsageStatement(bool help = false)
209+
@@ -2910,6 +3060,7 @@ static NO_RETURN void printUsageStatement(bool help = false)
210210
fprintf(stderr, " -f Specifies a source file (deprecated)\n");
211211
fprintf(stderr, " -h|--help Prints this help message\n");
212212
fprintf(stderr, " -i Enables interactive mode (default if no files are specified)\n");
213213
+ fprintf(stderr, " --reprl Enables REPRL mode (used by the Fuzzilli fuzzer)\n");
214214
fprintf(stderr, " -m Execute as a module\n");
215215
#if OS(UNIX)
216216
fprintf(stderr, " -s Installs signal handlers that exit on a crash (Unix platforms only, lldb will not work with this option) \n");
217-
@@ -3013,6 +3164,11 @@ void CommandLine::parseArguments(int argc, char** argv)
217+
@@ -2988,6 +3139,11 @@ void CommandLine::parseArguments(int argc, char** argv)
218218
m_interactive = true;
219219
continue;
220220
}
@@ -226,7 +226,7 @@ index 4eb5f412e2ea..cb4596aa521e 100644
226226
if (!strcmp(arg, "-d")) {
227227
m_dump = true;
228228
continue;
229-
@@ -3187,7 +3343,37 @@ int runJSC(const CommandLine& options, bool isWorker, const Func& func)
229+
@@ -3162,7 +3318,37 @@ int runJSC(const CommandLine& options, bool isWorker, const Func& func)
230230
#endif
231231

232232
int result;
@@ -265,7 +265,7 @@ index 4eb5f412e2ea..cb4596aa521e 100644
265265
GlobalObject* globalObject = nullptr;
266266
{
267267
JSLockHolder locker(vm);
268-
@@ -3204,68 +3390,27 @@ int runJSC(const CommandLine& options, bool isWorker, const Func& func)
268+
@@ -3179,68 +3365,27 @@ int runJSC(const CommandLine& options, bool isWorker, const Func& func)
269269
vm.promiseTimer->runRunLoop();
270270
{
271271
JSLockHolder locker(vm);

Targets/JavaScriptCore/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
899e17cffc860913dde04063bfadc3cbc1fbc535
1+
0bd996a2c1f84c40a4d8b07d396f9d90ef7f8cbd

Targets/JavaScriptCore/fuzzbuild.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ export WEBKIT_OUTPUTDIR=FuzzBuild
1919
if [ "$(uname)" == "Darwin" ]; then
2020
./Tools/Scripts/build-jsc --jsc-only --debug --cmakeargs="-DENABLE_STATIC_JSC=ON -DCMAKE_CXX_FLAGS='-fsanitize-coverage=trace-pc-guard -O3'"
2121
elif [ "$(uname)" == "Linux" ]; then
22-
# Note: requires clang >= 4.0!
23-
./Tools/Scripts/build-jsc --jsc-only --debug --cmakeargs="-DENABLE_STATIC_JSC=ON -DCMAKE_C_COMPILER='/usr/bin/clang' -DCMAKE_CXX_COMPILER='/usr/bin/clang++' -DCMAKE_CXX_FLAGS='-fsanitize-coverage=trace-pc-guard -O3 -lrt'"
22+
./Tools/Scripts/build-jsc --jsc-only --debug --cmakeargs="-DENABLE_STATIC_JSC=ON -DCMAKE_C_COMPILER='/usr/bin/clang-10' -DCMAKE_CXX_COMPILER='/usr/bin/clang++-10' -DCMAKE_CXX_FLAGS='-fsanitize-coverage=trace-pc-guard -O3 -lrt'"
2423
else
2524
echo "Unsupported operating system"
2625
fi

Targets/Spidermonkey/Patches/firefox.patch

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp
2-
index ce0509b313ab..cc8388155285 100644
2+
index 24b2d7c44886..0594197a17bd 100644
33
--- a/js/src/shell/js.cpp
44
+++ b/js/src/shell/js.cpp
5-
@@ -185,6 +185,89 @@ using mozilla::TimeStamp;
5+
@@ -184,6 +184,89 @@ using mozilla::TimeStamp;
66
using mozilla::Utf8Unit;
77
using mozilla::Variant;
88

@@ -92,7 +92,7 @@ index ce0509b313ab..cc8388155285 100644
9292
enum JSShellExitCode {
9393
EXITCODE_RUNTIME_ERROR = 3,
9494
EXITCODE_FILE_NOT_FOUND = 4,
95-
@@ -3727,6 +3810,64 @@ static bool Intern(JSContext* cx, unsigned argc, Value* vp) {
95+
@@ -3685,6 +3768,64 @@ static bool Intern(JSContext* cx, unsigned argc, Value* vp) {
9696
return true;
9797
}
9898

@@ -157,7 +157,7 @@ index ce0509b313ab..cc8388155285 100644
157157
static bool Crash(JSContext* cx, unsigned argc, Value* vp) {
158158
CallArgs args = CallArgsFromVp(argc, vp);
159159
if (args.length() == 0) {
160-
@@ -9360,6 +9501,10 @@ JS_FN_HELP("parseBin", BinParse, 1, 0,
160+
@@ -8952,6 +9093,10 @@ JS_FN_HELP("rateMyCacheIR", RateMyCacheIR, 0, 0,
161161
" Returns the approximate processor time used by the process since an arbitrary epoch, in seconds.\n"
162162
" Only the difference between two calls to `cpuNow()` is meaningful."),
163163

@@ -168,9 +168,9 @@ index ce0509b313ab..cc8388155285 100644
168168
JS_FS_HELP_END
169169
};
170170
// clang-format on
171-
@@ -10336,6 +10481,57 @@ static MOZ_MUST_USE bool ProcessArgs(JSContext* cx, OptionParser* op) {
172-
}
173-
#endif // JS_BUILD_BINAST
171+
@@ -9914,6 +10059,57 @@ static MOZ_MUST_USE bool ProcessArgs(JSContext* cx, OptionParser* op) {
172+
MultiStringRange codeChunks = op->getMultiStringOption('e');
173+
MultiStringRange modulePaths = op->getMultiStringOption('m');
174174

175175
+ // Check for REPRL file source
176176
+ if (op->getBoolOption("reprl")) {
@@ -224,9 +224,9 @@ index ce0509b313ab..cc8388155285 100644
224224
+ }
225225
+
226226
if (filePaths.empty() && utf16FilePaths.empty() && codeChunks.empty() &&
227-
modulePaths.empty() && binASTPaths.empty() &&
228-
!op->getStringArg("script")) {
229-
@@ -11090,6 +11286,27 @@ static int Shell(JSContext* cx, OptionParser* op, char** envp) {
227+
modulePaths.empty() && !op->getStringArg("script")) {
228+
// Always use the interactive shell when -i is used. Without -i we let
229+
@@ -10653,6 +10849,27 @@ static int Shell(JSContext* cx, OptionParser* op, char** envp) {
230230
defaultToSameCompartment = false;
231231
}
232232

@@ -254,7 +254,7 @@ index ce0509b313ab..cc8388155285 100644
254254
JS::RealmOptions options;
255255
SetStandardRealmOptions(options);
256256
RootedObject glob(
257-
@@ -11107,7 +11324,8 @@ static int Shell(JSContext* cx, OptionParser* op, char** envp) {
257+
@@ -10670,7 +10887,8 @@ static int Shell(JSContext* cx, OptionParser* op, char** envp) {
258258
#endif
259259

260260
ShellContext* sc = GetShellContext(cx);
@@ -264,7 +264,7 @@ index ce0509b313ab..cc8388155285 100644
264264
{
265265
AutoReportException are(cx);
266266
if (!ProcessArgs(cx, op) && !sc->quitting) {
267-
@@ -11135,6 +11353,18 @@ static int Shell(JSContext* cx, OptionParser* op, char** envp) {
267+
@@ -10698,6 +10916,18 @@ static int Shell(JSContext* cx, OptionParser* op, char** envp) {
268268
result = sc->exitCode;
269269
}
270270

@@ -283,7 +283,7 @@ index ce0509b313ab..cc8388155285 100644
283283
if (enableDisassemblyDumps) {
284284
AutoReportException are(cx);
285285
if (!js::DumpRealmPCCounts(cx)) {
286-
@@ -11579,7 +11809,9 @@ int main(int argc, char** argv, char** envp) {
286+
@@ -11150,7 +11380,9 @@ int main(int argc, char** argv, char** envp) {
287287
#endif
288288
!op.addBoolOption('\0', "wasm-compile-and-serialize",
289289
"Compile the wasm bytecode from stdin and serialize "

Targets/Spidermonkey/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9c0f970552f0053daa211a4a04cb2104e5ed39f1
1+
b0b9a514d92a9550966273df8fb487db922e7ae3

Targets/Spidermonkey/fuzzbuild.sh

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,9 @@ autoconf2.13
1818

1919
FLAGS="-fsanitize-coverage=trace-pc-guard -g -DJS_MORE_DETERMINISTIC"
2020

21-
export CFLAGS=$FLAGS
2221
export CXXFLAGS=$FLAGS
23-
export LDFLAGS=$FLAGS
24-
export MOZ_CARGO_WRAP_LDFLAGS=$FLAGS
25-
26-
export CC=clang
27-
export CXX=clang++
28-
29-
export MOZ_LLVM_HACKS=1
22+
export CC=clang-10
23+
export CXX=clang++-10
3024

3125
mkdir -p fuzzbuild_OPT.OBJ
3226
cd fuzzbuild_OPT.OBJ

0 commit comments

Comments
 (0)