Commit 6ef78ef0 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 7ed4d19f
...@@ -6,6 +6,7 @@ extends = ...@@ -6,6 +6,7 @@ extends =
../depot_tools/buildout.cfg ../depot_tools/buildout.cfg
../git/buildout.cfg ../git/buildout.cfg
../gperf/buildout.cfg ../gperf/buildout.cfg
../llvm/buildout.cfg
../pkgconfig/buildout.cfg ../pkgconfig/buildout.cfg
# Runtime dependencies: # Runtime dependencies:
../nspr/buildout.cfg ../nspr/buildout.cfg
...@@ -75,16 +76,16 @@ build-config-options = ...@@ -75,16 +76,16 @@ build-config-options =
is_debug = false is_debug = false
symbol_level = 0 symbol_level = 0
blink_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 clang_base_path = "${llvm:location}"
# LDFLAGS.
custom_toolchain = "//build/toolchain/linux/unbundle:default"
host_toolchain = "//build/toolchain/linux/unbundle:default"
current_os = "linux" current_os = "linux"
current_cpu = "x64" current_cpu = "x64"
treat_warnings_as_errors = false
# Chromium bundles its own LLVM toolchain, so we might as well use it. # Don't use internal llvm toolchain to better control the library linking
llvm-toolchain = ${:path}/third_party/llvm-build/Release+Asserts/bin llvm-toolchain = ${llvm:location}/bin
#${:path}/third_party/llvm-build/Release+Asserts/bin
configure-command = configure-command =
# Sync build dependencies---this is a little finnicky. # Sync build dependencies---this is a little finnicky.
...@@ -104,7 +105,7 @@ make-binary = ...@@ -104,7 +105,7 @@ make-binary =
# compatibility. The build is quite cheap compared to Chromium, anyway. # compatibility. The build is quite cheap compared to Chromium, anyway.
autoninja -C ${:fake-location} chromedriver autoninja -C ${:fake-location} chromedriver
environment = 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" LDFLAGS="-Wl,-rpath=${nss:location}/lib,-rpath=${nspr:location}/lib"
CC="${:llvm-toolchain}/clang" CC="${:llvm-toolchain}/clang"
CXX="${:llvm-toolchain}/clang++" CXX="${:llvm-toolchain}/clang++"
......
...@@ -6,23 +6,60 @@ extends = ...@@ -6,23 +6,60 @@ extends =
parts = llvm parts = llvm
[llvm-version]
version = 15.0.0
[llvm-cmake] [llvm-cmake]
recipe = slapos.recipe.build:download-unpacked recipe = slapos.recipe.build:download-unpacked
shared = true shared = true
url = https://github.com/llvm/llvm-project/releases/download/llvmorg-${:version}/cmake-${:version}.src.tar.xz url = https://github.com/llvm/llvm-project/releases/download/llvmorg-${llvm-version:version}/cmake-${llvm-version:version}.src.tar.xz
version = 15.0.0
md5sum = e2e69ec36e163293f0b558e0382660cb md5sum = e2e69ec36e163293f0b558e0382660cb
environment = environment =
PATH=${xz-utils:location}/bin:%(PATH)s 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] [llvm]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
shared = true shared = true
url = https://github.com/llvm/llvm-project/releases/download/llvmorg-${:version}/llvm-${:version}.src.tar.xz url = https://github.com/llvm/llvm-project/releases/download/llvmorg-${llvm-version:version}/llvm-${llvm-version:version}.src.tar.xz
version = 15.0.0
md5sum = 7b406c97f87b94cda4224aa53968c9d5 md5sum = 7b406c97f87b94cda4224aa53968c9d5
pre-configure = pre-configure =
cp ${llvm-cmake:location}/Modules/* ./cmake/modules/ 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-command = ${cmake:location}/bin/cmake
configure-options = configure-options =
-Bbuild -Bbuild
...@@ -32,6 +69,7 @@ configure-options = ...@@ -32,6 +69,7 @@ configure-options =
-DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF
-DCMAKE_C_FLAGS="${:CMAKE_CFLAGS}" -DCMAKE_C_FLAGS="${:CMAKE_CFLAGS}"
-DCMAKE_CXX_FLAGS="${:CMAKE_CFLAGS}" -DCMAKE_CXX_FLAGS="${:CMAKE_CFLAGS}"
-DLLVM_ENABLE_PROJECTS="clang;libunwind;lld"
make-options = -C build make-options = -C build
CMAKE_CFLAGS = -I${libxml2:location}/include/libxml2 -I${ncurses:location}/include -I${zlib:location}/include CMAKE_CFLAGS = -I${libxml2:location}/include/libxml2 -I${ncurses:location}/include -I${zlib:location}/include
environment = 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