|
- #!/bin/bash
-
- set -ex
-
- # I guess now we have to install ninja ourselves.. sigh..
- git clone https://github.com/ninja-build/ninja.git
- pushd ninja
- git checkout v1.11.1
-
- cmake -Bbuild-cmake
- cmake --build build-cmake
-
- export PATH=`pwd`/build-cmake:"$PATH" # ninja available now
-
- popd
-
- export PATH=`pwd`/depot_tools:"$PATH" # depot tools available now (used to include ninja)
-
- # https://github.com/prahladyeri/tuxdrive/issues/3
- apt-get install python3-pip -y
- pip3 install httplib2 --upgrade --break-system-packages
-
- fetch v8
-
- cd v8 # if this fails, exit! hence the set -ex
-
- #gclient sync -r 6.9.427.6 # 55da769bafac8b531cd8b388df56161b8b7c6416
- #gclient sync -r 7.1.69 #
- #gclient sync -r lkgr/6.9
- #gclient sync -r 6.9.427.13 # https://ci.appveyor.com/project/pmed/v8pp
- #gclient sync -r 7.5.288.23 # https://github.com/pmed/v8-nuget/
- #gclient sync -r 8.0.426.15 # stupid test
- #gclient sync -r 7.2.1 # stupid test
- #gclient sync -r 8.2.297.1 # https://github.com/pmed/v8-nuget/
- #gclient sync -r 9.3.345.3 # https://github.com/pmed/v8-nuget/
- #gclient sync -r 10.0.139.9 # https://github.com/pmed/v8-nuget/
- gclient sync -r 11.9.169.4 # https://github.com/pmed/v8-nuget/
-
- # Looks like we have to use GN now: https://github.com/v8/v8/wiki/Building-with-GN
-
- # initial build
- # temp
- #rm -rf out/x64.release
-
- #alias gm=$PWD/tools/dev/gm.py
- # whatever, it said,
- #+ alias gm=/var/lib/go-agent/pipelines/v8pp-ubuntu2404/v8pp/v8/tools/dev/gm.py
- #+ gm x64.release
- #./build-v8.sh: line 46: gm: command not found
- # so f*ck the alias
-
- $PWD/tools/dev/gm.py x64.release
-
- # we don't want std::_Cr, but std::__1 like everybody else is using
- # note that this is only relevant if use_custom_libcxx = true.
- # unfortunately I don't know how to specify v8 to use libc++ from the system
- # I asked a question about this here: https://groups.google.com/forum/#!topic/v8-users/Do5MvAvYFgs
- sed -i.bak 's/_LIBCPP_ABI_VERSION=Cr/_LIBCPP_ABI_VERSION=1/' build/config/c++/BUILD.gn
-
- # https://groups.google.com/g/v8-dev/c/AJjIyKMpFmA
- sed -i.bak 's/"-Wctad-maybe-unsupported"//' BUILD.gn
-
- # workaround, see notes.txt
- echo "v8_enable_embedded_builtins = false" | tee -a out/x64.release/args.gn
- echo "v8_use_external_startup_data = false" | tee -a out/x64.release/args.gn
- echo "v8_use_snapshot = false" | tee -a out/x64.release/args.gn
- echo "v8_enable_gdbjit = true" | tee -a out/x64.release/args.gn
- # set below to true to make it use libc++ (although it will use the one it is bundled with,
- # and also it will enable unsafe abi stuff, which means basically alpha features afaik)
- echo "use_custom_libcxx = false" | tee -a out/x64.release/args.gn
- # possibly they use a different version of clang compiling v8.
- # however, I already set my own, probably newer clang version.
- # ran into: https://groups.google.com/forum/#!topic/v8-users/Jb1VSouy2Z0
- #echo "is_clang = false" | tee -a out/x64.release/args.gn
- # setting to true now, and see if we use this clang on starcry if it works..
- echo "is_clang = true" | tee -a out/x64.release/args.gn
-
- # the only remaining issue was: undefined reference to `typeinfo for v8::ArrayBuffer::Allocator'
- # this is the case with (gnu) libstd++ , only remaining issue for me
- # https://github.com/danbev/learning-v8/pull/4
- echo "use_rtti = true" | tee -a out/x64.release/args.gn
-
- # produce monolith (single static all in one .a file)
- echo "v8_monolithic = true" | tee -a out/x64.release/args.gn
- ninja -C out/x64.release v8_monolith
-
- # produce .so files (shared libs)
- # temporary disable the .so files (I'm not using them for now, and they are slow to build)
- #sed -i.bak '/^v8_monolithic/d' out/x64.release/args.gn
- #echo "is_component_build = true" | tee -a out/x64.release/args.gn
- #ninja -C out/x64.release
|