Let's use libstdc++ for now, since I'm not able to get v8 working with the system libc++, and the embedded libc++ that comes with v8 doesn't play well with caf for some reason.master
libpng-dev libjpeg-dev libfreetype6-dev \ | libpng-dev libjpeg-dev libfreetype6-dev \ | ||||
libxrandr-dev libxinerama-dev libxi-dev \ | libxrandr-dev libxinerama-dev libxi-dev \ | ||||
libgtk2.0-dev | libgtk2.0-dev | ||||
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-9 40 | |||||
update-alternatives --install /usr/bin/cc cc /usr/bin/clang-9 40 | |||||
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-9 40 | |||||
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-9 40 | |||||
update-alternatives --install /usr/bin/ld ld /usr/bin/ld.lld-9 40 | |||||
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-10 40 | |||||
update-alternatives --install /usr/bin/cc cc /usr/bin/clang-10 40 | |||||
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-10 40 | |||||
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-10 40 | |||||
update-alternatives --install /usr/bin/ld ld /usr/bin/ld.lld-10 40 | |||||
# static build | # static build | ||||
pushd allegro5 && \ | pushd allegro5 && \ | ||||
cmake -DCMAKE_BUILD_TYPE=release -DCMAKE_INSTALL_PREFIX=$$PWD/allegro5_static -DSHARED=off -DSTATIC=on -DWANT_FFMPEG=off -DWANT_TTF=on . && \ | cmake -DCMAKE_BUILD_TYPE=release -DCMAKE_INSTALL_PREFIX=$$PWD/allegro5_static -DSHARED=off -DSTATIC=on -DWANT_FFMPEG=off -DWANT_TTF=on . && \ |
make package | make package | ||||
impl: | impl: | ||||
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-9 40 | |||||
update-alternatives --install /usr/bin/cc cc /usr/bin/clang-9 40 | |||||
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-9 40 | |||||
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-9 40 | |||||
update-alternatives --install /usr/bin/ld ld /usr/bin/ld.lld-9 40 | |||||
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-10 40 | |||||
update-alternatives --install /usr/bin/cc cc /usr/bin/clang-10 40 | |||||
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-10 40 | |||||
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-10 40 | |||||
update-alternatives --install /usr/bin/ld ld /usr/bin/ld.lld-10 40 | |||||
# TODO install boost from apt repo | # TODO install boost from apt repo | ||||
# if [[ -f CMakeCache.txt ]]; then rm CMakeCache.txt; fi | # if [[ -f CMakeCache.txt ]]; then rm CMakeCache.txt; fi | ||||
dpkg -i boost/pkg/*.deb | dpkg -i boost/pkg/*.deb |
make package | make package | ||||
impl: | impl: | ||||
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-9 40 | |||||
update-alternatives --install /usr/bin/cc cc /usr/bin/clang-9 40 | |||||
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-9 40 | |||||
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-9 40 | |||||
update-alternatives --install /usr/bin/ld ld /usr/bin/ld.lld-9 40 | |||||
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-10 40 | |||||
update-alternatives --install /usr/bin/cc cc /usr/bin/clang-10 40 | |||||
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-10 40 | |||||
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-10 40 | |||||
update-alternatives --install /usr/bin/ld ld /usr/bin/ld.lld-10 40 | |||||
pushd boost_1_72_0 && \ | pushd boost_1_72_0 && \ | ||||
mkdir -p target && \ | mkdir -p target && \ | ||||
CXX=$$(which c++) ./bootstrap.sh --prefix=$$PWD/target/ --with-toolset=clang && \ | CXX=$$(which c++) ./bootstrap.sh --prefix=$$PWD/target/ --with-toolset=clang && \ | ||||
./b2 clean && \ | ./b2 clean && \ | ||||
./b2 --prefix=$$PWD/target/ toolset=clang cxxflags="-D_GLIBCXX_USE_CXX11_ABI=0 -stdlib=libc++ -std=c++17" linkflags="-stdlib=libc++" || true | |||||
# with stdlib: | |||||
#./b2 --prefix=$$PWD/target/ toolset=clang cxxflags="-D_GLIBCXX_USE_CXX11_ABI=0 -stdlib=libc++ -std=c++17" linkflags="-stdlib=libc++" || true | |||||
# without: | |||||
./b2 --prefix=$$PWD/target/ toolset=clang cxxflags="-D_GLIBCXX_USE_CXX11_ABI=0 -std=c++17" linkflags="" || true | |||||
#./b2 --prefix=$$PWD/target/ toolset=clang || true | #./b2 --prefix=$$PWD/target/ toolset=clang || true | ||||
# ^ ||true because with clang I saw a few libraries not compile correctly, we can ignore those. | # ^ ||true because with clang I saw a few libraries not compile correctly, we can ignore those. | ||||
#./b2 --with-program_options --prefix=$$PWD/target/ toolset=clang cxxflags="-stdlib=libc++ -std=c++17" linkflags="-stdlib=libc++" | #./b2 --with-program_options --prefix=$$PWD/target/ toolset=clang cxxflags="-stdlib=libc++ -std=c++17" linkflags="-stdlib=libc++" |
SHELL:=/bin/bash | SHELL:=/bin/bash | ||||
caf: | caf: | ||||
#git clone https://github.com/rayburgemeestre/actor-framework | |||||
git clone https://github.com/actor-framework/actor-framework | git clone https://github.com/actor-framework/actor-framework | ||||
pushd actor-framework && git checkout 0.17.3 | pushd actor-framework && git checkout 0.17.3 | ||||
bash ../ubuntu1804.sh make impl | bash ../ubuntu1804.sh make impl | ||||
make package | make package | ||||
impl: | impl: | ||||
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-9 40 | |||||
update-alternatives --install /usr/bin/cc cc /usr/bin/clang-9 40 | |||||
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-9 40 | |||||
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-9 40 | |||||
update-alternatives --install /usr/bin/ld ld /usr/bin/ld.lld-9 40 | |||||
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-10 40 | |||||
update-alternatives --install /usr/bin/cc cc /usr/bin/clang-10 40 | |||||
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-10 40 | |||||
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-10 40 | |||||
update-alternatives --install /usr/bin/ld ld /usr/bin/ld.lld-10 40 | |||||
pushd actor-framework && \ | pushd actor-framework && \ | ||||
./configure --prefix=$$PWD/caf_out --with-clang=$$(which c++) --build-static-only \ | ./configure --prefix=$$PWD/caf_out --with-clang=$$(which c++) --build-static-only \ | ||||
--no-examples \ | --no-examples \ |
apt-get install -y libssl1.0-dev | apt-get install -y libssl1.0-dev | ||||
# rm -rf crtmpserver/builders/cmake/CMakeCache.txt | # rm -rf crtmpserver/builders/cmake/CMakeCache.txt | ||||
# switch to clang 7, crtmpserver build broken with g++ | # switch to clang 7, crtmpserver build broken with g++ | ||||
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-9 40 | |||||
update-alternatives --install /usr/bin/cc cc /usr/bin/clang-9 40 | |||||
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-9 40 | |||||
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-9 40 | |||||
update-alternatives --install /usr/bin/ld ld /usr/bin/ld.lld-9 40 | |||||
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-10 40 | |||||
update-alternatives --install /usr/bin/cc cc /usr/bin/clang-10 40 | |||||
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-10 40 | |||||
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-10 40 | |||||
update-alternatives --install /usr/bin/ld ld /usr/bin/ld.lld-10 40 | |||||
pushd crtmpserver/builders/cmake && \ | pushd crtmpserver/builders/cmake && \ | ||||
make clean || true && \ | make clean || true && \ | ||||
rm -rf CMakeCache.txt && \ | rm -rf CMakeCache.txt && \ |
make package | make package | ||||
impl: | impl: | ||||
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-9 40 | |||||
update-alternatives --install /usr/bin/cc cc /usr/bin/clang-9 40 | |||||
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-9 40 | |||||
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-9 40 | |||||
update-alternatives --install /usr/bin/ld ld /usr/bin/ld.lld-9 40 | |||||
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-10 40 | |||||
update-alternatives --install /usr/bin/cc cc /usr/bin/clang-10 40 | |||||
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-10 40 | |||||
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-10 40 | |||||
update-alternatives --install /usr/bin/ld ld /usr/bin/ld.lld-10 40 | |||||
pushd FastPFor && \ | pushd FastPFor && \ | ||||
CXX=$$(which c++) cmake . && \ | CXX=$$(which c++) cmake . && \ | ||||
make -j $$(nproc) | make -j $$(nproc) |
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git || true | git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git || true | ||||
# will be factored out at some point | # will be factored out at some point | ||||
git clone https://github.com/pmed/v8pp || true | git clone https://github.com/pmed/v8pp || true | ||||
pushd v8pp && git checkout 8ad6c07b13a811d9132c202f48b4a902d5685a98 # master at time of writing | |||||
pushd v8pp && git checkout 94308b4fcd992fcc8174b0b30a73e58a436819b2 # master at time of writing | |||||
bash ../ubuntu1804.sh make build | bash ../ubuntu1804.sh make build | ||||
bash ../ubuntu1804.sh make archive # outside container not enough permissions | bash ../ubuntu1804.sh make archive # outside container not enough permissions | ||||
make fpm_package | make fpm_package | ||||
build: | build: | ||||
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-9 40 | |||||
update-alternatives --install /usr/bin/cc cc /usr/bin/clang-9 40 | |||||
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-9 40 | |||||
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-9 40 | |||||
update-alternatives --install /usr/bin/ld ld /usr/bin/ld.lld-9 40 | |||||
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-10 40 | |||||
update-alternatives --install /usr/bin/cc cc /usr/bin/clang-10 40 | |||||
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-10 40 | |||||
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-10 40 | |||||
update-alternatives --install /usr/bin/ld ld /usr/bin/ld.lld-10 40 | |||||
apt-get update | apt-get update | ||||
apt-get install pkg-config -y | |||||
apt-get install pkg-config python2.7 -y | |||||
cp -prv /usr/bin/python2.7 /usr/bin/python # stupid depot tool scripts | |||||
cp -prv /usr/bin/python2.7 /usr/bin/python2 # stupid depot tool scripts | |||||
./build-v8.sh | ./build-v8.sh | ||||
archive: | archive: | ||||
# Let's go back to our white-list approach.. let's see... | # Let's go back to our white-list approach.. let's see... | ||||
#ar rvs v8.a $$(cat v8-include.txt |xargs -n 1 -I{} find {} -name '*.o') | #ar rvs v8.a $$(cat v8-include.txt |xargs -n 1 -I{} find {} -name '*.o') | ||||
# We no longer use our v8.a, still including it for now. | # We no longer use our v8.a, still including it for now. | ||||
echo all included object files listed below | |||||
ar rvs v8.a $$(cat v8-include.txt |xargs -n 1 -I{} find {} -name '*.o') | |||||
# no longer works with newer, missing some files echo all included object files listed below | |||||
# no longer works with newer, missing some files ar rvs v8.a $$(cat v8-include.txt |xargs -n 1 -I{} find {} -name '*.o') | |||||
# We'll use this one below.. | # We'll use this one below.. | ||||
find ./v8/out/x64.release/ -name 'libv8_monolith.a' -type f | find ./v8/out/x64.release/ -name 'libv8_monolith.a' -type f | ||||
# We'll also include .so files.. | # We'll also include .so files.. | ||||
mkdir -p out/opt/cppse/build/v8pp/lib | mkdir -p out/opt/cppse/build/v8pp/lib | ||||
mkdir -p out/opt/cppse/build/v8pp/include | mkdir -p out/opt/cppse/build/v8pp/include | ||||
# Legacy include our own v8.a | # Legacy include our own v8.a | ||||
cp -prv v8.a out/opt/cppse/build/v8pp/lib | |||||
# no longer works with newer, missing some files cp -prv v8.a out/opt/cppse/build/v8pp/lib | |||||
cp -prv v8/out/x64.release/obj/libv8_monolith.a out/opt/cppse/build/v8pp/lib | cp -prv v8/out/x64.release/obj/libv8_monolith.a out/opt/cppse/build/v8pp/lib | ||||
# We'll also include .so files.. | # We'll also include .so files.. | ||||
find ./v8/out/x64.release/ -name '*.so' -type f | xargs -n 1 cp -prv -t out/opt/cppse/build/v8pp/lib | |||||
#echo TEMP find ./v8/out/x64.release/ -name '*.so' -type f | xargs -n 1 cp -prv -t out/opt/cppse/build/v8pp/lib | |||||
cp -prv v8pp/v8pp out/opt/cppse/build/v8pp/include/ | cp -prv v8pp/v8pp out/opt/cppse/build/v8pp/include/ | ||||
cp -prv v8/include out/opt/cppse/build/v8pp/include/v8 | cp -prv v8/include out/opt/cppse/build/v8pp/include/v8 | ||||
rm -rf v8 | rm -rf v8 | ||||
rm -rf out | rm -rf out | ||||
rm -rf depot_tools | rm -rf depot_tools | ||||
rm -rf .gclient | |||||
rm -rf .gclient_entries | |||||
shell: | shell: | ||||
FLAGS="-i --privileged" bash ../ubuntu1804.sh /bin/bash | FLAGS="-i --privileged" bash ../ubuntu1804.sh /bin/bash |
#!/bin/bash | #!/bin/bash | ||||
set -ex | |||||
export PATH=`pwd`/depot_tools:"$PATH" | export PATH=`pwd`/depot_tools:"$PATH" | ||||
# https://github.com/prahladyeri/tuxdrive/issues/3 | # https://github.com/prahladyeri/tuxdrive/issues/3 | ||||
pip3 install httplib2 --upgrade | pip3 install httplib2 --upgrade | ||||
fetch v8 | fetch v8 | ||||
cd v8 # if this fails, exit! hence the set -ex | |||||
#gclient sync -r 6.9.427.6 # 55da769bafac8b531cd8b388df56161b8b7c6416 | #gclient sync -r 6.9.427.6 # 55da769bafac8b531cd8b388df56161b8b7c6416 | ||||
#gclient sync -r 7.1.69 # | #gclient sync -r 7.1.69 # | ||||
#gclient sync -r lkgr/6.9 | #gclient sync -r lkgr/6.9 | ||||
#gclient sync -r 6.9.427.13 # https://ci.appveyor.com/project/pmed/v8pp | #gclient sync -r 6.9.427.13 # https://ci.appveyor.com/project/pmed/v8pp | ||||
cd v8 | |||||
gclient sync -r 7.5.288.23 # https://github.com/pmed/v8-nuget/ | |||||
#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 8.0.426.15 # stupid test | ||||
#gclient sync -r 7.2.1 # stupid test | #gclient sync -r 7.2.1 # stupid test | ||||
# old version | |||||
# git checkout 5.5.372.7 | |||||
gclient sync -r 8.2.297.1 # https://github.com/pmed/v8-nuget/ | |||||
# Looks like we have to use GN now: https://github.com/v8/v8/wiki/Building-with-GN | # Looks like we have to use GN now: https://github.com/v8/v8/wiki/Building-with-GN | ||||
#rm -rf out/x64.release | #rm -rf out/x64.release | ||||
./tools/dev/gm.py x64.release | ./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 | sed -i.bak 's/_LIBCPP_ABI_VERSION=Cr/_LIBCPP_ABI_VERSION=1/' build/config/c++/BUILD.gn | ||||
# workaround, see notes.txt | # workaround, see notes.txt | ||||
echo "v8_enable_embedded_builtins = false" | tee -a out/x64.release/args.gn | 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_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_use_snapshot = false" | tee -a out/x64.release/args.gn | ||||
echo "use_custom_libcxx = 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. | # possibly they use a different version of clang compiling v8. | ||||
# however, I already set my own, probably newer clang version. | # however, I already set my own, probably newer clang version. | ||||
# ran into: https://groups.google.com/forum/#!topic/v8-users/Jb1VSouy2Z0 | # ran into: https://groups.google.com/forum/#!topic/v8-users/Jb1VSouy2Z0 | ||||
# setting to true now, and see if we use this clang on starcry if it works.. | # 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 | 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) | # produce monolith (single static all in one .a file) | ||||
echo "v8_monolithic = true" | tee -a out/x64.release/args.gn | echo "v8_monolithic = true" | tee -a out/x64.release/args.gn | ||||
ninja -C out/x64.release v8_monolith | ninja -C out/x64.release v8_monolith | ||||
# produce .so files (shared libs) | # produce .so files (shared libs) | ||||
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 | |||||
# 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 |