LLVM 3.9 or newer is needed to turn on amdgpu in arc-mesa (b/65414758). Currently, calling arc-build-select-clang in src_configure() incorrectly sets up CMAKE_C_CONFIGURE as described here:
With arc-build-select-clang in src_configure(), working off of https://chromium-review.googlesource.com/c/chromiumos/overlays/chromiumos-overlay/+/688662:
$ cat /build/kahlee/tmp/portage/sys-devel/arc-llvm-4.0.1-r3/work/llvm-4.0.1.src-abi_x86_64.amd64/gentoo_toolchain.cmake
SET (CMAKE_C_COMPILER /opt/android-n/arc-llvm/3.8/bin/clang -I/build/kahlee/opt/google/containers/android/usr/include/arch-x86_64/include/ --gcc-toolchain=/opt/android-n/arc-gcc/x86_64/x86_64-linux-android-4.9 -target x86_64-linux-android)
SET (CMAKE_CXX_COMPILER /opt/android-n/arc-llvm/3.8/bin/clang++ -I/build/kahlee/opt/google/containers/android/usr/include/arch-x86_64/include/ --gcc-toolchain=/opt/android-n/arc-gcc/x86_64/x86_64-linux-android-4.9 -target x86_64-linux-android)
SET (CMAKE_Fortran_COMPILER gfortran -I/build/kahlee/opt/google/containers/android/usr/include/arch-x86_64/include/ --gcc-toolchain=/opt/android-n/arc-gcc/x86_64/x86_64-linux-android-4.9 -target x86_64-linux-android)
SET (CMAKE_SYSTEM_NAME "Linux")
set(CMAKE_FIND_ROOT_PATH "/build/kahlee")
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
so we get errors like this during the build:
The CMAKE_C_COMPILER: /opt/android-n/arc-llvm/3.8/bin/clang;-I/build/kahlee/opt/google/containers/android/usr/include/arch-x86_64/include/;--g cc-toolchain=/opt/android-n/arc-gcc/x86_64/x86_64-linux-android-4.9;-target;x86_64-linux-android is not a full path to an existing compiler tool.
Patching this change locally appeared to fix the issue:
https://gitweb.gentoo.org/repo/gentoo.git/commit/eclass/cmake-utils.eclass?id=4e427b97d5579b858e76b68fbecdfb811e0c24a1
I'll try to import the latest version from upstream.
Comment 1 by bugdroid1@chromium.org
, Sep 29 2017