Basic support for big-endian MIPS #19

Open
wants to merge 5 commits into
from

Conversation

Projects
None yet
@evgenybaskakov

Hi guys,

This is a basic suport for MIPS BE.

Currently, the mips32r1 soft-float nocrankshaft mode is only supported and tested good enough. In this mode, our big-endian MIPS board passes the cctest and mjsunit test packages, as well as the V8 benchmark v.7 and SunSpider v0.9.1.

The board has a half-way implemented FPU (that is, surprisingly, it lacks some of FPU instructions like mfc1/stc1), so we didn't get it fully working at the moment with V8, although you may notice some endian-related fixes in the hard FPU related branches of execution. These fixes are assumed to be correct.

--Evgeny

@petar-jovanovic

This comment has been minimized.

Show comment
Hide comment
@petar-jovanovic

petar-jovanovic Jul 28, 2012

Collaborator

Hello Evgeny,

thanks for bringing these patches to our attention.

What particular device is the main driver for the changes? I assume some set-top box with Linux OS.
What MIPS Big-Endian board are you using for which you need BE-version of v8?

Petar

Collaborator

petar-jovanovic commented Jul 28, 2012

Hello Evgeny,

thanks for bringing these patches to our attention.

What particular device is the main driver for the changes? I assume some set-top box with Linux OS.
What MIPS Big-Endian board are you using for which you need BE-version of v8?

Petar

@evgenybaskakov

This comment has been minimized.

Show comment
Hide comment
@evgenybaskakov

evgenybaskakov Jul 29, 2012

Hello Petar,

The target device is Cisco Explorer 8600HDC.

--Evgeny

Hello Petar,

The target device is Cisco Explorer 8600HDC.

--Evgeny

@paul99

This comment has been minimized.

Show comment
Hide comment
@paul99

paul99 Jul 30, 2012

Hi Evgeny -

This is nice work, thank-you. A lot of people have been interested in v8 big endian, but so far no one else has pulled it off.

I have a lot of questions and comments, in no particular order:

I presume that your intent is for you or us to merge this work to the official v8 repo at Google. If so, then you will need to sign the Google Contributor License Agreement, if you do not already have one. They need this for any work they accept, and since all our work is upstreamed to them, we need this to move forward as well. Here's a link: http://code.google.com/legal/individual-cla-v1.0.html

For now, I think we will not merge your change to the bleeding-edge branch on our repo, but we will create a new branch for the big-endian port. The reason is that our bleeding-edge is for staging work that we will upstream shortly. Besides the CLA I have some other issues that we should resolve before deciding how & when to upstream your work.

So currently, your port is soft-float, and therefore cannot use crankshaft. Do you have an interest in adding FPU support and Crankshaft support as well? Or is this version sufficient for your needs?

