Open avrono opened 2 weeks ago
Ok, so Debian build progress with cmake -D CMAKE_C_COMPILER=/usr/bin/clang -D CMAKE_CXX_COMPILER=/usr/bin/clang++ ..
Debian still shipping 14.06 have to upgrade to 15+
@yokofly , would you please check the Debian build process and refine build.md? Thanks.
I solved it with
-D
flag and Thanks,maybe build.md can be refined. Feel free to propose the change as a comment, or as a PR
Not problem will take notes, now getting build failure on protoc
ld.lld --version 1 err 3s
Debian LLD 14.0.6 (compatible with GNU linkers)
Maybe linker needs to be 15+ (I guess) ?
ninja 127 err
[0/2] Re-checking globbed directories...
[2531/11759] Linking CXX executable contrib/protobuf-cmake/protoc
FAILED: contrib/protobuf-cmake/protoc
: && /usr/bin/clang++ --target=x86_64-linux-gnu --sysroot=/home/avrono/workspace/proton/cmake/linux/../../contrib/sysroot/linux-x86_64/x86_64-linux-gnu/libc --gcc-toolchain=/home/avrono/workspace/proton/cmake/linux/../../contrib/sysroot/linux-x86_64 -fdiagnostics-color=always -Xclang -fuse-ctor-homing -fsized-deallocation -gdwarf-aranges -pipe -mssse3 -msse4.1 -msse4.2 -mpclmul -mpopcnt -fasynchronous-unwind-tables -ffile-prefix-map=/home/avrono/workspace/proton=. -falign-functions=32 -mbranches-within-32B-boundaries -Wall -Wno-unused-command-line-argument -fdiagnostics-absolute-paths -fstrict-vtable-pointers -w -O2 -g -DNDEBUG -O3 -g -gdwarf-4 -fno-pie --gcc-toolchain=/home/avrono/workspace/proton/cmake/linux/../../contrib/sysroot/linux-x86_64 --ld-path=/home/avrono/workspace/proton/build/ld.lld -rdynamic -Wl,--gdb-index -Wl,--build-id=sha1 -no-pie -Wl,-no-pie -Xlinker --no-undefined contrib/protobuf-cmake/CMakeFiles/protoc.dir/__/protobuf/src/google/protobuf/compiler/main.cc.o -o contrib/protobuf-cmake/protoc contrib/protobuf-cmake/lib_libprotoc.a contrib/protobuf-cmake/lib_libprotobuf.a -lpthread contrib/zlib-ng-cmake/lib_zlib.a -Wl,--start-group base/glibc-compatibility/libglibc-compatibility.a base/glibc-compatibility/memcpy/libmemcpy.a contrib/libcxx-cmake/libcxx.a contrib/libcxxabi-cmake/libcxxabi.a contrib/libunwind-cmake/libunwind.a -Wl,--end-group -nodefaultlibs /usr/lib/llvm-15/lib/clang/15.0.6/lib/linux/libclang_rt.builtins-x86_64.a -lc -lm -lrt -lpthread -ldl && :
clang: error: invalid linker name in argument '--ld-path=/home/avrono/workspace/proton/build/ld.lld'
[2544/11759] Building CXX object contrib/grpc/CMakeFiles/grpc.dir/src/core/ext/filters/client_channel/client_channel.cc.o
ninja: build stopped: subcommand failed.
I can reproduce it, upgrade linker to 15+ is still not working. the cmake here hard-write linker path.
root@77df7248ea10:/work/build_debian_release# ninja
[0/2] Re-checking globbed directories...
[1559/10761] Linking CXX executable contrib/protobuf-cmake/protoc
FAILED: contrib/protobuf-cmake/protoc
: && /usr/bin/clang++-15 --target=x86_64-linux-gnu --sysroot=/work/cmake/linux/../../contrib/sysroot/linux-x86_64/x86_64-linux-gnu/libc --gcc-toolchain=/work/cmake/linux/../../contrib/sysroot/linux-x86_64 -fdiagnostics-color=always -Xclang -fuse-ctor-homing -fsized-deallocation -gdwarf-aranges -pipe -mssse3 -msse4.1 -msse4.2 -mpclmul -mpopcnt -fasynchronous-unwind-tables -ffile-prefix-map=/work=. -falign-functions=32 -mbranches-within-32B-boundaries -Wall -Wno-unused-command-line-argument -fdiagnostics-absolute-paths -fstrict-vtable-pointers -w -O2 -g -DNDEBUG -O3 -g -gdwarf-4 -fno-pie --gcc-toolchain=/work/cmake/linux/../../contrib/sysroot/linux-x86_64 --ld-path=/work/build_debian_release/ld.lld -rdynamic -Wl,--gdb-index -Wl,--build-id=sha1 -no-pie -Wl,-no-pie -Xlinker --no-undefined contrib/protobuf-cmake/CMakeFiles/protoc.dir/__/protobuf/src/google/protobuf/compiler/main.cc.o -o contrib/protobuf-cmake/protoc contrib/protobuf-cmake/lib_libprotoc.a contrib/protobuf-cmake/lib_libprotobuf.a -lpthread contrib/zlib-ng-cmake/lib_zlib.a -Wl,--start-group base/glibc-compatibility/libglibc-compatibility.a base/glibc-compatibility/memcpy/libmemcpy.a contrib/libcxx-cmake/libcxx.a contrib/libcxxabi-cmake/libcxxabi.a contrib/libunwind-cmake/libunwind.a -Wl,--end-group -nodefaultlibs /usr/lib/llvm-15/lib/clang/15.0.7/lib/linux/libclang_rt.builtins-x86_64.a -lc -lm -lrt -lpthread -ldl && :
clang: error: invalid linker name in argument '--ld-path=/work/build_debian_release/ld.lld'
[1580/10761] Building CXX object contrib/grpc/CMakeFiles/grpc.dir/src/core/ext/filters/client_channel/lb_policy/xds/eds.cc.o
ninja: build stopped: subcommand failed.
root@77df7248ea10:/work/build_debian_release# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 12 (bookworm)
Release: 12
Codename: bookworm
root@77df7248ea10:/work/build_debian_release#
I will upgrade to clang-16 to test.
hi @avrono clang-16 works. the package is from :
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 16
and my command to build:
CC=clang-16 CXX=clang++-16 PATH=/usr/lib/llvm-16/bin/:$PATH cmake ..
Hi @yokofly thanks, I did also try with other version including 17. I will investigate further.
Further @yokofly that worked with the supplied build command. Thanks !
Following instructions in
build.md
getting this error on6.1.0-26-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.112-1 (2024-09-30) x86_64 GNU/Linux
Seems like it is looking for Clang as the default compiler