Hi Yuan, there's a file called moz.build in the js/src directory that contains lists of compiled files. I should be largely self-explanatory how to add a new file to that.
Depending on how you've set things up, you might run into problems regardless. Is your randomization a one-time operation that happens during startup and then applies to all runtimes? If not, then you probably need to store the information on e.g. JSRuntime or in thread-local storage. Till On Tue, Mar 14, 2017 at 2:16 PM, Yuan Pinghai <pinghaiy...@gmail.com> wrote: > Hi, all > > For security research purposes, i want to apply the register allocation > randomization technique on spidermonkey, i.e. making spidermonkey's > baseline-compiler and ion-compiler to randomly select registers when > generating native code. I implement this idea by hooking the > Register::encoding() (located at the file jit/Registers.h:54) method. > Because I need to use some new global data, so I define and put them in a > new CPP file named Registers.cpp. Now, my problem is that I failed to > compile the changes with commands like "make -C build_DBG.OBJ" because the > Registers.cpp file could not be compiled. > > To solve this problem, I had run the "../configure --enable-debug" and even > created a clean directory for building. However, both failed. Then, I tried > to find a solution by digging into the Shell scripts and python scripts, > and got the knowledge that spidermonkey merges CPP files into Unified_CPP > files and then processes the compilation. However, i still didn't know how > to configure or feed these scripts. Now, my solution is manually add the > path of Registers.cpp into the file "Unified_cpp_js_src20.cpp". In this > way, i can successfully compile the changes. > > My questions is whether there is an elegant solution, could someone can > tell me? > > Thanks. > _______________________________________________ > dev-tech-js-engine-internals mailing list > dev-tech-js-engine-internals@lists.mozilla.org > https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals > _______________________________________________ dev-tech-js-engine-internals mailing list dev-tech-js-engine-internals@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals