Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 599210 - sys-apps/systemd-232 gcc checks are incorrect when using clang
Summary: sys-apps/systemd-232 gcc checks are incorrect when using clang
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo systemd Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-08 13:24 UTC by Amit Prakash Ambasta
Modified: 2016-11-18 18:22 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Amit Prakash Ambasta 2016-11-08 13:24:21 UTC
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.
Comment 1 Mike Gilbert gentoo-dev 2016-11-08 17:08:07 UTC
I think we should just drop this check entirely.
Comment 2 Mike Gilbert gentoo-dev 2016-11-18 18:22:38 UTC
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(-)