Currently the systemd ebuild checks for required features in compiler by limiting itself to gcc (and a version match). This means when using clang as the default compiler, systemd fails to build in the pre-merge checks when systemd actually builds fine with clang.. Currently setting CC=clang and CXX=clang++ throws the following in the pre-merge checks: * systemd requires at least gcc 4.6 to build. Please switch the active * gcc version using gcc-config. * ERROR: sys-apps/systemd-232::gentoo failed (pretend phase): * systemd requires at least gcc 4.6 * * Call stack: * ebuild.sh, line 115: Called pkg_pretend * systemd-232.ebuild, line 133: Called die * The specific snippet of code: * die "systemd requires at least gcc 4.6" * * If you need support, post the output of `emerge --info '=sys-apps/systemd-232::gentoo'`, * the complete build log and the output of `emerge -pqv '=sys-apps/systemd-232::gentoo'`. * The complete build log is located at '/home/portage/portage/sys-apps/systemd-232/temp/build.log'. * The ebuild environment file is located at '/home/portage/portage/sys-apps/systemd-232/temp/die.env'. * Working directory: '/home/portage/portage/sys-apps/systemd-232/homedir' * S: '/home/portage/portage/sys-apps/systemd-232/work/systemd-232' This is due the following check in the ebuild: if [[ ${MERGE_TYPE} != binary ]]; then if [[ $(gcc-major-version) -lt 4 || ( $(gcc-major-version) -eq 4 && $(gcc-minor-version) -lt 6 ) ]] then eerror "systemd requires at least gcc 4.6 to build. Please switch the active" eerror "gcc version using gcc-config." die "systemd requires at least gcc 4.6" fi fi This should instead check for requisite version of compiler set or better yet, check for feature support in the provided compiler.
I think we should just drop this check entirely.
commit 8741d5b7248b5bbf82eaebceabc1bb79f308a5c4 Author: Mike Gilbert <floppym@gentoo.org> Date: Fri Nov 18 13:21:44 2016 -0500 sys-apps/systemd: make the ebuild compiler-agnostic Remove binutils and gcc from depend. Remove gcc version check. Pass --with-efi-libdir to workaround compilers which do not support the -print-multi-os-directory option. Note that gnu-efi headers still require gcc; EFI_CC can be set to gcc to work around this. Bug: https://bugs.gentoo.org/599210 Package-Manager: portage-2.3.2_p8 sys-apps/systemd/systemd-232.ebuild | 13 +------------ sys-apps/systemd/systemd-9999.ebuild | 13 +------------ 2 files changed, 2 insertions(+), 24 deletions(-)