Parcourir la source

Bump clang from 9 to 10 and get rid of -stdlib=libc++ here and there.

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
Ray Burgemeestre il y a 4 ans
Parent
révision
9da2d479e8
8 fichiers modifiés avec 71 ajouts et 51 suppressions
  1. +5
    -5
      allegro5/Makefile
  2. +5
    -5
      benchmarklib/Makefile
  3. +9
    -6
      boost/Makefile
  4. +5
    -6
      caf/Makefile
  5. +5
    -5
      crtmpserver/Makefile
  6. +5
    -5
      fastpfor/Makefile
  7. +15
    -11
      v8pp/Makefile
  8. +22
    -8
      v8pp/build-v8.sh

+ 5
- 5
allegro5/Makefile Voir le fichier

@@ -13,11 +13,11 @@ impl:
libpng-dev libjpeg-dev libfreetype6-dev \
libxrandr-dev libxinerama-dev libxi-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
pushd allegro5 && \
cmake -DCMAKE_BUILD_TYPE=release -DCMAKE_INSTALL_PREFIX=$$PWD/allegro5_static -DSHARED=off -DSTATIC=on -DWANT_FFMPEG=off -DWANT_TTF=on . && \

+ 5
- 5
benchmarklib/Makefile Voir le fichier

@@ -7,11 +7,11 @@ benchmarklib:
make package

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
# if [[ -f CMakeCache.txt ]]; then rm CMakeCache.txt; fi
dpkg -i boost/pkg/*.deb

+ 9
- 6
boost/Makefile Voir le fichier

@@ -7,16 +7,19 @@ boost:
make package

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 && \
mkdir -p target && \
CXX=$$(which c++) ./bootstrap.sh --prefix=$$PWD/target/ --with-toolset=clang && \
./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
# ^ ||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++"

+ 5
- 6
caf/Makefile Voir le fichier

@@ -1,18 +1,17 @@
SHELL:=/bin/bash

caf:
#git clone https://github.com/rayburgemeestre/actor-framework
git clone https://github.com/actor-framework/actor-framework
pushd actor-framework && git checkout 0.17.3
bash ../ubuntu1804.sh make impl
make package

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 && \
./configure --prefix=$$PWD/caf_out --with-clang=$$(which c++) --build-static-only \
--no-examples \

+ 5
- 5
crtmpserver/Makefile Voir le fichier

@@ -12,11 +12,11 @@ impl:
apt-get install -y libssl1.0-dev
# rm -rf crtmpserver/builders/cmake/CMakeCache.txt
# 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 && \
make clean || true && \
rm -rf CMakeCache.txt && \

+ 5
- 5
fastpfor/Makefile Voir le fichier

@@ -8,11 +8,11 @@ caf:
make package

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 && \
CXX=$$(which c++) cmake . && \
make -j $$(nproc)

+ 15
- 11
v8pp/Makefile Voir le fichier

@@ -6,7 +6,7 @@ iv8:
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git || true
# will be factored out at some point
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 archive # outside container not enough permissions
@@ -16,13 +16,15 @@ iv8:
make fpm_package

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 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

archive:
@@ -37,8 +39,8 @@ archive:
# 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')
# 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..
find ./v8/out/x64.release/ -name 'libv8_monolith.a' -type f
# We'll also include .so files..
@@ -50,10 +52,10 @@ package:
mkdir -p out/opt/cppse/build/v8pp/lib
mkdir -p out/opt/cppse/build/v8pp/include
# 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
# 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 v8/include out/opt/cppse/build/v8pp/include/v8

@@ -65,6 +67,8 @@ clean:
rm -rf v8
rm -rf out
rm -rf depot_tools
rm -rf .gclient
rm -rf .gclient_entries

shell:
FLAGS="-i --privileged" bash ../ubuntu1804.sh /bin/bash

+ 22
- 8
v8pp/build-v8.sh Voir le fichier

@@ -1,5 +1,7 @@
#!/bin/bash

set -ex

export PATH=`pwd`/depot_tools:"$PATH"

# https://github.com/prahladyeri/tuxdrive/issues/3
@@ -7,16 +9,17 @@ apt-get install python3-pip -y
pip3 install httplib2 --upgrade

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
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 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

@@ -25,13 +28,19 @@ gclient sync -r 7.5.288.23 # https://github.com/pmed/v8-nuget/
#rm -rf out/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

# 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 "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.
# however, I already set my own, probably newer clang version.
# ran into: https://groups.google.com/forum/#!topic/v8-users/Jb1VSouy2Z0
@@ -39,12 +48,17 @@ echo "use_custom_libcxx = true" | 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)
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

Chargement…
Annuler
Enregistrer