Hi Jason - Glad you are interested in v8 for mips. I heard of someone a few months back getting node & v8 running on a mips board. Hopefully we can get you going.
Late this afternoon I got ahold of a YeeLoong Lemote laptop. It has the default linux on it, which is not Debian. (this linux does not have dev tools installed, and I don't have root pw yet). Can you share with me where you got the debian distro, and any special instructions I need to get it installed? I'd like to duplicate your setup. This laptop looks like it is using standard mips32 binaries (judging by readelf output) so maybe we are in luck. It is possible that there could be ABI issues (there is more than one ABI in use for mips, we use o32 for v8 now. An ABI change would require some work within the v8 mips port.) When I pull the latest code from Google's svn repo, it builds fine. However, I did have a bug creep in, so it does not run properly on mips hardware. Sadly I don't have a nightly builder on the Google repo; I hope to remedy that soon. And I'll get this bug fixed asap. However, you can pull from our repo, as Vyacheslav noted: https://github.com/paul99/v8m-rb. The 'crankshaft' branch is the latest code with the optimizing compiler. The 'bleeding_edge' branch is current but does not contain the crankshaft compiler. Of course, I suggest you use crankshaft. Our code (from these two branches) should always build and run fine. The Google repo is sometimes broken for mips code, as they make changes, and it takes us a day or two to submit corresponding changes for mips So please give the code from our repo a try. However, since you have build issues that I do not see, I suspect there is something else wrong. Please send me your scons output while compiling, and send me the version of your toolchain. Here is mine, for a native build on debian mips, on a mips 74K core: g++ -o obj/release/mips/stub-cache-mips.o -c -fno-rtti -fno-exceptions -fvisibility=hidden -Wall -Werror -W -Wno-unused-parameter -Wnon-virtual-dtor -pedantic -EL -mhard-float -mips32r2 -Wa,-mips32r2 -O3 -fomit-frame-pointer -fdata-sections -ffunction-sections -ansi -fno-strict-aliasing -D_MIPS_ARCH_MIPS32R2 -DV8_TARGET_ARCH_MIPS -DENABLE_DEBUGGER_SUPPORT -Isrc src/mips/stub-cache-mips.cc $ g++ --version g++-4.5.real (Debian 4.5.1-1) 4.5.1 Finally, the v8-dev list is not really the right place for these discussions. I'm happy to do private emails, or we can move this to v8-users. thanks, paul On Wed, Aug 31, 2011 at 6:49 AM, Vyacheslav Egorov <[email protected]>wrote: > Hi Jason, > > If you want us to merge your patches upstream please follow our > contribution guidelines: > > http://code.google.com/p/v8/wiki/Contributing > > Short summary: you have to sign CLA and you have to upload patches on > codereview.chromium.org with gcl (or git cl). > > https://github.com/paul99/v8m-rb is the repository used by the team > doing MIPS port. They are not part of V8 team but they are > contributing their code back to main V8 repo. Paul Lind (CCed) is > leading the effort. Our main repo AFAIK is still behind theirs in > terms of MIPS support (e.g. optimizing compiler is not yet merged). > > Regarding your crash: it happens in C++ code and there are no JS > frames on the stack so I would assume that your compiler (gcc) emitted > some instructions that are not supported by your CPU. > > Try disassembling instructions around the pc to see the illegal > instruction. > > -- > Vyacheslav Egorov > > > On Tue, Aug 30, 2011 at 9:08 PM, JasonWoof <[email protected]> wrote: > > Hi gang, > > > > V8 rocks! Thank you thank you! > > > > I've got a mips laptop, on which I'd really love to run node (which > > uses v8). > > > > I grabbed the latest v8 from the git mirror, and tried to compile the > > bleeding_edge branch (and trunk, which are almost the same at the > > moment) and the compile failed because of some warnings (as errors) > > about "set but unused" variables in the stubs. > > > > I set about commenting out those offending lines, to see if I could > > get the shell to compile. And it did compile. > > > > I'm not sure how much time I'll have over the next couple weeks to > > fiddle, and not sure the best way to proceed, so I thought I'd write > > to share my results, offer to help, and ask what I should do next. > > > > My ultimate goal is to have node in debian unstable for mipsel. I > > assume the first step to that is to get v8 to compile and run nicely > > on mips. > > > > The "warn on unused vars" flag has been there for a year, and the > > unused variable I looked up had been there for almost four months... > > So I'm guessing nobody's building on mips. Hopefully people are cross > > compiling or something. Would it be useful to anybody for me set > > something up on this laptop so it automatically/periodically pulls the > > latest git and tries to build it, then posts the build log and whatnot > > online somewhere? > > > > Next question: I see that Paul99 has a project on github called v8m- > > rb. https://github.com/paul99/v8m-rb Should I work with him/them > > rather than directly in this project? If so do they have their own > > mailing list or something? Or do they use this list? > > > > And another: Is the arch=mips an instruction set that should run on my > > computer? I've got a yeeloong lemote. I'm pretty sure it's got a 64- > > bit little endian mips chip. > > > > > > OK, now on to the details of what I did, patch, log and so on... > > > > I'm working from commit 2f937d148360bc (the latest bleeding_edge > > commit when I started yesterday) > > > > Here's the build command I've been using: scons arch=mips > > sample=shell > > > > Doesn't look like I can do attachments through this web interface, so > > I'm going to paste first my patch (which makes the above compile > > command work) and then a log of me running the resultant binary in > > gdb, so you can see the backtrace of it crashing (illegal instruction) > > with the --help flag, and then with the --shell flag. > > > > That's all for now. - Jason > > > > > > From d5ee722af272fce9d1d3c25e335ad0fba1a8266b Mon Sep 17 00:00:00 2001 > > From: Jason Woofenden <[email protected]> > > Date: Tue, 30 Aug 2011 00:20:21 -0400 > > Subject: [PATCH] comment out unused vars so it compiles on mips > > > > compiles on up-to-date debian unstable on my mips laptop (yeeloong > > lemote) with this command: > > > > scons arch=mips sample=shell > > --- > > src/mips/code-stubs-mips.cc | 6 +++--- > > src/mips/full-codegen-mips.cc | 6 +++--- > > src/mips/stub-cache-mips.cc | 2 +- > > 3 files changed, 7 insertions(+), 7 deletions(-) > > > > diff --git a/src/mips/code-stubs-mips.cc b/src/mips/code-stubs-mips.cc > > index 5f4c9b4..b897491 100644 > > --- a/src/mips/code-stubs-mips.cc > > +++ b/src/mips/code-stubs-mips.cc > > @@ -2543,7 +2543,7 @@ void BinaryOpStub::GenerateSmiCode( > > Register left = a1; > > Register right = a0; > > Register scratch1 = t3; > > - Register scratch2 = t5; > > + // unused: Register scratch2 = t5; > > > > // Perform combined smi check on both operands. > > __ Or(scratch1, left, Operand(right)); > > @@ -3253,7 +3253,7 @@ void > > TranscendentalCacheStub::Generate(MacroAssembler* masm) { > > > > Label no_update; > > Label skip_cache; > > - const Register heap_number_map = t2; > > + // unused: const Register heap_number_map = t2; > > > > // Call C function to calculate the result and update the cache. > > // Register a0 holds precalculated cache entry address; preserve > > @@ -3856,7 +3856,7 @@ void InstanceofStub::Generate(MacroAssembler* > > masm) { > > Register map = a3; // Map of the object. > > const Register function = a1; // Function (rhs). > > const Register prototype = t0; // Prototype of the function. > > - const Register inline_site = t5; > > + // unused: const Register inline_site = t5; > > const Register scratch = a2; > > > > Label slow, loop, is_instance, is_not_instance, not_js_object; > > diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen- > > mips.cc > > index 3c0c316..86bdda2 100644 > > --- a/src/mips/full-codegen-mips.cc > > +++ b/src/mips/full-codegen-mips.cc > > @@ -3326,7 +3326,7 @@ void > > FullCodeGenerator::EmitFastAsciiArrayJoin(ZoneList<Expression*>* args) > > { > > Register scratch1 = t3; > > Register scratch2 = t5; > > Register scratch3 = t4; > > - Register scratch4 = v1; > > + // unused: Register scratch4 = v1; > > > > // Separator operand is on the stack. > > __ pop(separator); > > @@ -4049,10 +4049,10 @@ void > > FullCodeGenerator::VisitCompareOperation(CompareOperation* expr) { > > default: { > > VisitForAccumulatorValue(expr->right()); > > Condition cc = eq; > > - bool strict = false; > > + // unused: bool strict = false; > > switch (op) { > > case Token::EQ_STRICT: > > - strict = true; > > + // unused: strict = true; > > // Fall through. > > case Token::EQ: > > cc = eq; > > diff --git a/src/mips/stub-cache-mips.cc b/src/mips/stub-cache-mips.cc > > index c17a658..e02c072 100644 > > --- a/src/mips/stub-cache-mips.cc > > +++ b/src/mips/stub-cache-mips.cc > > @@ -1203,7 +1203,7 @@ void > > StubCompiler::GenerateLoadConstant(JSObject* object, > > __ JumpIfSmi(receiver, miss, scratch1); > > > > // Check that the maps haven't changed. > > - Register reg = > > + // unused: Register reg = > > CheckPrototypes(object, receiver, holder, > > scratch1, scratch2, scratch3, name, miss); > > > > -- > > 1.7.5.4 > > > > > > > > > > > > > > $ gdb ./shell > > GNU gdb (GDB) 7.3-debian > > Copyright (C) 2011 Free Software Foundation, Inc. > > License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/ > > gpl.html> > > This is free software: you are free to change and redistribute it. > > There is NO WARRANTY, to the extent permitted by law. Type "show > > copying" > > and "show warranty" for details. > > This GDB was configured as "mipsel-linux-gnu". > > For bug reporting instructions, please see: > > <http://www.gnu.org/software/gdb/bugs/>... > > Reading symbols from /home/jasonwoof/software/v8-mips-rb-git/ > > shell...done. > > (gdb) run --help > > Starting program: /home/jasonwoof/software/v8-mips-rb-git/shell --help > > [Thread debugging using libthread_db enabled] > > > > Program received signal SIGILL, Illegal instruction. > > 0x00600f90 in v8::internal::StringStream::Put(char) () > > (gdb) bt > > #0 0x00600f90 in v8::internal::StringStream::Put(char) () > > #1 0x00601a54 in > > v8::internal::StringStream::Add(v8::internal::Vector<char const>, > > v8::internal::Vector<v8::internal::FmtElm>) () > > #2 0x00601c2c in > > v8::internal::StringStream::Add(v8::internal::Vector<char const>, > > v8::internal::Vector<v8::internal::FmtElm>) () > > #3 0x00602114 in v8::internal::StringStream::Add(char const*, > > v8::internal::FmtElm) () > > #4 0x0045a50c in v8::internal::ToString(v8::internal::(anonymous > > namespace)::Flag*) () > > #5 0x0045adbc in v8::internal::FlagList::PrintHelp() () > > #6 0x0045b3cc in > > v8::internal::FlagList::SetFlagsFromCommandLine(int*, char**, bool) () > > #7 0x00400768 in main () > > (gdb) run --shell > > The program being debugged has been started already. > > Start it from the beginning? (y or n) Starting program: /home/ > > jasonwoof/software/v8-mips-rb-git/shell --shell > > [Thread debugging using libthread_db enabled] > > > > Program received signal SIGILL, Illegal instruction. > > 0x00593ef4 in v8::internal::OS::Ticks() () > > (gdb) bt > > #0 0x00593ef4 in v8::internal::OS::Ticks() () > > #1 0x00592968 in v8::internal::OS::Setup() () > > #2 0x0060fefc in v8::internal::V8::InitializeOncePerProcess() () > > #3 0x0060ffac in > > v8::internal::V8::Initialize(v8::internal::Deserializer*) () > > #4 0x00408db0 in > > v8::ObjectTemplate::New(v8::Handle<v8::FunctionTemplate>) () > > #5 0x00408f64 in v8::ObjectTemplate::New() () > > #6 0x00401d40 in CreateShellContext() () > > #7 0x0040078c in main () > > (gdb) quit > > A debugging session is active. > > > > Inferior 1 [process 15099] will be killed. > > > > Quit anyway? (y or n) > > > > -- > > v8-dev mailing list > > [email protected] > > http://groups.google.com/group/v8-dev > > > -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