Are you aware of Big-endian hardware for mips that does include FPU? Do you have access to such boards? (a lot of the inexpensive EB devices that I'm aware of did not include FPU).

I should be able to find a board at the office tomorrow, and then be able to run your code. Can you provide any details need for the compilation, besides the gyp name 'mips'? Anything special in your toolchain setup?

I don't see where the BIG_ENDIAN_FLOATING_POINT is defined. Are you setting this thru your environment?

I also see '#elif __BYTE_ORDER == __BIG_ENDIAN' kind of defs. Maybe we should standardize on a single def? Or is there a reason to separate them?

I didn't look closely enough to understand: why are the atomic-ops endian dependent?

Can you try running the mozilla and test262 suites as well? They are also required to pass in order to submit.

Have you thought about snapshot support at all? Currently, that works either by full native compilation, or by cross-compilation on x86, and use of the simulator to build the snapshot. Since that won't work here, we will either need native-only builds, or a new 2-step approach to cross-compile, then build snapshot on target, then re-cross-compile with the included snapshot image.

I looked briefly at the data sheet for the Cisco 8600, but did not see a mention of the SoC vendor. Is this a Cisco chip, Broadcom, other? Please let us know (if you're able to disclose the info).

Sorry to slam you with all these questions. Once again, this is a very nice accomplishment, and I look forward to working with you to finish it up and submit.

thanks!

paul99 commented Jul 30, 2012

Hi Evgeny -

This is nice work, thank-you. A lot of people have been interested in v8 big endian, but so far no one else has pulled it off.

I have a lot of questions and comments, in no particular order:

I presume that your intent is for you or us to merge this work to the official v8 repo at Google. If so, then you will need to sign the Google Contributor License Agreement, if you do not already have one. They need this for any work they accept, and since all our work is upstreamed to them, we need this to move forward as well. Here's a link: http://code.google.com/legal/individual-cla-v1.0.html

For now, I think we will not merge your change to the bleeding-edge branch on our repo, but we will create a new branch for the big-endian port. The reason is that our bleeding-edge is for staging work that we will upstream shortly. Besides the CLA I have some other issues that we should resolve before deciding how & when to upstream your work.

So currently, your port is soft-float, and therefore cannot use crankshaft. Do you have an interest in adding FPU support and Crankshaft support as well? Or is this version sufficient for your needs?

Are you aware of Big-endian hardware for mips that does include FPU? Do you have access to such boards? (a lot of the inexpensive EB devices that I'm aware of did not include FPU).

I should be able to find a board at the office tomorrow, and then be able to run your code. Can you provide any details need for the compilation, besides the gyp name 'mips'? Anything special in your toolchain setup?

I don't see where the BIG_ENDIAN_FLOATING_POINT is defined. Are you setting this thru your environment?

I also see '#elif __BYTE_ORDER == __BIG_ENDIAN' kind of defs. Maybe we should standardize on a single def? Or is there a reason to separate them?

I didn't look closely enough to understand: why are the atomic-ops endian dependent?

Can you try running the mozilla and test262 suites as well? They are also required to pass in order to submit.

Have you thought about snapshot support at all? Currently, that works either by full native compilation, or by cross-compilation on x86, and use of the simulator to build the snapshot. Since that won't work here, we will either need native-only builds, or a new 2-step approach to cross-compile, then build snapshot on target, then re-cross-compile with the included snapshot image.

I looked briefly at the data sheet for the Cisco 8600, but did not see a mention of the SoC vendor. Is this a Cisco chip, Broadcom, other? Please let us know (if you're able to disclose the info).

Sorry to slam you with all these questions. Once again, this is a very nice accomplishment, and I look forward to working with you to finish it up and submit.

thanks!

@evgenybaskakov

This comment has been minimized.

Show comment
Hide comment
@evgenybaskakov

evgenybaskakov Jul 30, 2012

Hi Paul,

Thank you for the kind words :) Sure, I'm glad to answer any questions you have.

First of all, about the CLA. No, we didn't sign it yet, and I think I have to consult our legal dept. on this one, and I will get back with any news as soon as I get an answer from them.

Do you have an interest in adding FPU support and Crankshaft support as well? Or is this version sufficient for your needs?

Yes, we strive to enable FPU & Crankshaft. The problem is that the board has a weak FPU implementation, so it is not an easy thing to do. We are trying to find a way to do that, but currently we have to the use the soft-float mode.

Are you aware of Big-endian hardware for mips that does include FPU? Do you have access to such boards?

Unfortunately, the Cisco 8600 is the only piece of big-endian MIPS hardware we have in mind.

Can you provide any details need for the compilation, besides the gyp name 'mips'? Anything special in your toolchain setup?

There is nothing special in the build procedure, but you need to set the -Dmips_arch_variant=mips32r1 -Dv8_use_mips_abi_hardfloat=false -Dv8_can_use_fpu_instructions=false flags. Also, you need to define the BIG_ENDIAN_FLOATING_POINT. Yes, perhaps it is a good idea to put it in the gyp script for the 'mips' target.

I also see '#elif __BYTE_ORDER == __BIG_ENDIAN' kind of defs. Maybe we should standardize on a single def? Or is there a reason to separate them?

The __BYTE_ORDER is a compiler define, so there's no need to define it explicitly. BTW, both these defines are used in the original V8 code base. I guess the reason in separating them is that there is a possibility that some big-endian hardware might have a little-endian FPU conventions (or vice-versa).

I didn't look closely enough to understand: why are the atomic-ops endian dependent?

It's a good question. I think I just overlooked this one, and actually some other platform-specific #ifdef should be used here. The fact is, the Cisco 8600 doesn't have the ll/sc instructions. Instead, the lwc0/swc0 pair must be used.

I will fix this.

Can you try running the mozilla and test262 suites as well?

Sure, we will do it.

Have you thought about snapshot support at all?

Yes, we are going to enable shapshot support. But now, it is less important for us than the lack of FPU and Crankshaft, so I think we will enable the shapshot later, but currently it is not used in our builds.

I looked briefly at the data sheet for the Cisco 8600, but did not see a mention of the SoC vendor. Is this a Cisco chip, Broadcom, other? Please let us know (if you're able to disclose the info).

Frankly, we do not know for sure what chipset is in the box, as Cisco doesn't expose such info too much. It is almost definitely NOT Broadcom - this is all we know :)

Thank you again for your interest!

--Evgeny

Hi Paul,

Thank you for the kind words :) Sure, I'm glad to answer any questions you have.

First of all, about the CLA. No, we didn't sign it yet, and I think I have to consult our legal dept. on this one, and I will get back with any news as soon as I get an answer from them.

Do you have an interest in adding FPU support and Crankshaft support as well? Or is this version sufficient for your needs?

Yes, we strive to enable FPU & Crankshaft. The problem is that the board has a weak FPU implementation, so it is not an easy thing to do. We are trying to find a way to do that, but currently we have to the use the soft-float mode.

Are you aware of Big-endian hardware for mips that does include FPU? Do you have access to such boards?

Unfortunately, the Cisco 8600 is the only piece of big-endian MIPS hardware we have in mind.

Can you provide any details need for the compilation, besides the gyp name 'mips'? Anything special in your toolchain setup?

There is nothing special in the build procedure, but you need to set the -Dmips_arch_variant=mips32r1 -Dv8_use_mips_abi_hardfloat=false -Dv8_can_use_fpu_instructions=false flags. Also, you need to define the BIG_ENDIAN_FLOATING_POINT. Yes, perhaps it is a good idea to put it in the gyp script for the 'mips' target.

I also see '#elif __BYTE_ORDER == __BIG_ENDIAN' kind of defs. Maybe we should standardize on a single def? Or is there a reason to separate them?

The __BYTE_ORDER is a compiler define, so there's no need to define it explicitly. BTW, both these defines are used in the original V8 code base. I guess the reason in separating them is that there is a possibility that some big-endian hardware might have a little-endian FPU conventions (or vice-versa).

I didn't look closely enough to understand: why are the atomic-ops endian dependent?

It's a good question. I think I just overlooked this one, and actually some other platform-specific #ifdef should be used here. The fact is, the Cisco 8600 doesn't have the ll/sc instructions. Instead, the lwc0/swc0 pair must be used.

I will fix this.

Can you try running the mozilla and test262 suites as well?

Sure, we will do it.

Have you thought about snapshot support at all?

Yes, we are going to enable shapshot support. But now, it is less important for us than the lack of FPU and Crankshaft, so I think we will enable the shapshot later, but currently it is not used in our builds.

I looked briefly at the data sheet for the Cisco 8600, but did not see a mention of the SoC vendor. Is this a Cisco chip, Broadcom, other? Please let us know (if you're able to disclose the info).

Frankly, we do not know for sure what chipset is in the box, as Cisco doesn't expose such info too much. It is almost definitely NOT Broadcom - this is all we know :)

Thank you again for your interest!

--Evgeny

@paul99

This comment has been minimized.

Show comment
Hide comment
@paul99

paul99 Jul 30, 2012

My colleague Dusan has built the code with cross-compilation toolchain, and he was not able to get to run error-free on the make 'check' tests (cctest & mjsunit). I thought he tried all the options you mentioned above. (He'll confirm tomorrow)

Did you native build or cross-build? What rev of toolchain?

paul99 commented Jul 30, 2012

My colleague Dusan has built the code with cross-compilation toolchain, and he was not able to get to run error-free on the make 'check' tests (cctest & mjsunit). I thought he tried all the options you mentioned above. (He'll confirm tomorrow)

Did you native build or cross-build? What rev of toolchain?

@evgenybaskakov

This comment has been minimized.

Show comment
Hide comment
@evgenybaskakov

evgenybaskakov Jul 31, 2012

I use a toolchain (which includes GCC) provided by Cisco to cross-compile V8.

Can you please share the test logs so I could compare them with mine?

--Evgeny

I use a toolchain (which includes GCC) provided by Cisco to cross-compile V8.

Can you please share the test logs so I could compare them with mine?

--Evgeny

@dusmil

This comment has been minimized.

Show comment
Hide comment
@dusmil

dusmil Jul 31, 2012

Collaborator

Finally I found out what is going out with huge amount of errors for big endian patch. I want to share info to prevent this from happening again. There are many places where can go wrong with big endian testing. First, I am testing on malta big endian system with FPU, and with Debian OS. I need to disable runtime check for FPU support in v8 source. Second, Debian does not have soft-float libraries, but this should not be a problem if v8 is built statically. And that leads to second problem I was not aware when building with gyp. Even v8 is statically built with gyp for big endian, still some libraries like libgcc, libc is dinamically linked, and soft-float versions of those libraries do not exist on Debian. I deal with this by passing -static and -static-libgcc for linker flags which I cannot find in gyp config files, and after this huge amount of errors is gone. So now I am retesting whole thing and so far there is no error. Full logs will be available soon. We should discus If we need to add this flags in gyp files, especially -static-libgcc, in order to have "pure" static executable of v8.

At the end, Evgeny thank you for the great patch, at least it should be a nice base and starting point for a full big endian support.

Collaborator

dusmil commented Jul 31, 2012

Finally I found out what is going out with huge amount of errors for big endian patch. I want to share info to prevent this from happening again. There are many places where can go wrong with big endian testing. First, I am testing on malta big endian system with FPU, and with Debian OS. I need to disable runtime check for FPU support in v8 source. Second, Debian does not have soft-float libraries, but this should not be a problem if v8 is built statically. And that leads to second problem I was not aware when building with gyp. Even v8 is statically built with gyp for big endian, still some libraries like libgcc, libc is dinamically linked, and soft-float versions of those libraries do not exist on Debian. I deal with this by passing -static and -static-libgcc for linker flags which I cannot find in gyp config files, and after this huge amount of errors is gone. So now I am retesting whole thing and so far there is no error. Full logs will be available soon. We should discus If we need to add this flags in gyp files, especially -static-libgcc, in order to have "pure" static executable of v8.

At the end, Evgeny thank you for the great patch, at least it should be a nice base and starting point for a full big endian support.

@dusmil

This comment has been minimized.

Show comment
Hide comment
@dusmil

dusmil Jul 31, 2012

Collaborator

Here is the summary of test results for big endian on Malta board:

mjsunit:

[09:04|% 33|+ 983|- 4]

Failed test:
d8-os - this should be disregarded, no real failure.
unbox-double-arrays
elements-transition
elements-kind-depends

cctest:

[05:40|% 33|+ 911|- 39]

Failed tests:

36 x test-heap-profiler - Bunch of tests related to heap profiler.
RobustSubStringStub
test-assembler-mips MIPS6
test-assembler-mips MIPS11

test262

[76:02|% 33|+ 11570|- 7]

Failed tests:
7.3-2
15.2.3.10-1-3
15.2.3.6-4-187
15.2.3.6-4-355
5.2.3.7-6-a-123
15.3.4.5-2-12
S15.8.2.16_A4

I want to mention that test results are for one pass of whole test suites (33 %). Running tests in three passes makes no difference since crankshaft is turned off.

Full logs:

cctest
http://dl.dropbox.com/u/90940044/cctest.log
mjsunit
http://dl.dropbox.com/u/90940044/mjsunit.log
test262
http://dl.dropbox.com/u/90940044/test262.log

Collaborator

dusmil commented Jul 31, 2012

Here is the summary of test results for big endian on Malta board:

mjsunit:

[09:04|% 33|+ 983|- 4]

Failed test:
d8-os - this should be disregarded, no real failure.
unbox-double-arrays
elements-transition
elements-kind-depends

cctest:

[05:40|% 33|+ 911|- 39]

Failed tests:

36 x test-heap-profiler - Bunch of tests related to heap profiler.
RobustSubStringStub
test-assembler-mips MIPS6
test-assembler-mips MIPS11

test262

[76:02|% 33|+ 11570|- 7]

Failed tests:
7.3-2
15.2.3.10-1-3
15.2.3.6-4-187
15.2.3.6-4-355
5.2.3.7-6-a-123
15.3.4.5-2-12
S15.8.2.16_A4

I want to mention that test results are for one pass of whole test suites (33 %). Running tests in three passes makes no difference since crankshaft is turned off.

Full logs:

cctest
http://dl.dropbox.com/u/90940044/cctest.log
mjsunit
http://dl.dropbox.com/u/90940044/mjsunit.log
test262
http://dl.dropbox.com/u/90940044/test262.log

@evgenybaskakov

This comment has been minimized.

Show comment
Hide comment
@evgenybaskakov

evgenybaskakov Aug 1, 2012

Thank you, Dusan.

I will compare the logs with mine and run the other test suites in a couple of days.

--Evgeny

Thank you, Dusan.

I will compare the logs with mine and run the other test suites in a couple of days.

--Evgeny

@evgenybaskakov

This comment has been minimized.

Show comment
Hide comment
@evgenybaskakov

evgenybaskakov Aug 7, 2012

Hi guys,

I fixed a few quite subtle bugs and adjusted the test build, so the following tests should now pass on your side:

mjsunit:

unbox-double-arrays
elements-transition
elements-kind-depends

cctest:

test-assembler-mips MIPS6
test-assembler-mips MIPS11

The cctest/RobustSubStringStub fails because of this: http://code.google.com/p/v8/issues/detail?id=2262

As for the cctest/test-heap-profiler tests, I double-checked them on a LE MIPS system, and they fail there, too. Can you please share some logs from a LE system which has these tests passed?

I'm sorry for all these failing tests - our boxes have quite limited capabilities (specifically, there's no any Python environment), so we have to use a customized test run system.

BTW, what is the proper way to run the test262 and mozilla test suites on MIPS boards? Could you please share exact instructions how to do it?

--Evgeny

Hi guys,

I fixed a few quite subtle bugs and adjusted the test build, so the following tests should now pass on your side:

mjsunit:

unbox-double-arrays
elements-transition
elements-kind-depends

cctest:

test-assembler-mips MIPS6
test-assembler-mips MIPS11

The cctest/RobustSubStringStub fails because of this: http://code.google.com/p/v8/issues/detail?id=2262

As for the cctest/test-heap-profiler tests, I double-checked them on a LE MIPS system, and they fail there, too. Can you please share some logs from a LE system which has these tests passed?

I'm sorry for all these failing tests - our boxes have quite limited capabilities (specifically, there's no any Python environment), so we have to use a customized test run system.

BTW, what is the proper way to run the test262 and mozilla test suites on MIPS boards? Could you please share exact instructions how to do it?

--Evgeny

@paul99

This comment has been minimized.

Show comment
Hide comment
@paul99

paul99 Aug 8, 2012

Hi Evgeny -

The normal way to run test262 and mozilla is like this:

tools/test-wrapper-gypbuild.py -j8 --arch=mipsel --mode=release --timeout=240 --verbose --time --no-presubmit --report  mozilla 
tools/test-wrapper-gypbuild.py -j8 --arch=mipsel --mode=release --timeout=240 --verbose --time --no-presubmit --report test262

This and a bit more is now on the building with GYP page, which Dusan updated recently.

Those won't run on your target directly since you do not have python. Something you might look at is the version of test.py that is in our repo bleeding_edge branch. There is a facility for remote executing tests on Android, where the test scripts run on the host, and use Android 'adb' to remote execute the test cases. You might be able to easily alter that to use ssh to run the tests on your box. You will need some fair storage or NFS mount of the test suite files off your development host.

Here are some instruction for running this on Android, hopefully it will make sense in your context:

The remote Android test runner is implemented as part of test.py, you should be able to see the options with --help

Some usage examples:

\1. mount your v8 workspace over NFS onto the Android device to the same path where the workspace is on the host. The following command will work in this case, it will use the binaries and test files from your workspace directly and execute the actual commands using adb shell.

tools/test.py --mode=release --verbose --timeout=480 --arch=mips --report --android cctest

\2. If you set up NFS like above, but want to use the binaries from a different directory (e.g. because you want to use the binaries built by the android build system), then you have to specify --android-bin-path like this:

tools/test.py --mode=release --verbose --timeout=480 --arch=mips --report --android --android-bin-path /tmp/abins cctest

\3. If you don't want to or cannot set up NFS, you have to use --android-push-path to push your test files and binaries using adb push prior to running the tests:

tools/test.py --mode=release --verbose --timeout=480 --arch=mips --report --android --android-push-path /tmp/palfia cctest

\4. If you want, you can use binaries from a different directory, while using adb push to send over the test files, just specify both --android-push-path and --android-bin-path:

tools/test.py --mode=release --verbose --timeout=480 --arch=mips --report --android --android-push-path /tmp/palfia --android-bin-path /tmp/abins cctest

Finally, did you check with your legal about Google CLA?

thanks,

paul

paul99 commented Aug 8, 2012

Hi Evgeny -

The normal way to run test262 and mozilla is like this:

tools/test-wrapper-gypbuild.py -j8 --arch=mipsel --mode=release --timeout=240 --verbose --time --no-presubmit --report  mozilla 
tools/test-wrapper-gypbuild.py -j8 --arch=mipsel --mode=release --timeout=240 --verbose --time --no-presubmit --report test262

This and a bit more is now on the building with GYP page, which Dusan updated recently.

Those won't run on your target directly since you do not have python. Something you might look at is the version of test.py that is in our repo bleeding_edge branch. There is a facility for remote executing tests on Android, where the test scripts run on the host, and use Android 'adb' to remote execute the test cases. You might be able to easily alter that to use ssh to run the tests on your box. You will need some fair storage or NFS mount of the test suite files off your development host.

Here are some instruction for running this on Android, hopefully it will make sense in your context:

The remote Android test runner is implemented as part of test.py, you should be able to see the options with --help

Some usage examples:

\1. mount your v8 workspace over NFS onto the Android device to the same path where the workspace is on the host. The following command will work in this case, it will use the binaries and test files from your workspace directly and execute the actual commands using adb shell.

tools/test.py --mode=release --verbose --timeout=480 --arch=mips --report --android cctest

\2. If you set up NFS like above, but want to use the binaries from a different directory (e.g. because you want to use the binaries built by the android build system), then you have to specify --android-bin-path like this:

tools/test.py --mode=release --verbose --timeout=480 --arch=mips --report --android --android-bin-path /tmp/abins cctest

\3. If you don't want to or cannot set up NFS, you have to use --android-push-path to push your test files and binaries using adb push prior to running the tests:

tools/test.py --mode=release --verbose --timeout=480 --arch=mips --report --android --android-push-path /tmp/palfia cctest

\4. If you want, you can use binaries from a different directory, while using adb push to send over the test files, just specify both --android-push-path and --android-bin-path:

tools/test.py --mode=release --verbose --timeout=480 --arch=mips --report --android --android-push-path /tmp/palfia --android-bin-path /tmp/abins cctest

Finally, did you check with your legal about Google CLA?

thanks,

paul

@evgenybaskakov

This comment has been minimized.

Show comment
Hide comment
@evgenybaskakov

evgenybaskakov Aug 8, 2012

Hi Paul,

Thank you very much for the very detailed answer. I'll run the test suites in the proposed way ASAP.

As for the CLA, I sent a request to our legal dept., but still got no reply. I'll ask them again.

--Evgeny

Hi Paul,

Thank you very much for the very detailed answer. I'll run the test suites in the proposed way ASAP.

As for the CLA, I sent a request to our legal dept., but still got no reply. I'll ask them again.

--Evgeny

@dusmil

This comment has been minimized.

Show comment
Hide comment
@dusmil

dusmil Aug 8, 2012

Collaborator

Hi Evgeny,

Very nice effort.

The heap profiler tests are passing on MIPS-LE system. I have tesed it on Sigma8656 with timesys Linux, there are no failures related to test-heap-profiler.

Here is the log you asked for:

http://dl.dropbox.com/u/90940044/cctestMipsEL.log

The testing is done upon current bleeding_edge branch.

By the way this tool is not essential for v8 functionality because it is not part of v8 internals. It is newly created separate support for examining heap, allocation, and GC stuff. Maybe if this cannot be solved with some obvious fix, we should skip those cctests.

Yes, RobustSubString is known failure due to improper conversion of Nan double value to integer. It is expected that maximum int value to be returned from conversion routine when Nan for double is passed, but this does not happen especially when code is compiled for soft float.

Thank you,

Dusan

Collaborator

dusmil commented Aug 8, 2012

Hi Evgeny,

Very nice effort.

The heap profiler tests are passing on MIPS-LE system. I have tesed it on Sigma8656 with timesys Linux, there are no failures related to test-heap-profiler.

Here is the log you asked for:

http://dl.dropbox.com/u/90940044/cctestMipsEL.log

The testing is done upon current bleeding_edge branch.

By the way this tool is not essential for v8 functionality because it is not part of v8 internals. It is newly created separate support for examining heap, allocation, and GC stuff. Maybe if this cannot be solved with some obvious fix, we should skip those cctests.

Yes, RobustSubString is known failure due to improper conversion of Nan double value to integer. It is expected that maximum int value to be returned from conversion routine when Nan for double is passed, but this does not happen especially when code is compiled for soft float.

Thank you,

Dusan

@evgenybaskakov

This comment has been minimized.

Show comment
Hide comment
@evgenybaskakov

evgenybaskakov Aug 19, 2012

Hi guys,

I just got news from the legal dept. of my company. Unfortunately, they don't give me permission to sign the CLA, and they are asking me to suspend the official MIPS V8 integration process - at least until a certain milestone in our internal project is achieved.

Sorry for this, guys :( We are eager to merge our code (which already has the FPU and Crankshaft working on Big Endian) into your code base - at least because it would greatly help us to move on to new releases of V8.

Please stay tuned - as soon as I have permissions to continue the integration process, I'll get back.

--Evgeny

Hi guys,

I just got news from the legal dept. of my company. Unfortunately, they don't give me permission to sign the CLA, and they are asking me to suspend the official MIPS V8 integration process - at least until a certain milestone in our internal project is achieved.

Sorry for this, guys :( We are eager to merge our code (which already has the FPU and Crankshaft working on Big Endian) into your code base - at least because it would greatly help us to move on to new releases of V8.

Please stay tuned - as soon as I have permissions to continue the integration process, I'll get back.

--Evgeny

@fugui

This comment has been minimized.

Show comment
Hide comment
@fugui

fugui Feb 3, 2013

Is this OK now? I have the Atheros AR71xx/AR724x/913x device(MIPS with big-endian) running with openwrt, I want using node.js... I am waiting the big-endian MIPS V8.

fugui commented Feb 3, 2013

Is this OK now? I have the Atheros AR71xx/AR724x/913x device(MIPS with big-endian) running with openwrt, I want using node.js... I am waiting the big-endian MIPS V8.

@petar-jovanovic

This comment has been minimized.

Show comment
Hide comment
@petar-jovanovic

petar-jovanovic Feb 3, 2013

Collaborator

@fugui

You can find 3.12.15 based version with support for MIPS BE hard-flaot if you
checkout the dm-dev-mipsbe branch, e.g.

git clone git://github.com/paul99/v8m-rb.git -b dm-dev-mipsbe

You obviously need to check first if your target platform supports hard-float.

Collaborator

petar-jovanovic commented Feb 3, 2013

@fugui

You can find 3.12.15 based version with support for MIPS BE hard-flaot if you
checkout the dm-dev-mipsbe branch, e.g.

git clone git://github.com/paul99/v8m-rb.git -b dm-dev-mipsbe

You obviously need to check first if your target platform supports hard-float.

@fugui

This comment has been minimized.

Show comment
Hide comment
@fugui

fugui Feb 4, 2013

Thanks @petar-jovanovic

I use the toolchain of the openwrt, and get the branch dm-dev-mipsbe, and failed:

g++ '-DENABLE_DEBUGGER_SUPPORT' '-DV8_TARGET_ARCH_MIPS' '-DCAN_USE_FPU_INSTRUCTIONS' '-D__mips_hard_float=1' '-D_MIPS_ARCH_MIPS32R2' -I../src -Wall -Werror -W -Wno-unused-parameter -Wnon-virtual-dtor -pthread -fno-rtti -fno-exceptions -pedantic -ansi -fvisibility=hidden -fdata-sections -ffunction-sections -O3 -MMD -MF /home/fugui/v8m-rb/out/mipsel.release/.deps//home/fugui/v8m-rb/out/mipsel.release/obj.host/v8_base/src/api.o.d.raw -c -o /home/fugui/v8m-rb/out/mipsel.release/obj.host/v8_base/src/api.o ../src/api.cc
/tmp/ccT7d9nM.s: Assembler messages:
/tmp/ccT7d9nM.s:488: Error: opcode not supported on this processor: mips1 (mips1) ll $4,%lo(_ZN2v88internal15RuntimeProfiler6state_E)($2)' /tmp/ccT7d9nM.s:490: Error: opcode not supported on this processor: mips1 (mips1)sc $3,%lo(_ZN2v88internal15RuntimeProfiler6state_E)($2)'
...
make[1]: *** [/home/fugui/v8m-rb/out/mipsel.release/obj.host/v8_base/src/api.o] Error 1
make[1]: Leaving directory `/home/fugui/v8m-rb/out'

fugui commented Feb 4, 2013

Thanks @petar-jovanovic

I use the toolchain of the openwrt, and get the branch dm-dev-mipsbe, and failed:

g++ '-DENABLE_DEBUGGER_SUPPORT' '-DV8_TARGET_ARCH_MIPS' '-DCAN_USE_FPU_INSTRUCTIONS' '-D__mips_hard_float=1' '-D_MIPS_ARCH_MIPS32R2' -I../src -Wall -Werror -W -Wno-unused-parameter -Wnon-virtual-dtor -pthread -fno-rtti -fno-exceptions -pedantic -ansi -fvisibility=hidden -fdata-sections -ffunction-sections -O3 -MMD -MF /home/fugui/v8m-rb/out/mipsel.release/.deps//home/fugui/v8m-rb/out/mipsel.release/obj.host/v8_base/src/api.o.d.raw -c -o /home/fugui/v8m-rb/out/mipsel.release/obj.host/v8_base/src/api.o ../src/api.cc
/tmp/ccT7d9nM.s: Assembler messages:
/tmp/ccT7d9nM.s:488: Error: opcode not supported on this processor: mips1 (mips1) ll $4,%lo(_ZN2v88internal15RuntimeProfiler6state_E)($2)' /tmp/ccT7d9nM.s:490: Error: opcode not supported on this processor: mips1 (mips1)sc $3,%lo(_ZN2v88internal15RuntimeProfiler6state_E)($2)'
...
make[1]: *** [/home/fugui/v8m-rb/out/mipsel.release/obj.host/v8_base/src/api.o] Error 1
make[1]: Leaving directory `/home/fugui/v8m-rb/out'

@evgenybaskakov

This comment has been minimized.

Show comment
Hide comment
@evgenybaskakov

evgenybaskakov Feb 4, 2013

@fugui

It seems that your target CPU assembler doesn't support the ll/sc instructions (they're used in the atomic functions NoBarrier_CompareAndSwap, etc in atomicops_internals_mips_gcc.h). Try to replace them with lwc0/swc0.

--Evgeny

@fugui

It seems that your target CPU assembler doesn't support the ll/sc instructions (they're used in the atomic functions NoBarrier_CompareAndSwap, etc in atomicops_internals_mips_gcc.h). Try to replace them with lwc0/swc0.

--Evgeny

@dusmil

This comment has been minimized.

Show comment
Hide comment
@dusmil

dusmil Feb 4, 2013

Collaborator

Hi guys,

Evgeny is right, if you want to compile for mips1, these instructions are not supported.
I see from build line that -mips32r2 is not passed, but -D_MIPS_ARHC_MIPS32R2 is there. I presume you change gyp config files to set up build flags for your platform, but if you are not building for mips32r2 this "-D_MIPS_ARHC_MIPS32R" variable should not be defined. This will cause problems if v8 is executed on non r2 MIPS32 or older MIPS architectures.

Other important thing, if your Atheros CPU does not have FPU, you should compile V8 for soft-float ABI.

To do this export variable before build as follows:

export GYPFLAGS="-Dv8_use_mips_abi_hardfloat=false"

Collaborator

dusmil commented Feb 4, 2013

Hi guys,

Evgeny is right, if you want to compile for mips1, these instructions are not supported.
I see from build line that -mips32r2 is not passed, but -D_MIPS_ARHC_MIPS32R2 is there. I presume you change gyp config files to set up build flags for your platform, but if you are not building for mips32r2 this "-D_MIPS_ARHC_MIPS32R" variable should not be defined. This will cause problems if v8 is executed on non r2 MIPS32 or older MIPS architectures.

Other important thing, if your Atheros CPU does not have FPU, you should compile V8 for soft-float ABI.

To do this export variable before build as follows:

export GYPFLAGS="-Dv8_use_mips_abi_hardfloat=false"

@paul99

This comment has been minimized.

Show comment
Hide comment
@paul99

paul99 Feb 4, 2013

I think that the Atheros CPUs are a MIPS 24K, meaning that they ARE mips32r2, and you should be passing in the -mips32r2 flag. Your toolchain seems to default to mips1 (the lowest common denominator, which is missing the ll/sc instructions), and it would really surprise me if that was necessary.

Please cat /proc/cpuinfo on your board and paste the results here for us to look at. I suspect you will see a line similar to this (but will say 24Kc, rather than 74Kc).

cpu model       : MIPS 74Kc V4.12  FPU V0.0

paul99 commented Feb 4, 2013

I think that the Atheros CPUs are a MIPS 24K, meaning that they ARE mips32r2, and you should be passing in the -mips32r2 flag. Your toolchain seems to default to mips1 (the lowest common denominator, which is missing the ll/sc instructions), and it would really surprise me if that was necessary.

Please cat /proc/cpuinfo on your board and paste the results here for us to look at. I suspect you will see a line similar to this (but will say 24Kc, rather than 74Kc).

cpu model       : MIPS 74Kc V4.12  FPU V0.0
@paul99

This comment has been minimized.

Show comment
Hide comment
@paul99

paul99 Feb 4, 2013

I should have added a bit more detail: if you have a mips32 or mips32r2 processor core (which is very likely) then the ll and sc instructions are implemented, and you just need to be sure the toolchain understands your processor family, and it should generate those instructions properly.

Did you modify the gyp files to remove the -mips32r2' flag? If not, then possibly there is an issue with the gyp files. Please let us know.

paul99 commented Feb 4, 2013

I should have added a bit more detail: if you have a mips32 or mips32r2 processor core (which is very likely) then the ll and sc instructions are implemented, and you just need to be sure the toolchain understands your processor family, and it should generate those instructions properly.

Did you modify the gyp files to remove the -mips32r2' flag? If not, then possibly there is an issue with the gyp files. Please let us know.

@fugui

This comment has been minimized.

Show comment
Hide comment
@fugui

fugui Feb 5, 2013

root@OpenWrt:~# cat /proc/cpuinfo
system type : Atheros AR9344 rev 2
machine : TP-LINK TL-WDR3600/4300/4310
processor : 0
cpu model : MIPS 74Kc V4.12
BogoMIPS : 278.93
wait instruction : yes
microsecond timers : yes
tlb_entries : 32
extra interrupt vector : yes
hardware watchpoint : yes, count: 4, address/irw mask: [0x0000, 0x0200, 0x0270, 0x0660]
ASEs implemented : mips16 dsp
shadow register sets : 1
kscratch registers : 0
core : 0
VCED exceptions : not available
VCEI exceptions : not available

fugui commented Feb 5, 2013

root@OpenWrt:~# cat /proc/cpuinfo
system type : Atheros AR9344 rev 2
machine : TP-LINK TL-WDR3600/4300/4310
processor : 0
cpu model : MIPS 74Kc V4.12
BogoMIPS : 278.93
wait instruction : yes
microsecond timers : yes
tlb_entries : 32
extra interrupt vector : yes
hardware watchpoint : yes, count: 4, address/irw mask: [0x0000, 0x0200, 0x0270, 0x0660]
ASEs implemented : mips16 dsp
shadow register sets : 1
kscratch registers : 0
core : 0
VCED exceptions : not available
VCEI exceptions : not available

@fugui

This comment has been minimized.

Show comment
Hide comment
@fugui

fugui Feb 5, 2013

@paul99 @dusmil @evgenybaskakov , Thanks. I did not modify any file. Those are my steps:

  1. ubuntu 12.04-server-amd64
  2. svn co the openwrt 12.09, and choose the AR7xxx/9xxx, make, then I got the toolchain;
  3. git clone git://github.com/paul99/v8m-rb.git -b dm-dev-mipsbe
  4. cd v8m-rb, svn co http://gyp.googlecode.com/svn/trunk build/gyp
  5. set STAGING_DIR to openwrt/staging_dir/toolchain-mipsel_r2_gcc-4.6-linaro_uClibc-0.9.33.2
  6. make mipsel.release -j4 CC=mipsel-openwrt-linux-gcc CXX=mipsel-openwrt-linux-g++

the log file attached: https://github.com/fugui/wface/blob/master/log.txt

fugui commented Feb 5, 2013

@paul99 @dusmil @evgenybaskakov , Thanks. I did not modify any file. Those are my steps:

  1. ubuntu 12.04-server-amd64
  2. svn co the openwrt 12.09, and choose the AR7xxx/9xxx, make, then I got the toolchain;
  3. git clone git://github.com/paul99/v8m-rb.git -b dm-dev-mipsbe
  4. cd v8m-rb, svn co http://gyp.googlecode.com/svn/trunk build/gyp
  5. set STAGING_DIR to openwrt/staging_dir/toolchain-mipsel_r2_gcc-4.6-linaro_uClibc-0.9.33.2
  6. make mipsel.release -j4 CC=mipsel-openwrt-linux-gcc CXX=mipsel-openwrt-linux-g++

the log file attached: https://github.com/fugui/wface/blob/master/log.txt

@dusmil

This comment has been minimized.

Show comment
Hide comment
@dusmil

dusmil Feb 5, 2013

Collaborator

Hi fugui,

If you build for BE, you have to use mips instead of mipsel in make command and in toolchain variables.
Before you do make command, exporting variables to toolcahin path is needed to cross compile V8.
For instance in your case before make command:

export CC="path_to_toolchain"
export CXX="path_to_toolchain"
export AR="path_to_toolchain"
export RANLIB="path_to_toolchain"
export LINK=$CXX // This one is important for cross compile.

export GYPFLAGS="-Dv8_use_mips_abi_hardfloat=false"

And then do:

make mips.release snapshot=off -j4

Dont`t forget snaspshot=off, because you are cross-compiling for BE, snapshot cannot be created on LE machine and later used on target V8 build for BE.

Collaborator

dusmil commented Feb 5, 2013

Hi fugui,

If you build for BE, you have to use mips instead of mipsel in make command and in toolchain variables.
Before you do make command, exporting variables to toolcahin path is needed to cross compile V8.
For instance in your case before make command:

export CC="path_to_toolchain"
export CXX="path_to_toolchain"
export AR="path_to_toolchain"
export RANLIB="path_to_toolchain"
export LINK=$CXX // This one is important for cross compile.

export GYPFLAGS="-Dv8_use_mips_abi_hardfloat=false"

And then do:

make mips.release snapshot=off -j4

Dont`t forget snaspshot=off, because you are cross-compiling for BE, snapshot cannot be created on LE machine and later used on target V8 build for BE.

@fugui

This comment has been minimized.

Show comment
Hide comment
@fugui

fugui Feb 6, 2013

@dusmil Thanks, It's OK now. and the hello_world test is passed in my TP_LINK router. The next step I'll compile the node.js for my TP_LINK router.

fugui commented Feb 6, 2013

@dusmil Thanks, It's OK now. and the hello_world test is passed in my TP_LINK router. The next step I'll compile the node.js for my TP_LINK router.

@SevenW

This comment has been minimized.

Show comment
Hide comment
@SevenW

SevenW Mar 22, 2013

@fugui A little off-topic, but did you manage to build node.js for mips BE?
SevenW

SevenW commented Mar 22, 2013

@fugui A little off-topic, but did you manage to build node.js for mips BE?
SevenW

@SevenW

This comment has been minimized.

Show comment
Hide comment
@SevenW

SevenW Mar 24, 2013

I have build this BE V8 according to above instructions for a TL-WR703N. Build is fine, but executables do not run properly on the target. They always are stuck after a few seconds with the same last line of logging with 100% CPU:

api,ObjectTemplate::New
api,FunctionTemplate::New
code-creation,Stub,0x7741f860,96,"StackCheckStub"
code-creation,Stub,0x7741f8c0,236,"CallConstructStub_Recording"
code-creation,Stub,0x7741f9c0,96,"InterruptStub"
code-creation,Script,0x7741fa20,1408,"native runtime.js",0x346146b0,~

Maybe this has something to do with installation on the target. I could not find clear instructions. I copied five executables to the tatget, a.o. d8 and shell. I run them as:
./shell --shell --log_all

Is there more to installing it? Builds seem to be ok with options like mips32r2, soft_float (and manually -EB). I used the make command with snapshot=off, although logging seem to imply otherwise:

code-creation,Stub,0x26c1b840,3056,"RecordWriteStub"
code-creation,KeyedStoreIC,0x26c1c440,524,"A keyed store IC from the snapshot"
code-creation,Builtin,0x26c1c660,556,"A builtin from the snapshot"

SevenW commented Mar 24, 2013

I have build this BE V8 according to above instructions for a TL-WR703N. Build is fine, but executables do not run properly on the target. They always are stuck after a few seconds with the same last line of logging with 100% CPU:

api,ObjectTemplate::New
api,FunctionTemplate::New
code-creation,Stub,0x7741f860,96,"StackCheckStub"
code-creation,Stub,0x7741f8c0,236,"CallConstructStub_Recording"
code-creation,Stub,0x7741f9c0,96,"InterruptStub"
code-creation,Script,0x7741fa20,1408,"native runtime.js",0x346146b0,~

Maybe this has something to do with installation on the target. I could not find clear instructions. I copied five executables to the tatget, a.o. d8 and shell. I run them as:
./shell --shell --log_all

Is there more to installing it? Builds seem to be ok with options like mips32r2, soft_float (and manually -EB). I used the make command with snapshot=off, although logging seem to imply otherwise:

code-creation,Stub,0x26c1b840,3056,"RecordWriteStub"
code-creation,KeyedStoreIC,0x26c1c440,524,"A keyed store IC from the snapshot"
code-creation,Builtin,0x26c1c660,556,"A builtin from the snapshot"

@dusmil

This comment has been minimized.

Show comment
Hide comment
@dusmil

dusmil Mar 26, 2013

Collaborator

Hi SevenW,

It looks to me, you run v8 with snapshot, and it is bad if you cross-compiled v8 for big-endian. Please recheck build steps.

Could you give me more information what you are trying to do? How do you run v8 on board? Do you plan to use v8 shell only or v8 library? What board you are trying to run v8 on?

Collaborator

dusmil commented Mar 26, 2013

Hi SevenW,

It looks to me, you run v8 with snapshot, and it is bad if you cross-compiled v8 for big-endian. Please recheck build steps.

Could you give me more information what you are trying to do? How do you run v8 on board? Do you plan to use v8 shell only or v8 library? What board you are trying to run v8 on?

@SevenW

This comment has been minimized.

Show comment
Hide comment
@SevenW

SevenW Mar 26, 2013

I build in a VirtualBox ubuntu, target is TP-Link TR-WR703N, which is a AR71xx plartform, mips32r2, big-endian, running on openwrt. I use a toolchain for this platform downloaded from openwrt. Eventually I intend to use the shared lib with Node.js, but for now I try to run stand alone to test.
Maybe the snapshot=off does not translate to compiler options. I use the make command exactly as in a post above.
make mips.release snapshot=off -j4
A typical compile command looks like this (sorry, bit long):
/home/sevenw/builds/AARC1-Toolchain/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-g++ '-DENABLE_DEBUGGER_SUPPORT' '-DV8_TARGET_ARCH_MIPS' '-DCAN_USE_FPU_INSTRUCTIONS' '-D__mips_soft_float=1' '-D_MIPS_ARCH_MIPS32R2' -I../src -I../include -Wall -Werror -W -Wno-unused-parameter -Wnon-virtual-dtor -pthread -fno-rtti -fno-exceptions -pedantic -ansi -fvisibility=hidden -msoft-float -mips32r2 -Wa,-mips32r2 -fdata-sections -ffunction-sections -O3 -MMD -MF /home/sevenw/builds/v8m-rb/out/mips.release/.deps//home/sevenw/builds/v8m-rb/out/mips.release/obj.target/d8/gen/d8-js.o.d.raw -EB -c -o /home/sevenw/builds/v8m-rb/out/mips.release/obj.target/d8/gen/d8-js.o /home/sevenw/builds/v8m-rb/out/mips.release/obj/gen/d8-js.cc

I added the -EB by hand (CXX flags) but did not help.

SevenW commented Mar 26, 2013

I build in a VirtualBox ubuntu, target is TP-Link TR-WR703N, which is a AR71xx plartform, mips32r2, big-endian, running on openwrt. I use a toolchain for this platform downloaded from openwrt. Eventually I intend to use the shared lib with Node.js, but for now I try to run stand alone to test.
Maybe the snapshot=off does not translate to compiler options. I use the make command exactly as in a post above.
make mips.release snapshot=off -j4
A typical compile command looks like this (sorry, bit long):
/home/sevenw/builds/AARC1-Toolchain/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-g++ '-DENABLE_DEBUGGER_SUPPORT' '-DV8_TARGET_ARCH_MIPS' '-DCAN_USE_FPU_INSTRUCTIONS' '-D__mips_soft_float=1' '-D_MIPS_ARCH_MIPS32R2' -I../src -I../include -Wall -Werror -W -Wno-unused-parameter -Wnon-virtual-dtor -pthread -fno-rtti -fno-exceptions -pedantic -ansi -fvisibility=hidden -msoft-float -mips32r2 -Wa,-mips32r2 -fdata-sections -ffunction-sections -O3 -MMD -MF /home/sevenw/builds/v8m-rb/out/mips.release/.deps//home/sevenw/builds/v8m-rb/out/mips.release/obj.target/d8/gen/d8-js.o.d.raw -EB -c -o /home/sevenw/builds/v8m-rb/out/mips.release/obj.target/d8/gen/d8-js.o /home/sevenw/builds/v8m-rb/out/mips.release/obj/gen/d8-js.cc

I added the -EB by hand (CXX flags) but did not help.

@dusmil

This comment has been minimized.

Show comment
Hide comment
@dusmil

dusmil Mar 27, 2013

Collaborator

Hi SevenW,

The compile command you pasted was very useful, as it appears. The problem there is that flag '-DCAN_USE_FPU_INSTRUCTIONS' must not be passed when building for soft-float.

Try with following command before you hit make:

export GYPFLAGS="-Dv8_use_mips_abi_hardfloat=false -Dv8_can_use_fpu_instructions=false"

This is obviously problem, and it is very possible it is the root cause of your problems on board.

Collaborator

dusmil commented Mar 27, 2013

Hi SevenW,

The compile command you pasted was very useful, as it appears. The problem there is that flag '-DCAN_USE_FPU_INSTRUCTIONS' must not be passed when building for soft-float.

Try with following command before you hit make:

export GYPFLAGS="-Dv8_use_mips_abi_hardfloat=false -Dv8_can_use_fpu_instructions=false"

This is obviously problem, and it is very possible it is the root cause of your problems on board.

@SevenW

This comment has been minimized.

Show comment
Hide comment
@SevenW

SevenW Mar 27, 2013

Thanks! This works now. I had a corrupt source file somewhere, but after a fresh git clone the build went ok, and the shell works on the TL-WR703N.

Next step: figure out how to integrate this in Node.js (replace the standard v8) and see whether I get Node.js build.

SevenW commented Mar 27, 2013

Thanks! This works now. I had a corrupt source file somewhere, but after a fresh git clone the build went ok, and the shell works on the TL-WR703N.

Next step: figure out how to integrate this in Node.js (replace the standard v8) and see whether I get Node.js build.

@mlafauci

This comment has been minimized.

Show comment
Hide comment
@mlafauci

mlafauci Apr 2, 2013

Hi,
I am using a board with AR9330, cpu model MIPS24kc V7.4. I built followng your suggestions:

export PREFIX=/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-
export CC=${PREFIX}gcc
export CXX=${PREFIX}g++
export AR=${PREFIX}ar
export RANLIB=${PREFIX}ranlib
export LINK=$CXX
export GYPFLAGS="-Dv8_use_mips_abi_hardfloat=false -Dv8_can_use_fpu_instructions=false"

make mips.release snapshot=off -j4

copying d8 file on the target and launching it, I obtain the error:
Illegal instruction

Do you have any suggestions?

thanks
m

mlafauci commented Apr 2, 2013

Hi,
I am using a board with AR9330, cpu model MIPS24kc V7.4. I built followng your suggestions:

export PREFIX=/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-
export CC=${PREFIX}gcc
export CXX=${PREFIX}g++
export AR=${PREFIX}ar
export RANLIB=${PREFIX}ranlib
export LINK=$CXX
export GYPFLAGS="-Dv8_use_mips_abi_hardfloat=false -Dv8_can_use_fpu_instructions=false"

make mips.release snapshot=off -j4

copying d8 file on the target and launching it, I obtain the error:
Illegal instruction

Do you have any suggestions?

thanks
m

@paul99

This comment has been minimized.

Show comment
Hide comment
@paul99

paul99 Apr 2, 2013

Can you please include a copy of your compilation command line including all options (for one file), as SevenW did above?

Also, if you can start up your d8 shell under gdb and let us know what instruction is found to be illegal. You might also do this 3 or 4 times, and see if it is repeatable (the same instruction, indicating that we emit an instruction that your CPU cannot execute) or random, which could indicate a different situation where there is some random memory corruption.

paul99 commented Apr 2, 2013

Can you please include a copy of your compilation command line including all options (for one file), as SevenW did above?

Also, if you can start up your d8 shell under gdb and let us know what instruction is found to be illegal. You might also do this 3 or 4 times, and see if it is repeatable (the same instruction, indicating that we emit an instruction that your CPU cannot execute) or random, which could indicate a different situation where there is some random memory corruption.

@mlafauci

This comment has been minimized.

Show comment
Hide comment
@mlafauci

mlafauci Apr 3, 2013

Thanks for your reply.
Here the compilation command:
/scratch/openwrt/root/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-g++ '-DENABLE_DEBUGGER_SUPPORT' '-DV8_TARGET_ARCH_MIPS' '-D__mips_soft_float=1' '-D_MIPS_ARCH_MIPS32R2' -I../src -I../include -Wall -Werror -W -Wno-unused-parameter -Wnon-virtual-dtor -pthread -fno-rtti -fno-exceptions -pedantic -ansi -fvisibility=hidden -msoft-float -mips32r2 -Wa,-mips32r2 -mtune=24kc -fdata-sections -ffunction-sections -O3 -MMD -MF /scratch/v8/v8m-rb/out/mips.release/.deps//scratch/v8/v8m-rb/out/mips.release/obj.target/cctest/test/cctest/test-disasm-mips.o.d.raw -c -o /scratch/v8/v8m-rb/out/mips.release/obj.target/cctest/test/cctest/test-disasm-mips.o ../test/cctest/test-disasm-mips.cc

From gdb output I don't have enough information since the d8 was built without symbols:
Program received signal SIGILL, Illegal instruction.
0x77faa188 in ?? ()
(gdb) l
this is what I have seen from now. I'll put the d8 built with symbol and give you the related output.

mlafauci commented Apr 3, 2013

Thanks for your reply.
Here the compilation command:
/scratch/openwrt/root/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2/bin/mips-openwrt-linux-g++ '-DENABLE_DEBUGGER_SUPPORT' '-DV8_TARGET_ARCH_MIPS' '-D__mips_soft_float=1' '-D_MIPS_ARCH_MIPS32R2' -I../src -I../include -Wall -Werror -W -Wno-unused-parameter -Wnon-virtual-dtor -pthread -fno-rtti -fno-exceptions -pedantic -ansi -fvisibility=hidden -msoft-float -mips32r2 -Wa,-mips32r2 -mtune=24kc -fdata-sections -ffunction-sections -O3 -MMD -MF /scratch/v8/v8m-rb/out/mips.release/.deps//scratch/v8/v8m-rb/out/mips.release/obj.target/cctest/test/cctest/test-disasm-mips.o.d.raw -c -o /scratch/v8/v8m-rb/out/mips.release/obj.target/cctest/test/cctest/test-disasm-mips.o ../test/cctest/test-disasm-mips.cc

From gdb output I don't have enough information since the d8 was built without symbols:
Program received signal SIGILL, Illegal instruction.
0x77faa188 in ?? ()
(gdb) l
this is what I have seen from now. I'll put the d8 built with symbol and give you the related output.

@mlafauci

This comment has been minimized.

Show comment
Hide comment
@mlafauci

mlafauci Apr 3, 2013

Hi all,
I solved the issue related to some library not properly updated on my board.
The next step is to build node.js.
Do you have any suggestions or refernce how to proceed?

thanks
m

mlafauci commented Apr 3, 2013

Hi all,
I solved the issue related to some library not properly updated on my board.
The next step is to build node.js.
Do you have any suggestions or refernce how to proceed?

thanks
m

@ksfltd

This comment has been minimized.

Show comment
Hide comment
@ksfltd

ksfltd Jan 10, 2014

Hello
I managed to build node for Carambola2 (Atheros AR9330 64M RAM)
However, tests do not complete - machine just reboots. I tried to release some memory by stopping all services and it just ran two test cases more
I guess the machine it is not powerful enough to run these tests or garbage collector does not do its job as it should.
The tests I start with this command:

python tools/test.py -j8 --arch=mips --mode=release --timeout=240 --verbose --time --report simple message

The last started test was:
test-cluster-bind-twice-v1.js
Progress made: |% 7|+ 17|- 26]
Many of 26 failed tests failed with TIMEOUT

ksfltd commented Jan 10, 2014

Hello
I managed to build node for Carambola2 (Atheros AR9330 64M RAM)
However, tests do not complete - machine just reboots. I tried to release some memory by stopping all services and it just ran two test cases more
I guess the machine it is not powerful enough to run these tests or garbage collector does not do its job as it should.
The tests I start with this command:

python tools/test.py -j8 --arch=mips --mode=release --timeout=240 --verbose --time --report simple message

The last started test was:
test-cluster-bind-twice-v1.js
Progress made: |% 7|+ 17|- 26]
Many of 26 failed tests failed with TIMEOUT

@paul99

This comment has been minimized.

Show comment
Hide comment
@paul99

paul99 Jan 11, 2014

Hi there -

That's a cool board. I wish the SoC had more ram. 64K is pretty small for v8.

So first off, try removing '-j8' as that is spinning up 8 threads, each of which launches d8, so it really slams your available memory.

Second, I am not sure what the command at the end was intended to be but "simple message" seems to be a typo. I would guess you meant "mjsunit". I used this command (on a little-endian board, hence "arch=mipsel")

 tools/test.py --no-build --arch=mipsel --mode=release --timeout=240 --verbose --time --report mjsunit

I am certain that you will not be able to run all tests. We had some trouble with certain tests & benchmarks even on a board with 256M. Many of our test boards now run 384MB.

However, I just ran the v8 benchmarks and took some memory stats. I had to remove the 'splay' test, as that test does a huge amount of memory allocation. (I commented out the load of splay in run.js):

// load('splay.js');

With that change, I ran the full suite, and here is the memory usage (from cat /proc//status):

VmPeak:    52000 kB
VmSize:    51344 kB
VmLck:         0 kB
VmHWM:     34928 kB
VmRSS:     33680 kB
VmData:    43552 kB
VmStk:       160 kB
VmExe:      3728 kB
VmLib:      3376 kB
VmPTE:       208 kB
VmSwap:        0 kB

It was down in the 43M range, for the first several tests, and only ramped up to 52M at the end.

So depending on your application, this could possibly work ok.

You also can play with these flag settings:

--max_new_space_size 
--max_old_space_size 
--max_executable_size

Note that for a stock linux build, max_old_space_size defaults to 700MB, and max_executable_size to 256MB.

By lowering these, you definitely won't run all tests, and large JS programs correctly, but it might beOK for your purposes if you just want to do some simple node stuff.

Finally, it is apparently not open-sourced yet, but the Tessel (http://tessel.io) folks do plan to open source their Lua-based JS interpreter for node, which is explicitly designed for low-memory micro controllers that are not capable of running v8.

paul99 commented Jan 11, 2014

Hi there -

That's a cool board. I wish the SoC had more ram. 64K is pretty small for v8.

So first off, try removing '-j8' as that is spinning up 8 threads, each of which launches d8, so it really slams your available memory.

Second, I am not sure what the command at the end was intended to be but "simple message" seems to be a typo. I would guess you meant "mjsunit". I used this command (on a little-endian board, hence "arch=mipsel")

 tools/test.py --no-build --arch=mipsel --mode=release --timeout=240 --verbose --time --report mjsunit

I am certain that you will not be able to run all tests. We had some trouble with certain tests & benchmarks even on a board with 256M. Many of our test boards now run 384MB.

However, I just ran the v8 benchmarks and took some memory stats. I had to remove the 'splay' test, as that test does a huge amount of memory allocation. (I commented out the load of splay in run.js):

// load('splay.js');

With that change, I ran the full suite, and here is the memory usage (from cat /proc//status):

VmPeak:    52000 kB
VmSize:    51344 kB
VmLck:         0 kB
VmHWM:     34928 kB
VmRSS:     33680 kB
VmData:    43552 kB
VmStk:       160 kB
VmExe:      3728 kB
VmLib:      3376 kB
VmPTE:       208 kB
VmSwap:        0 kB

It was down in the 43M range, for the first several tests, and only ramped up to 52M at the end.

So depending on your application, this could possibly work ok.

You also can play with these flag settings:

--max_new_space_size 
--max_old_space_size 
--max_executable_size

Note that for a stock linux build, max_old_space_size defaults to 700MB, and max_executable_size to 256MB.

By lowering these, you definitely won't run all tests, and large JS programs correctly, but it might beOK for your purposes if you just want to do some simple node stuff.

Finally, it is apparently not open-sourced yet, but the Tessel (http://tessel.io) folks do plan to open source their Lua-based JS interpreter for node, which is explicitly designed for low-memory micro controllers that are not capable of running v8.

@ksfltd

This comment has been minimized.

Show comment
Hide comment
@ksfltd

ksfltd Jan 13, 2014

Hi Paul,

In that command line simple message are names of the test suites from the test directory. Suggested mjsunit is not present in the test directory.
With the adjustments you suggested 280 of simple tests were executed [31:21|% 51|+ 281|- 30]
List of failed tests:

simple/test-buffer
simple/test-child-process-fork-dgram
simple/test-cluster-master-error
simple/test-crypto
simple/test-crypto-binary-default
simple/test-crypto-ecb
simple/test-crypto-padding
simple/test-crypto-padding-aes256
simple/test-crypto-stream
simple/helper-debugger-repl
simple/test-dgram-unref
simple/test-executable-path
simple/test-fs-read-file-sync
simple/test-fs-read-stream
simple/test-fs-readfile-pipe
simple/test-http-exit-delay
simple/test-https-client-resume

ksfltd commented Jan 13, 2014

Hi Paul,

In that command line simple message are names of the test suites from the test directory. Suggested mjsunit is not present in the test directory.
With the adjustments you suggested 280 of simple tests were executed [31:21|% 51|+ 281|- 30]
List of failed tests:

simple/test-buffer
simple/test-child-process-fork-dgram
simple/test-cluster-master-error
simple/test-crypto
simple/test-crypto-binary-default
simple/test-crypto-ecb
simple/test-crypto-padding
simple/test-crypto-padding-aes256
simple/test-crypto-stream
simple/helper-debugger-repl
simple/test-dgram-unref
simple/test-executable-path
simple/test-fs-read-file-sync
simple/test-fs-read-stream
simple/test-fs-readfile-pipe
simple/test-http-exit-delay
simple/test-https-client-resume
@paul99

This comment has been minimized.

Show comment
Hide comment
@paul99

paul99 Jan 13, 2014

Now I understand, you are in node/test dir, and I was referring to node/deps/v8/test. In that location you will find msjunit test suite. I think it might be worth trying to run those tests, and see how it goes. I strongly suspect that many will fail due to memory size, but it would be good to run the tests and post result, if you have the time.

I have not played seriously with node, and I have no idea how much memory it requires in addition to v8.

I do think that you may be able to get better results by playing with the memory-size flags I mentioned above. I do not know how to pass them in thru node test runner, but you can hard-code values in v8/src/flag-definitions.h and recompile.

I seriously doubt that you can find any setting that will get all tests to pass with only 64MB. V8 is not really intended for such a memory-contrained environment. The conservative view would be to reject its use if it cannot pass all tests. I certainly understand that. I'm not sure you can make it run well enough to create a generic node distro for the Carambola2 board.

But by playing with the memory flags you might be able to get it running good enough for your application. That decision would be up to you.

paul99 commented Jan 13, 2014

Now I understand, you are in node/test dir, and I was referring to node/deps/v8/test. In that location you will find msjunit test suite. I think it might be worth trying to run those tests, and see how it goes. I strongly suspect that many will fail due to memory size, but it would be good to run the tests and post result, if you have the time.

I have not played seriously with node, and I have no idea how much memory it requires in addition to v8.

I do think that you may be able to get better results by playing with the memory-size flags I mentioned above. I do not know how to pass them in thru node test runner, but you can hard-code values in v8/src/flag-definitions.h and recompile.

I seriously doubt that you can find any setting that will get all tests to pass with only 64MB. V8 is not really intended for such a memory-contrained environment. The conservative view would be to reject its use if it cannot pass all tests. I certainly understand that. I'm not sure you can make it run well enough to create a generic node distro for the Carambola2 board.

But by playing with the memory flags you might be able to get it running good enough for your application. That decision would be up to you.

@ksfltd

This comment has been minimized.

Show comment
Hide comment
@ksfltd

ksfltd Jan 15, 2014

Hi Paul

I ran the the msjunit test and only 40 test out of 3000+ were reported as failed.
There is a group of test which seems to fail because of the same problem - comparison of "weird" strings (# 2 in the list below). Do you have any idea what could be wrong?

1. Stack manipulations are not supported in this architecture.
    mjsunit/debug-liveedit-check-stack
    mjsunit/debug-liveedit-double-call
    mjsunit/debug-liveedit-restart-frame
    mjsunit/debug-liveedit-stack-padding

2. Possible string comparison error
    mjsunit/string-fromcharcode: Failure: expected <"ሴ"> found <"ሴ">
    mjsunit/string-index: Failure: expected <"Р§"> found <"Р§">
    mjsunit/string-slices: Failure: expected <"
"> found <"
">
    mjsunit/regress/regress-149: Failure: expected <"Й«"> found <"Й«">
    mjsunit/regress/regress-244: Failure: expected <"ВЂ"> found <"ВЂ">
    mjsunit/mjsunit.js: Failure (1186): expected <Гї> found <["Гї"]>

3. Crashes possibly caused by memory outage
    mjsunit/deep-recursion
    mjsunit/limit-locals
    mjsunit/mul-exhaustive

5. Other crashes
    mjsunit/unicode-test    --- CRASHED ---
    mjsunit/unicode-case-overoptimization   --- CRASHED ---
    mjsunit/regress/regress-1122    --- CRASHED ---
    mjsunit/regress/regress-1713.js --- CRASHED ---
    mjsunit/regress/regress-crbug-84186 --- CRASHED ---

6. Other failures
    mjsunit/delete: Failure (still here (128)): expected <true> found <false>

ksfltd commented Jan 15, 2014

Hi Paul

I ran the the msjunit test and only 40 test out of 3000+ were reported as failed.
There is a group of test which seems to fail because of the same problem - comparison of "weird" strings (# 2 in the list below). Do you have any idea what could be wrong?

1. Stack manipulations are not supported in this architecture.
    mjsunit/debug-liveedit-check-stack
    mjsunit/debug-liveedit-double-call
    mjsunit/debug-liveedit-restart-frame
    mjsunit/debug-liveedit-stack-padding

2. Possible string comparison error
    mjsunit/string-fromcharcode: Failure: expected <"ሴ"> found <"ሴ">
    mjsunit/string-index: Failure: expected <"Р§"> found <"Р§">
    mjsunit/string-slices: Failure: expected <"
"> found <"
">
    mjsunit/regress/regress-149: Failure: expected <"Й«"> found <"Й«">
    mjsunit/regress/regress-244: Failure: expected <"ВЂ"> found <"ВЂ">
    mjsunit/mjsunit.js: Failure (1186): expected <Гї> found <["Гї"]>

3. Crashes possibly caused by memory outage
    mjsunit/deep-recursion
    mjsunit/limit-locals
    mjsunit/mul-exhaustive

5. Other crashes
    mjsunit/unicode-test    --- CRASHED ---
    mjsunit/unicode-case-overoptimization   --- CRASHED ---
    mjsunit/regress/regress-1122    --- CRASHED ---
    mjsunit/regress/regress-1713.js --- CRASHED ---
    mjsunit/regress/regress-crbug-84186 --- CRASHED ---

6. Other failures
    mjsunit/delete: Failure (still here (128)): expected <true> found <false>
@dusmil

This comment has been minimized.

Show comment
Hide comment
@dusmil

dusmil Jan 15, 2014

Collaborator

The cause for the majority of failures above is missing sections for mips arch in test status files which specifiy expected outcomes of the particular test or specify if some test should be skipped. For example, on other architectures than x86, these debug-livedit-* tests have to be skipped.

I have updated the big-endian patch on dm-dev-mipsbe. The test status files are now updated with arch == mips clauses. Please update your code and hit another run of testing.

Collaborator

dusmil commented Jan 15, 2014

The cause for the majority of failures above is missing sections for mips arch in test status files which specifiy expected outcomes of the particular test or specify if some test should be skipped. For example, on other architectures than x86, these debug-livedit-* tests have to be skipped.

I have updated the big-endian patch on dm-dev-mipsbe. The test status files are now updated with arch == mips clauses. Please update your code and hit another run of testing.

@ksfltd

This comment has been minimized.

Show comment
Hide comment
@ksfltd

ksfltd Jan 15, 2014

Thanks Dusan, I do as you suggest.
Meanwhile I got all node tests executed.
Failed 56 out of 550 tests and only one crashed with OOM

1. Possible socket issues
    simple/test-dgram-bind-default-address: EAFNOSUPPORT
    simple/test-dgram-broadcast-multi-process: Responses were not received within 5000 ms.
    simple/test-dgram-udp4: server is listening on 0.0.0.0:20989 Error: Timeout
    simple/test-dgram-unref: AssertionError: Unrefd socket should not hold loop open
    simple/test-net-GH-5504: Error: hang
    simple/test-net-pingpong: Error: listen EAFNOSUPPORT
    simple/test-net-server-unref: AssertionError: Unrefd socket should not hold loop open
    simple/test-net-settimeout: AssertionError: false == true
    simple/test-http-end-throw-socket-handling: Error: Taking too long!

2. Possible test/comparison errors
    simple/test-buffer: AssertionError: [0,252,0,98,0,101,0,114] deepEqual [252,0,98,0,101,0,114,0]
    simple/test-fs-read-file-sync: AssertionError: "…" == "…"
    simple/test-fs-read-stream: AssertionError: "…" == "…"
    simple/test-https-strict: AssertionError: "CERT_NOT_YET_VALID" == "Hostname/IP doesn't match certificate's altnames"
    simple/test-module-loading-error: AssertionError: -1 != -1
    simple/test-net-binary: '\377' "ÿ" "ÿ" 255 AssertionError: false == true
    simple/test-punycode: AssertionError: "ü" == "ü"
    simple/test-querystring: AssertionError: {"foo":"�"} deepEqual {"foo":"�"}
    simple/test-readline-interface: AssertionError: "☮" == "☮"
    simple/test-setproctitle: AssertionError: "  PID USER       VSZ STAT COMMAND\n    1 root      1516 S    init\n    2 root         0 SW   [kthreadd]\n    3 root         0 S == "testme"
    simple/test-stream2-readable-empty-buffer-no-eof: AssertionError: ["xxxxx"] deepEqual ["xxxxx","xxxxx","EOF"]
    simple/test-string-decoder: AssertionError: "¢" deepEqual "¢"
    simple/test-string-decoder-end:  AssertionError: one byte at a time should match toString
    simple/test-writedouble: AssertionError: 248 == 247
    simple/test-writefloat: AssertionError: 192 == 159

3. Crypto librarty issues
    simple/test-crypto: Error: mac verify failure
    simple/test-crypto-binary-default: Error: mac verify failure
    simple/test-crypto-ecb: AssertionError: "05EEA688F732F8D3F0A7DF6D0C04CEE6" == "6D385F424AAB0CFBF0BB86E07FFB7D71"
    simple/test-crypto-padding: AssertionError: "dcf075e557ed1c2ad88fb14fce4fa3aa0ec44ef16a32d6d95cf7391dc0c6a648" == "7f57859550d4d2fdb9806da2a750461a9fe77253cd1cbd4b07beee4e070d561f"
    simple/test-crypto-padding-aes256: AssertionError: "�\n;f3\u0001&�\u000b�y��]M��\n;f3\u0001&�\u000b�y��]M�" == "0123456789abcdef0123456789abcdef"
    simple/test-crypto-stream: AssertionError: "74da4121dc1c0ed2a8e5b0741f824034" == "06460dadb35d3d503047ce750ceb2d07"

4. Possible debugger issues
    simple/test-debugger-repl: AssertionError: < debugger listening on port  != /listening on port \d+/
    simple/test-debugger-repl-break-in-module: 
    simple/test-debugger-repl-restart:
    simple/test-debugger-repl-utf8

5. Other issues
    simple/test-child-process-fork-dgram: AssertionError: false == true
    simple/test-child-process-fork-net2: --- TIMEOUT --
    simple/test-cluster-master-error: AssertionError: The workers did not die after an error in the master
    simple/test-force-repl: Error: timeout
    simple/test-fs-readfile-pipe: Error: ENOENT, open '/dev/stdin'
    simple/test-http-exit-delay: AssertionError: false == true
    simple/test-https-client-reject: AssertionError: false == true
    simple/test-https-client-resume: AssertionError: Session *should* be reused.
    simple/test-https-no-reader.js: --- CRASHED --- Out Of Memory
    simple/test-https-pfx: Error: mac verify failure
    simple/test-module-loading.js: AssertionError: null == true
    simple/test-next-tick-error-spin: Error: child is hung
    simple/test-next-tick-starvation: Error: The timer is starving
    simple/test-pipe-unref: AssertionError: Unrefd socket should not hold loop open
    simple/test-timers-unref: TypeError: undefined is not a function
    simple/test-tls-client-reject: Error: CERT_NOT_YET_VALID
    simple/test-tls-client-resume: AssertionError: Session *should* be reused.
    simple/test-tls-client-verify: AssertionError: true == false
    simple/test-tls-fast-writing: not ok - timed out
    simple/test-tls-passphrase: Error: socket hang up
    simple/test-tls-server-verify: AssertionError: agent1 rejected, but should NOT have been
    simple/test-tls-sni-server-client: AssertionError: [false,false,false] deepEqual [true,true,false]

ksfltd commented Jan 15, 2014

Thanks Dusan, I do as you suggest.
Meanwhile I got all node tests executed.
Failed 56 out of 550 tests and only one crashed with OOM

1. Possible socket issues
    simple/test-dgram-bind-default-address: EAFNOSUPPORT
    simple/test-dgram-broadcast-multi-process: Responses were not received within 5000 ms.
    simple/test-dgram-udp4: server is listening on 0.0.0.0:20989 Error: Timeout
    simple/test-dgram-unref: AssertionError: Unrefd socket should not hold loop open
    simple/test-net-GH-5504: Error: hang
    simple/test-net-pingpong: Error: listen EAFNOSUPPORT
    simple/test-net-server-unref: AssertionError: Unrefd socket should not hold loop open
    simple/test-net-settimeout: AssertionError: false == true
    simple/test-http-end-throw-socket-handling: Error: Taking too long!

2. Possible test/comparison errors
    simple/test-buffer: AssertionError: [0,252,0,98,0,101,0,114] deepEqual [252,0,98,0,101,0,114,0]
    simple/test-fs-read-file-sync: AssertionError: "…" == "…"
    simple/test-fs-read-stream: AssertionError: "…" == "…"
    simple/test-https-strict: AssertionError: "CERT_NOT_YET_VALID" == "Hostname/IP doesn't match certificate's altnames"
    simple/test-module-loading-error: AssertionError: -1 != -1
    simple/test-net-binary: '\377' "ÿ" "ÿ" 255 AssertionError: false == true
    simple/test-punycode: AssertionError: "ü" == "ü"
    simple/test-querystring: AssertionError: {"foo":"�"} deepEqual {"foo":"�"}
    simple/test-readline-interface: AssertionError: "☮" == "☮"
    simple/test-setproctitle: AssertionError: "  PID USER       VSZ STAT COMMAND\n    1 root      1516 S    init\n    2 root         0 SW   [kthreadd]\n    3 root         0 S == "testme"
    simple/test-stream2-readable-empty-buffer-no-eof: AssertionError: ["xxxxx"] deepEqual ["xxxxx","xxxxx","EOF"]
    simple/test-string-decoder: AssertionError: "¢" deepEqual "¢"
    simple/test-string-decoder-end:  AssertionError: one byte at a time should match toString
    simple/test-writedouble: AssertionError: 248 == 247
    simple/test-writefloat: AssertionError: 192 == 159

3. Crypto librarty issues
    simple/test-crypto: Error: mac verify failure
    simple/test-crypto-binary-default: Error: mac verify failure
    simple/test-crypto-ecb: AssertionError: "05EEA688F732F8D3F0A7DF6D0C04CEE6" == "6D385F424AAB0CFBF0BB86E07FFB7D71"
    simple/test-crypto-padding: AssertionError: "dcf075e557ed1c2ad88fb14fce4fa3aa0ec44ef16a32d6d95cf7391dc0c6a648" == "7f57859550d4d2fdb9806da2a750461a9fe77253cd1cbd4b07beee4e070d561f"
    simple/test-crypto-padding-aes256: AssertionError: "�\n;f3\u0001&�\u000b�y��]M��\n;f3\u0001&�\u000b�y��]M�" == "0123456789abcdef0123456789abcdef"
    simple/test-crypto-stream: AssertionError: "74da4121dc1c0ed2a8e5b0741f824034" == "06460dadb35d3d503047ce750ceb2d07"

4. Possible debugger issues
    simple/test-debugger-repl: AssertionError: < debugger listening on port  != /listening on port \d+/
    simple/test-debugger-repl-break-in-module: 
    simple/test-debugger-repl-restart:
    simple/test-debugger-repl-utf8

5. Other issues
    simple/test-child-process-fork-dgram: AssertionError: false == true
    simple/test-child-process-fork-net2: --- TIMEOUT --
    simple/test-cluster-master-error: AssertionError: The workers did not die after an error in the master
    simple/test-force-repl: Error: timeout
    simple/test-fs-readfile-pipe: Error: ENOENT, open '/dev/stdin'
    simple/test-http-exit-delay: AssertionError: false == true
    simple/test-https-client-reject: AssertionError: false == true
    simple/test-https-client-resume: AssertionError: Session *should* be reused.
    simple/test-https-no-reader.js: --- CRASHED --- Out Of Memory
    simple/test-https-pfx: Error: mac verify failure
    simple/test-module-loading.js: AssertionError: null == true
    simple/test-next-tick-error-spin: Error: child is hung
    simple/test-next-tick-starvation: Error: The timer is starving
    simple/test-pipe-unref: AssertionError: Unrefd socket should not hold loop open
    simple/test-timers-unref: TypeError: undefined is not a function
    simple/test-tls-client-reject: Error: CERT_NOT_YET_VALID
    simple/test-tls-client-resume: AssertionError: Session *should* be reused.
    simple/test-tls-client-verify: AssertionError: true == false
    simple/test-tls-fast-writing: not ok - timed out
    simple/test-tls-passphrase: Error: socket hang up
    simple/test-tls-server-verify: AssertionError: agent1 rejected, but should NOT have been
    simple/test-tls-sni-server-client: AssertionError: [false,false,false] deepEqual [true,true,false]
@ksfltd

This comment has been minimized.

Show comment
Hide comment
@ksfltd

ksfltd Jan 16, 2014

Hello,

I rerun the tests with Dunsan's changed and now group mjsunit/debug-liveedit-* reported as passed

ksfltd commented Jan 16, 2014

Hello,

I rerun the tests with Dunsan's changed and now group mjsunit/debug-liveedit-* reported as passed

@Zysen

This comment has been minimized.

Show comment
Hide comment
@Zysen

Zysen Feb 12, 2014

Also to anyone still struggling to get this going. I wrote this script to do it all for you.

Just specify your mips toolchain and prefix at the top.

clear
TCPATH=/usr/share/toolchain/[toolchain_dir]/
PREFIX=${TCPATH}usr/bin/mips-linux-
LIBPATH=${TCPATH}/usr/lib

NODE_BRANCH="v0.10.5-release"
#NODE_BRANCH="v0.11.9-release" # This version needs to wait for the V8 branch to catch up

BASEWD=$(pwd)

echo "Building V8 and NodeJS ${NODE_BRANCH}\n"

#Configure Environment for V8
export CC=${PREFIX}gcc
export CXX=${PREFIX}g++
export AR=${PREFIX}ar
export LD=${PREFIX}mips-linux-ld-2.18
export RANLIB=${PREFIX}ranlib
export LINK=${PREFIX}g++
export GYPFLAGS="-Dv8_use_mips_abi_hardfloat=false -Dv8_can_use_fpu_instructions=false"

#Build V8 as a shared library

if [ ! -d "v8m-rb" ]; then
    git clone git://github.com/paul99/v8m-rb.git -b dm-dev-mipsbe
    cd v8m-rb
else
    cd v8m-rb
    git pull
fi

svn co http://gyp.googlecode.com/svn/trunk build/gyp
make dependencies

make clean
make distclean
make mips.release component=shared_library snapshot=off -j4

cd ..
#Configure Environment for Node
export LD=${PREFIX}g++
export LDFLAGS=-L${LIBPATH}
export LDFLAGS='-Wl,-rpath-link '${LIBPATH}

if [ ! -d "node" ]; then
    git clone git://github.com/joyent/node.git -b ${NODE_BRANCH}
    cd node
else
    cd node
    git pull
fi

ls
echo "Building Node"
#Build NodeJS
make clean
make distclean
./configure --without-snapshot --shared-v8 --shared-v8-includes=${BASEWD}/v8m-rb/include/ --shared-v8-libpath=${BASEWD}/v8m-rb/out/mips.release/lib.target --dest-cpu=mips

make snapshot=off -j4

cd ..
echo "Staging files"
if [ ! -d "out" ]; then
    mkdir out
fi
mv ${BASEWD}/v8m-rb/out/mips.release/lib.target/libv8.so ${BASEWD}/out/libv8.so
mv ${BASEWD}/node/out/Release ${BASEWD}/out/node
echo "Complete"

Zysen commented Feb 12, 2014

Also to anyone still struggling to get this going. I wrote this script to do it all for you.

Just specify your mips toolchain and prefix at the top.

clear
TCPATH=/usr/share/toolchain/[toolchain_dir]/
PREFIX=${TCPATH}usr/bin/mips-linux-
LIBPATH=${TCPATH}/usr/lib

NODE_BRANCH="v0.10.5-release"
#NODE_BRANCH="v0.11.9-release" # This version needs to wait for the V8 branch to catch up

BASEWD=$(pwd)

echo "Building V8 and NodeJS ${NODE_BRANCH}\n"

#Configure Environment for V8
export CC=${PREFIX}gcc
export CXX=${PREFIX}g++
export AR=${PREFIX}ar
export LD=${PREFIX}mips-linux-ld-2.18
export RANLIB=${PREFIX}ranlib
export LINK=${PREFIX}g++
export GYPFLAGS="-Dv8_use_mips_abi_hardfloat=false -Dv8_can_use_fpu_instructions=false"

#Build V8 as a shared library

if [ ! -d "v8m-rb" ]; then
    git clone git://github.com/paul99/v8m-rb.git -b dm-dev-mipsbe
    cd v8m-rb
else
    cd v8m-rb
    git pull
fi

svn co http://gyp.googlecode.com/svn/trunk build/gyp
make dependencies

make clean
make distclean
make mips.release component=shared_library snapshot=off -j4

cd ..
#Configure Environment for Node
export LD=${PREFIX}g++
export LDFLAGS=-L${LIBPATH}
export LDFLAGS='-Wl,-rpath-link '${LIBPATH}

if [ ! -d "node" ]; then
    git clone git://github.com/joyent/node.git -b ${NODE_BRANCH}
    cd node
else
    cd node
    git pull
fi

ls
echo "Building Node"
#Build NodeJS
make clean
make distclean
./configure --without-snapshot --shared-v8 --shared-v8-includes=${BASEWD}/v8m-rb/include/ --shared-v8-libpath=${BASEWD}/v8m-rb/out/mips.release/lib.target --dest-cpu=mips

make snapshot=off -j4

cd ..
echo "Staging files"
if [ ! -d "out" ]; then
    mkdir out
fi
mv ${BASEWD}/v8m-rb/out/mips.release/lib.target/libv8.so ${BASEWD}/out/libv8.so
mv ${BASEWD}/node/out/Release ${BASEWD}/out/node
echo "Complete"
@Zysen

This comment has been minimized.

Show comment
Hide comment
@Zysen

Zysen Jun 17, 2014

Has anybody had any luck getting a version of Node > 0.10.22 working with Mips big endian ? I managed to get it working with 0.10.5 but i have since discovered that this version was full of memory leaks.
Any advice would be appreciated.

Zysen commented Jun 17, 2014

Has anybody had any luck getting a version of Node > 0.10.22 working with Mips big endian ? I managed to get it working with 0.10.5 but i have since discovered that this version was full of memory leaks.
Any advice would be appreciated.

@ffissore

This comment has been minimized.

Show comment
Hide comment
@ffissore

ffissore Jun 17, 2014

Here https://github.com/arduino/openwrt-packages-yun/tree/master/arduino are OpenWrt Makefiles for v8m-rb and node 0.10.28

Here https://github.com/arduino/openwrt-packages-yun/tree/master/arduino are OpenWrt Makefiles for v8m-rb and node 0.10.28

@Zysen

This comment has been minimized.

Show comment
Hide comment
@Zysen

Zysen Jun 17, 2014

Thank You Ffissore!

Zysen commented Jun 17, 2014

Thank You Ffissore!

@paul99 paul99 referenced this pull request Aug 12, 2014

Closed

mips64 (big endian) support #94

@nneves nneves referenced this pull request in nneves/openwrt_mips_ar9331_nodejs Feb 23, 2015

Closed

npm script #2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment