bnoordhuis / v8-cmake

The V8 JavaScript engine, but built with CMake instead of GN - WIP
BSD 3-Clause "New" or "Revised" License
188 stars 53 forks source link

support more cpu architectures #5

Open bnoordhuis opened 4 years ago

bnoordhuis commented 4 years ago

See https://github.com/nodejs/build/issues/2139 - until it's possible to use the Node.js CI, try to hack up support through qemu + cross-compiler toolchains.

Can run on GH Actions. Can perhaps even test d8 through qemu-user but it's okay if that doesn't work.

The architectures supported (for varying definitions of "supported") by Node.js:

$ ./configure --help | grep -A2 dest-cpu
  --dest-cpu=DEST_CPU   CPU architecture to build for (arm, arm64, ia32, mips,
                        mipsel, mips64el, ppc, ppc64, x32, x64, x86, x86_64,
                        s390x)

Realistically, I'd say that arm, arm64, ppc64 and s390x are the most important besides x86_64.

petebannister commented 3 years ago

I've a need to build v8 for x86 + x64. I've been keeping an eye on this repo for a while as pretty fed up with GN / depot_tools breaking every time I go to rebuild an old v8 version and the unencouraging compile times.. Previously with v8 I used the ia32 build for x86.. I appear to have got that working. I've put that in a fork: https://github.com/petebannister/v8-cmake/releases/tag/8.7.220.24b (or master)

I'm still working on getting this packaging how I want from a conan recipe now for x86 + x64 debug/release (MSVC2019). Since I've upgraded v8 version also it remains to be seen how much rework of the host application will be needed before I can have any certainty the build is actually OK... but both x64 and x86 (ia-32) are building.

I also made some other changes to use pre-compiled headers and reduce the build time a tad. Undoubtedly could be improved.. I could do with some tools for profiling which headers would be good PCH candidates.. but for the moment it feels a lot quicker.

If this is useful to you, the commits I made there are a bit dirty you may prefer to cherry pick for a cleaner history. OR let me know if you want a pull request (I've never actually done a PR so let me know)

bnoordhuis commented 3 years ago

A pull request would be welcome. Using precompiled headers is something I can consider but can you file that as a separate pull request? Thanks.

petebannister commented 3 years ago

Will see what I can do - probably not until next week