Add ability to use clang with GNU toolchain on Haiku#16756
Add ability to use clang with GNU toolchain on Haiku#16756jkoritzinsky merged 2 commits intodotnet:mainfrom
Conversation
| locate_toolchain_exec(g++ CMAKE_CXX_COMPILER) | ||
| elseif(HAIKU) | ||
| set(CMAKE_SYSROOT "${CROSS_ROOTFS}") | ||
| set(CMAKE_PROGRAM_PATH "${CMAKE_PROGRAM_PATH};${CROSS_ROOTFS}/cross-tools-x86_64/bin") |
There was a problem hiding this comment.
Will CMake still be able to correctly search for the GCC cross-compilers after this for pure-GNU builds (with the -gcc flag)?
There was a problem hiding this comment.
We normally only support either clang or gcc with --cross. clang is usually preferred; one reason is llvm-toolchains are multi-targeting (clang and lld can produce any binary on any host platform, including windows) while GNU toolchain is built in a target specific manner.
I have added the check to make -gcc work though. I recommend you switch to clang and mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net11.0-cross-haiku-amd64 as well for builds to keep things tight and in check (unless there is a problem / meaningful-difference with binaries produced by either toolchain).
There was a problem hiding this comment.
Sure, if that's the case (and if you have already gotten a full clang-based build working) then I'm fine with dropping GCC.
If there are any further bugs it's better to upstream patches to llvm-project instead.
Downstream PR: dotnet/runtime#127392