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

Reply via email to