Commit 17311bd5 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

component/headless-chromium: use external llvm compiler

When using internal llvm compiler, we got this error on Debian 12

2023-07-12 00:48:42 slapos[2468769] INFO FAILED: brotli
2023-07-12 00:48:42 slapos[2468769] INFO python3 "../../build/toolchain/gcc_link_wrapper.py" --output="./brotli" -- "/srv/slapgrid/slappart0/t/dvl/i/0/tmp/soft/8db55dc3d35b55b9f773dc4e56fb2801/parts/chromium-source/src/third_party/llvm-build/Release+Asserts/bin/clang++" -fuse-ld=lld -Wl,--fatal-warnings -Wl,--build-id -fPIC -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--icf=all -Wl,--color-diagnostics -Wl,--no-call-graph-profile-sort -m64 -no-canonical-prefixes -Werror -Wl,-O2 -Wl,--gc-sections -rdynamic -nostdlib++ --sysroot=../../build/linux/debian_sid_amd64-sysroot -Wl,-z,defs -Wl,--as-needed -pie -Wl,--disable-new-dtags "-Wl,-rpath=/srv/slapgrid/slappart0/t/dvl/i/0/tmp/soft/8db55dc3d35b55b9f773dc4e56fb2801/parts/nss/lib,-rpath=/srv/slapgrid/slappart0/t/dvl/i/0/tmp/soft/8db55dc3d35b55b9f773dc4e56fb2801/parts/nspr/lib" -o "./brotli" -Wl,--start-group @"./brotli.rsp"  -Wl,--end-group  -ldl -lpthread -lrt
2023-07-12 00:48:42 slapos[2468769] INFO /srv/slapgrid/slappart0/t/dvl/i/0/tmp/soft/8db55dc3d35b55b9f773dc4e56fb2801/parts/chromium-source/src/third_party/llvm-build/Release+Asserts/bin/ld.lld: /srv/slapgrid/slappart0/t/dvl/i/0/tmp/soft/8db55dc3d35b55b9f773dc4e56fb2801/parts/chromium-source/src/third_party/llvm-build/Release+Asserts/bin/../lib/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /lib/x86_64-linux-gnu/libicuuc.so.72)
parent 9811f10b
......@@ -6,6 +6,7 @@ extends =
../depot_tools/buildout.cfg
../git/buildout.cfg
../gperf/buildout.cfg
../llvm/buildout.cfg
../pkgconfig/buildout.cfg
# Runtime dependencies:
../nspr/buildout.cfg
......@@ -75,16 +76,16 @@ build-config-options =
is_debug = false
symbol_level = 0
blink_symbol_level = 0
clang_use_chrome_plugins = false
# We need to unbundle the build toolchain in order to set our own
# LDFLAGS.
custom_toolchain = "//build/toolchain/linux/unbundle:default"
host_toolchain = "//build/toolchain/linux/unbundle:default"
clang_base_path = "${llvm:location}"
current_os = "linux"
current_cpu = "x64"
treat_warnings_as_errors = false
# Chromium bundles its own LLVM toolchain, so we might as well use it.
llvm-toolchain = ${:path}/third_party/llvm-build/Release+Asserts/bin
# Don't use internal llvm toolchain to better control the library linking
llvm-toolchain = ${llvm:location}/bin
#${:path}/third_party/llvm-build/Release+Asserts/bin
configure-command =
# Sync build dependencies---this is a little finnicky.
......@@ -104,7 +105,7 @@ make-binary =
# compatibility. The build is quite cheap compared to Chromium, anyway.
autoninja -C ${:fake-location} chromedriver
environment =
PATH=${depot_tools:location}:${gperf:location}/bin:${pkgconfig:location}/bin:${coreutils:location}/bin:${git:location}/bin:${curl:location}/bin:%(PATH)s
PATH=${depot_tools:location}:${gperf:location}/bin:${pkgconfig:location}/bin:${coreutils:location}/bin:${git:location}/bin:${curl:location}/bin:${llvm:location}/bin%(PATH)s
LDFLAGS="-Wl,-rpath=${nss:location}/lib,-rpath=${nspr:location}/lib"
CC="${:llvm-toolchain}/clang"
CXX="${:llvm-toolchain}/clang++"
......
......@@ -6,23 +6,60 @@ extends =
parts = llvm
[llvm-version]
version = 15.0.0
[llvm-cmake]
recipe = slapos.recipe.build:download-unpacked
shared = true
url = https://github.com/llvm/llvm-project/releases/download/llvmorg-${:version}/cmake-${:version}.src.tar.xz
version = 15.0.0
url = https://github.com/llvm/llvm-project/releases/download/llvmorg-${llvm-version:version}/cmake-${llvm-version:version}.src.tar.xz
md5sum = e2e69ec36e163293f0b558e0382660cb
environment =
PATH=${xz-utils:location}/bin:%(PATH)s
[llvm-clang]
recipe = slapos.recipe.build:download-unpacked
shared = true
url = https://github.com/llvm/llvm-project/releases/download/llvmorg-${llvm-version:version}/clang-${llvm-version:version}.src.tar.xz
md5sum = ff48dab9de875ca48736a97fdde60ced
environment =
PATH=${xz-utils:location}/bin:%(PATH)s
[llvm-lld]
recipe = slapos.recipe.build:download-unpacked
shared = true
url = https://github.com/llvm/llvm-project/releases/download/llvmorg-${llvm-version:version}/lld-${llvm-version:version}.src.tar.xz
md5sum = 5293c1ea3bb76cb0586ae01fb53231a6
environment =
PATH=${xz-utils:location}/bin:%(PATH)s
[llvm-libunwind]
recipe = slapos.recipe.build:download-unpacked
shared = true
url = https://github.com/llvm/llvm-project/releases/download/llvmorg-${llvm-version:version}/libunwind-${llvm-version:version}.src.tar.xz
md5sum = 9b94d6cb031792b14cbfb58386e68ac2
environment =
PATH=${xz-utils:location}/bin:%(PATH)s
[llvm]
recipe = slapos.recipe.cmmi
shared = true
url = https://github.com/llvm/llvm-project/releases/download/llvmorg-${:version}/llvm-${:version}.src.tar.xz
version = 15.0.0
url = https://github.com/llvm/llvm-project/releases/download/llvmorg-${llvm-version:version}/llvm-${llvm-version:version}.src.tar.xz
md5sum = 7b406c97f87b94cda4224aa53968c9d5
pre-configure =
cp ${llvm-cmake:location}/Modules/* ./cmake/modules/
mkdir ../clang
cp -r ${llvm-clang:location}/* ../clang/
# we need to give permission so that at the end of cmmi, we can delete it
chmod -R u+rw ../clang
mkdir ../lld
cp -r ${llvm-lld:location}/* ../lld/
# we need to give permission so that at the end of cmmi, we can delete it
chmod -R u+rw ../lld
mkdir ../libunwind
cp -r ${llvm-libunwind:location}/* ../libunwind/
# we need to give permission so that at the end of cmmi, we can delete it
chmod -R u+rw ../libunwind
configure-command = ${cmake:location}/bin/cmake
configure-options =
-Bbuild
......@@ -32,6 +69,7 @@ configure-options =
-DLLVM_INCLUDE_BENCHMARKS=OFF
-DCMAKE_C_FLAGS="${:CMAKE_CFLAGS}"
-DCMAKE_CXX_FLAGS="${:CMAKE_CFLAGS}"
-DLLVM_ENABLE_PROJECTS="clang;libunwind;lld"
make-options = -C build
CMAKE_CFLAGS = -I${libxml2:location}/include/libxml2 -I${ncurses:location}/include -I${zlib:location}/include
environment =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment