v8mips / v8mips

Port of Google v8 javascript engine to mips architecture
https://github.com/v8mips/v8mips/wiki
Other
167 stars 31 forks source link

Test & fix compilation with gcc4.6 #15

Closed paul99 closed 11 years ago

paul99 commented 12 years ago

We have at least one bug with gcc 4.6, which is more picky about unused variables than previous revisions.

src/mips/code-stubs-mips.cc: In member function 'void v8::internal::BinaryOpStub::GenerateSmiCode( ... ) 
src/mips/code-stubs-mips.cc:2757:12: error: variable 'scratch2' set but not used [-Werror=unused-but-set-variable]
src/mips/code-stubs-mips.cc: In member function 'virtual void v8::internal::TranscendentalCacheStub::Generate( ... )':
src/mips/code-stubs-mips.cc:3462:20: error: variable 'heap_number_map' set but not used [-Werror=unused-but-set-variable]

Can you guys please get a 4.6 compiler, and create a single changset to update mips port. From looking at v8-users archive, I think rest of v8 is now clean regarding these warnings.

paul99 commented 12 years ago

Here is the complete list from a colleague of mine:

code-stubs-mips.cc:2757:12: error: variable 'scratch2' set but not used
[-Werror=unused-but-set-variable]

code-stubs-mips.cc:3462:20: error: variable 'heap_number_map' set but
not used [-Werror=unused-but-set-variable]

full-codegen-mips.cc:3649:12: error: variable 'scratch4' set but not
used [-Werror=unused-but-set-variable]

lithium-codegen-mips.cc:2826:12: error: variable 'context' set but not
used [-Werror=unused-but-set-variable]

lithium-codegen-mips.cc:4127:18: error: variable 'double_scratch' set
but not used [-Werror=unused-but-set-variable]

lithium-mips.cc:1463:18: error: variable 'r' set but not used
[-Werror=unused-but-set-variable]

stub-cache-mips.cc:1173:12: error: variable 'reg' set but not used
[-Werror=unused-but-set-variable]

stub-cache-mips.cc:4233:12: error: variable 'scratch3' set but not used
[-Werror=unused-but-set-variable]

I've not personally verified this. I'm trying to get a 4.6 compiler installed now.

Gergely, I would like to get this fixed and upstreamed to google as soon as possible, but I think that one of us should test it ourselves, and not rely on this list.

kalmard commented 12 years ago

I verified these errors using gcc 4.6 (mips simulator target), the fix is in commit https://github.com/paul99/v8m-rb/commit/553ced2bd77b5eeb9b6f727e0e4c40a98f1288e0 .

Also submitted to google: http://codereview.chromium.org/10253004/

palfia commented 12 years ago

I think, that it would be a good idea to also compile v8 for mips target (not just for simulator) using gcc 4.6, so I tried get a working gcc 4.6 cross-compiler.

Unfortunately, I did not find any pre-built gcc 4.6 toolchain for mips, even the latest CodeSourcery toolchain is based on 4.5. I found a nice toolchain builder script at: http://developer.mips.com/tools/compilers/open-source-toolchain-linux , but it failed to create a gcc 4.6 based toolchain with the example parameters at the bottom of the page. I tried several things to get it work, like porting the gcc 4.4 patch to 4.6.1 and fixing some parameters in the script, but it always failed at gcc phase 3. After the unsuccessful attempts with the builder script, I've compiled a gcc 4.6 toolchain manually (mostly based on the documentation from the cross linux from scratch project).

Finally, I've successfully compiled the latest bleeding_edge with my cross gcc 4.6 toolchain for mips target without any errors.

paul99 commented 12 years ago

Akos, thanks for the complete testing. I was worried a bit about this also. Very nice effort in building the toolchain!!

Also, a colleauge of mine had mips Debian 'testing' version which also uses 4.6.3, as a mips native compiler. This is where I first saw the problem, and I have pulled the patch that was submitted, and built there as well. So I think we are well-covered.

Now, any idea how to test on 4.7, which apparently is also out? I am fine with a sim build, to start, no need to build cross-toolchain. I'm wondering if maybe it is out for 12.04 Ubuntu? Here is a guy that has a PPA repo with lots of compilers, but I think these are 32-bit: https://launchpad.net/~doko/+ppa-packages

Not urgent to test on 4.7, but nice, if we have some time. The rest of v8 may also have issues. We could either fix or file bugs.

paul99 commented 11 years ago

We have submitted the change need for 4.6 in e3ccfdf. I have been recently compiling with 4.7. No issues there. Closing.