Can not build v8 with custom toolchain

318 views
Skip to first unread message

Vadim Plakhtinskiy

unread,
May 25, 2021, 8:55:47 AM5/25/21
to v8-users
Hi
I'm trying to build v8 using the custom toolchain. My gn gen command looks like this:


cd /v/build/v_deps_build/v8-prefix/src/v8-build && /usr/bin/cmake -E env CC=clang CXX=/vectorized/llvm/bin/clang++ LD=vectorized/llvm/bin/lld AR=/usr/bin/ar PKG_CONFIG_PATH=/vectorized/lib64/pkgconfig:/vectorized/share/pkgconfig:/vectorized/lib/pkgconfig "CFLAGS=-fPIC -march=westmere -fuse-ld=lld -mllvm -inline-threshold=2500 -O2 -g -DNDEBUG" "CXXFLAGS=-fPIC -march=westmere -fuse-ld=lld -mllvm -inline-threshold=2500 -Wno-unused-lambda-capture -Wno-unused-command-line-argument -stdlib=libc++ -O2 -g -DNDEBUG -std=c++20" "LDFLAGS=-Wl,--build-id=sha1 -L/vectorized/lib -L/vectorized/lib64 -stdlib=libc++" /vectorized/gn/gn gen /v/build/v_deps_build/v8-prefix/src/v8-build --root=/v/build/v_deps_build/v8-prefix/src/v8/v8 "--args=v8_monolithic=true is_debug=false clang_use_chrome_plugins=false treat_warnings_as_errors=false use_custom_libcxx=false use_glib=false use_sysroot=false v8_use_external_startup_data=false is_component_build=false v8_enable_pointer_compression=false custom_toolchain=\"//build/toolchain/linux/unbundle:default\" host_toolchain=\"//build/toolchain/linux/unbundle:default\"" && /vectorized/gn/gn desc /v/build/v_deps_build/v8-prefix/src/v8-build --root=/v/build/v_deps_build/v8-prefix/src/v8/v8 //:v8_monolith --tree && /usr/bin/cmake -E touch /v/build/v_deps_build/v8-prefix/src/v8-stamp/v8-configure

When I'm running ninja ninja -C <build_dir> v8_monolith I'm getting the following error:

[5/1560] ACTION //:generate_bytecode_builtins_list(//build/toolchain/linux/unbundle:default)
FAILED: gen/builtins-generated/bytecodes-builtins-list.h
python ../v8/v8/tools/run.py ./bytecode_builtins_list_generator gen/builtins-generated/bytecodes-builtins-list.h
/bytecode_builtins_list_generator: error while loading shared libraries: libc++.so.1: cannot open shared object file: No such file or directory
Return code is 127


If it's built with ./llvm/install/bin/clang --stdlib=libc++ then I expect it to link with ./llvm/install/libs/x86_64-unknwon-linux/libc++.so.1 but this is not the case.


Ben Noordhuis

unread,
May 25, 2021, 3:24:18 PM5/25/21
to v8-users
You probably need to `export
LD_LIBRARY_PATH=$PWD//llvm/install/libs/x86_64-unknown-linux`
(DYLD_LIBRARY_PATH on macOS) in order for the dynamic linker to look
in the right location.

Vadim Plakhtinskiy

unread,
May 25, 2021, 5:07:53 PM5/25/21
to v8-users
For example: if I added path for libcxx to ldconfig, it works. But I do not want to change ldconfig. I expect if I use custom_toolchain in gn args, bytecode_builtins_list_generator can use libcxx from my llvm build dir. Maybe I need to add some specific options
Reply all
Reply to author
Forward
0 new messages