vvereschaka wrote: >Right - I see. But why does this build configuration have to affect whether it >should build lldb-rpc-gen or not? Is it because the clang in this build can't >manage to process the lldb headers (which are built for the current host)?
Right, "the clang in this build can't manage to process the lldb headers" because they include the target c++ headers, which are not available yet on a moment of executing the lldb-rpc-gen tool during the cross-toolchain build. > (which are built for the current host) They should work for the target host also. A little more details: * we build a cross toolchain for the aarch64/linux target on x86_64/Windows or x86_64/Linux host. The final Clang supports only Aarch64 target and uses the target libc++ library. * also this build configuration uses the Aarch64/Linux SYSROOT with the header/libraries for the target aarch64 system (such as stdc and stdc++, but not libc++ that we want to get from the project tree). * the lldb-rpc-gen tool depends on the clang libs to scan the lldb headers, but in our configuration Clang will use just-built libc++ and its header files. We need to prepare the libc++ headers inside of the build tree before using clang++/lldb-rpc-gen. * because of lack of the build dependencies, the lldb-prc-gen tool gets ready and starts scanning the headers before the libc++ headers get prepared (and we get the `fatal error: 'cstdio' file not found` errors accordingly). * The lldb-rpc-gen tool cannot use the host libc++ headers because the host os/arch and the target os/arch can be completely different. in addition: * as far as I know, there is no way to properly configure the build dependencies and run the lldb-rpc-gen tool after the `builtins` and `runtimes` builds get ready. * I know only one way to detect the cross toolchain build -- to compare LLVM_HOST_TRIPLE and LLVM_DEFAULT_TARGET_TRIPLE, -- but it is not working for some cases. Something like that. PS. Probably it is optimal to stop trying to detect all these known and unknown situations and manage building over `option` with OFF by default (may be except Darwin), but with consideration of the cross builds. https://github.com/llvm/llvm-project/pull/151603 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits