media-libs/x265 fails to cross compile for arm here since it relies on CMAKE_SYSTEM_PROCESSOR for enabling some hand written assembly. By default, CMAKE_SYSTEM_PROCESSOR is set to CMAKE_HOST_SYSTEM_PROCESSOR, which is obtained via 'uname -m' (this is not what cmake docs say but what the code of cmake 3.7.2 says...). Setting CMAKE_SYSTEM_PROCESSOR to ${CHOST%%-*} in the cmake toolchain file seems to be what we need to get this work properly. Proposed patch: diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass index 7b3500b197..512bd93c7b 100644 --- a/eclass/cmake-utils.eclass +++ b/eclass/cmake-utils.eclass @@ -538,6 +538,7 @@ enable_cmake-utils_src_configure() { SET (CMAKE_Fortran_COMPILER "${myFC/ /;}") SET (CMAKE_AR $(type -P $(tc-getAR)) CACHE FILEPATH "Archive manager" FORCE) SET (CMAKE_RANLIB $(type -P $(tc-getRANLIB)) CACHE FILEPATH "Archive index generator" FORCE) + SET (CMAKE_SYSTEM_PROCESSOR "${CHOST%%-*}") _EOF_ # We are using the C compiler for assembly by default.
Note in case this was not clear: this was tested to fix cross compiling x265.
Looks fine to me.
(In reply to Michael Palimaka (kensington) from comment #2) > Looks fine to me. +1
Looks fine and should be harmless for non-crosscompilling as well. Thanks, I took the liberty to push it to master.