You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

113 lines
4.7KB

  1. #!/bin/bash
  2. # I guess now we have to install ninja ourselves.. sigh..
  3. git clone https://github.com/ninja-build/ninja.git || true
  4. pushd ninja
  5. git checkout v1.11.1
  6. cmake -Bbuild-cmake
  7. cmake --build build-cmake
  8. export PATH=`pwd`/build-cmake:"$PATH" # ninja available now
  9. popd
  10. export PATH=`pwd`/depot_tools:"$PATH" # depot tools available now (used to include ninja)
  11. # https://github.com/prahladyeri/tuxdrive/issues/3
  12. apt-get install python3-pip -y
  13. pip3 install httplib2 --upgrade --break-system-packages
  14. fetch v8 # || gclient sync
  15. # fetch v8 || gclient sync
  16. cd v8 # if this fails, exit! hence the set -ex
  17. #gclient sync -r 6.9.427.6 # 55da769bafac8b531cd8b388df56161b8b7c6416
  18. #gclient sync -r 7.1.69 #
  19. #gclient sync -r lkgr/6.9
  20. #gclient sync -r 6.9.427.13 # https://ci.appveyor.com/project/pmed/v8pp
  21. #gclient sync -r 7.5.288.23 # https://github.com/pmed/v8-nuget/
  22. #gclient sync -r 8.0.426.15 # stupid test
  23. #gclient sync -r 7.2.1 # stupid test
  24. #gclient sync -r 8.2.297.1 # https://github.com/pmed/v8-nuget/
  25. #gclient sync -r 9.3.345.3 # https://github.com/pmed/v8-nuget/
  26. gclient sync -r 10.0.139.9 # https://github.com/pmed/v8-nuget/
  27. #gclient sync -r 11.9.169.4 # https://github.com/pmed/v8-nuget/
  28. #gclient sync -r 13.0.245.25
  29. # N/m couldn't get this to work, let's just not build inside docker for v8
  30. # # patch for a bug w/r/t uids on files
  31. # # # see: https://superuser.com/a/1435438
  32. # #
  33. # #e.g.
  34. # #
  35. # #tar: ./usr/lib: Cannot change ownership to uid 376730, gid 89939: Invalid argument
  36. # #tar: ./usr/bin: Cannot change ownership to uid 376730, gid 89939: Invalid argument
  37. # #...
  38. # # subprocess.CalledProcessError: Command '['tar', 'mxf', '/home/trigen/projects/build-config/v8pp/v8/build/linux/debian_bullseye_i386-sysroot/debian_bullseye_i386_sysroot.tar.xz', '-C', '/home/trigen/projects/build-config/v8pp/v8/build/linux/debian_bullseye_i386-sysroot']' returned non-zero exit status 2.
  39. # #
  40. # file="./v8/build/linux/sysroot_scripts/install-sysroot.py"
  41. # old_string="mxf"
  42. # new_string="mxf', '--no-same-owner"
  43. # sed -i "s/${old_string}/${new_string}/g" "$file"
  44. # echo $?
  45. # Looks like we have to use GN now: https://github.com/v8/v8/wiki/Building-with-GN
  46. # initial build
  47. # temp
  48. #rm -rf out/x64.release
  49. #alias gm=$PWD/tools/dev/gm.py
  50. # whatever, it said,
  51. #+ alias gm=/var/lib/go-agent/pipelines/v8pp-ubuntu2404/v8pp/v8/tools/dev/gm.py
  52. #+ gm x64.release
  53. #./build-v8.sh: line 46: gm: command not found
  54. # so f*ck the alias
  55. $PWD/tools/dev/gm.py x64.release
  56. # we don't want std::_Cr, but std::__1 like everybody else is using
  57. # note that this is only relevant if use_custom_libcxx = true.
  58. # unfortunately I don't know how to specify v8 to use libc++ from the system
  59. # I asked a question about this here: https://groups.google.com/forum/#!topic/v8-users/Do5MvAvYFgs
  60. sed -i.bak 's/_LIBCPP_ABI_VERSION=Cr/_LIBCPP_ABI_VERSION=1/' build/config/c++/BUILD.gn
  61. # https://groups.google.com/g/v8-dev/c/AJjIyKMpFmA
  62. sed -i.bak 's/"-Wctad-maybe-unsupported"//' BUILD.gn
  63. # workaround, see notes.txt
  64. echo "v8_enable_embedded_builtins = false" | tee -a out/x64.release/args.gn
  65. echo "v8_use_external_startup_data = false" | tee -a out/x64.release/args.gn
  66. echo "v8_use_snapshot = false" | tee -a out/x64.release/args.gn
  67. echo "v8_enable_gdbjit = true" | tee -a out/x64.release/args.gn
  68. # set below to true to make it use libc++ (although it will use the one it is bundled with,
  69. # and also it will enable unsafe abi stuff, which means basically alpha features afaik)
  70. echo "use_custom_libcxx = false" | tee -a out/x64.release/args.gn
  71. # possibly they use a different version of clang compiling v8.
  72. # however, I already set my own, probably newer clang version.
  73. # ran into: https://groups.google.com/forum/#!topic/v8-users/Jb1VSouy2Z0
  74. #echo "is_clang = false" | tee -a out/x64.release/args.gn
  75. # setting to true now, and see if we use this clang on starcry if it works..
  76. echo "is_clang = true" | tee -a out/x64.release/args.gn
  77. # the only remaining issue was: undefined reference to `typeinfo for v8::ArrayBuffer::Allocator'
  78. # this is the case with (gnu) libstd++ , only remaining issue for me
  79. # https://github.com/danbev/learning-v8/pull/4
  80. echo "use_rtti = true" | tee -a out/x64.release/args.gn
  81. # produce monolith (single static all in one .a file)
  82. echo "v8_monolithic = true" | tee -a out/x64.release/args.gn
  83. ninja -C out/x64.release v8_monolith
  84. # produce .so files (shared libs)
  85. # temporary disable the .so files (I'm not using them for now, and they are slow to build)
  86. #sed -i.bak '/^v8_monolithic/d' out/x64.release/args.gn
  87. #echo "is_component_build = true" | tee -a out/x64.release/args.gn
  88. #ninja -C out/x64.release