Patch so add MIPS support to v8-9999. Builds and runs at least with my tested mipsel-softfloat-linux-gnu toolchain on real mips hardware. Reproducible: Always
Created attachment 352920 [details, diff] MIPS support for v8-9999 ebuild
Thanks! +*v8-3.19.18.9 (10 Jul 2013) + + 10 Jul 2013; Mike Gilbert <floppym@gentoo.org> +v8-3.19.18.9.ebuild, + -v8-3.19.17.ebuild, v8-9999.ebuild: + Dev channel bump. Add build support for mips, bug 476272; patch by Manuel + Lauss.
Is this an upstream patch? I notice it bails out if it's big endian or mips64, which we can handle by hard masking it on certain profiles, but then I saw this: if [[ ${CHOST} == *loongson* ]] ; then erf. Now we need to set our CHOST differently on loongson systems for this to work right?
(In reply to Matt Turner from comment #3) > Is this an upstream patch? > The patch just adds some logic to toggle various gyp flags. The relevent gyp section is here: https://code.google.com/p/v8/source/browse/trunk/build/common.gypi#323
(In reply to Matt Turner from comment #3) > if [[ ${CHOST} == *loongson* ]] ; then > > erf. Now we need to set our CHOST differently on loongson systems for this > to work right? It looks like passing mips_arch_variant=loongson flag causes '-mips3 -Wa,-mips3' to be added to CFLAGS. If there is a better way to handle this, great.
(In reply to Matt Turner from comment #3) > Is this an upstream patch? > > I notice it bails out if it's big endian or mips64, which we can handle by > hard masking it on certain profiles, but then I saw this: > > if [[ ${CHOST} == *loongson* ]] ; then > > erf. Now we need to set our CHOST differently on loongson systems for this > to work right? I just added loongson because the gyp files have it in there. Better 64bit MIPS support likely needs a few more adjustments in the v8 source/gyp files. Right now I can only test mips32.
(In reply to Manuel Lauss from comment #6) > (In reply to Matt Turner from comment #3) > > Is this an upstream patch? > > > > I notice it bails out if it's big endian or mips64, which we can handle by > > hard masking it on certain profiles, but then I saw this: > > > > if [[ ${CHOST} == *loongson* ]] ; then > > > > erf. Now we need to set our CHOST differently on loongson systems for this > > to work right? > > I just added loongson because the gyp files have it in there. Better 64bit > MIPS support likely needs a few more adjustments in the v8 source/gyp files. > Right now I can only test mips32. The loongson image we're supporting has the following CFLAGS="-O2 -march=loongson2f -Wa,-mfix-loongson2f-nop -pipe" CXXFLAGS="${CFLAGS}" CHOST="mips64el-unknown-linux-gnu" The patch in comment 1 would not match correctly. It matches on ${CHOST} == mips*el* and gives myarch="mipsel" which is not what we want.
(In reply to Anthony Basile from comment #7) > (In reply to Manuel Lauss from comment #6) > > (In reply to Matt Turner from comment #3) > > > Is this an upstream patch? > > > > > > I notice it bails out if it's big endian or mips64, which we can handle by > > > hard masking it on certain profiles, but then I saw this: > > > > > > if [[ ${CHOST} == *loongson* ]] ; then > > > > > > erf. Now we need to set our CHOST differently on loongson systems for this > > > to work right? > > > > I just added loongson because the gyp files have it in there. Better 64bit > > MIPS support likely needs a few more adjustments in the v8 source/gyp files. > > Right now I can only test mips32. > > The loongson image we're supporting has the following > > CFLAGS="-O2 -march=loongson2f -Wa,-mfix-loongson2f-nop -pipe" > CXXFLAGS="${CFLAGS}" > CHOST="mips64el-unknown-linux-gnu" > > The patch in comment 1 would not match correctly. It matches on ${CHOST} == > mips*el* and gives myarch="mipsel" which is not what we want. okay i'll change the patch to only support mips32 and i'll leave 64bit/micromips support to you imgtec guys :)
Created attachment 352986 [details, diff] support little-endian MIPS32 toolchains in v8-9999.ebuild Support little-endian MIPS32 toolchain in v8-9999 ebuild
(In reply to Manuel Lauss from comment #6) > > > > The patch in comment 1 would not match correctly. It matches on ${CHOST} == > > mips*el* and gives myarch="mipsel" which is not what we want. > > okay i'll change the patch to only support mips32 and i'll leave > 64bit/micromips support to you imgtec guys :) We'll have to think about how to match on the loongson because mips64el-unknown-linux-gnu-gcc -mips3 -mabi=32 -o test test.c works just fine to create LE mipsIII o32 elfs, but would bail out saying die "generic MIPS 64bit is not yet supported" using your first patch. Matching on CHOST is really not correct anyhow. The v8 build system should test if it can use the toolchain to build its most preferred set of cflags and the drop accordingly. The CHOST does not specify all the possibilities. The real problem I'm having here is, why does v8 not build for 64-bits or BE? Is there asm in there? Are there alignment problems? These should be addressed because the default for the loongson is (and should remain) ABI=n32. Last point, falling back on myconf+=" -Dmips_arch_variant=mips32" if the CHOST doesn't match 32r2 may be a problem because not all 32-bit mips can handle arch=mips32. Most can so let's cross that bridge if we hit it.
(In reply to Anthony Basile from comment #10) > (In reply to Manuel Lauss from comment #6) > > > > > > The patch in comment 1 would not match correctly. It matches on ${CHOST} == > > > mips*el* and gives myarch="mipsel" which is not what we want. > > > > okay i'll change the patch to only support mips32 and i'll leave > > 64bit/micromips support to you imgtec guys :) > > We'll have to think about how to match on the loongson because > > mips64el-unknown-linux-gnu-gcc -mips3 -mabi=32 -o test test.c > > works just fine to create LE mipsIII o32 elfs, but would bail out saying die > "generic MIPS 64bit is not yet supported" using your first patch. Matching > on CHOST is really not correct anyhow. The v8 build system should test if > it can use the toolchain to build its most preferred set of cflags and the > drop accordingly. The CHOST does not specify all the possibilities. > > The real problem I'm having here is, why does v8 not build for 64-bits or > BE? Is there asm in there? Are there alignment problems? These should be > addressed because the default for the loongson is (and should remain) > ABI=n32. > > Last point, falling back on myconf+=" -Dmips_arch_variant=mips32" if the > CHOST doesn't match 32r2 may be a problem because not all 32-bit mips can > handle arch=mips32. Most can so let's cross that bridge if we hit it. I haven't checked the v8 source thoroughly it be and 64 bit are indeed implemented (if loongson is supported, I guess 64bit is in there somewhere). I only wanted to get 32bit working since that is the only hardware I have to test it on. I won't submit patches enabling stuff I can't test.
What is the status here? I see two patches, and a following discussion. I'm fine with taking some patch isolated to MIPS, just let me know which one. Do you also want a ~mips keyword on the latest v8 dev channel ebuild?
I think this was fixed in v8-3.19.18.9.