This is an auto-filed bug because x11-apps/xinit fails to compile if CPP is set to CC -E. The issue was originally discovered on amd64, but it may be reproducible on other arches as well. If you think that a different summary clarifies the issue better, feel free to change it. Attached build log and emerge --info. NOTE: To reproduce this issue you may want to set the CPP variable to gcc -E.
Created attachment 642584 [details] build.log build log and emerge --info
Created attachment 642586 [details] other.tar.bz2 other logs
I'm seeing this happen without an explicit CC including '-E', and it seems this is turning up from somewhere in an inherited eclass. Though it also turns up mentioned in config.guess .... Using: - Gcc 10 - gcc-config[-native-symlinks] - binutils-config[-native-symlinks] So this *might* be bug #tc-directly
This one is fun. xinit's 'XORG_PROG_RAWCPP' .m4 macro attempts to use as a raw CPP two tools: 'cpp' and '${CC} -E': https://cgit.freedesktop.org/xorg/util/macros/tree/xorg-macros.m4.in#n52 1. 'cpp' fails because system has only ${CHOST}-cpp. Can be fixed with one-liner: --- a/aclocal.m4 +++ b/aclocal.m4 @@ -355,7 +355,7 @@ m4_undefine([maj_needed]) # such as man pages and config files AC_DEFUN([XORG_PROG_RAWCPP],[ AC_REQUIRE([AC_PROG_CPP]) -AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], +AC_CHECK_TOOLS(RAWCPP, [cpp], [${CPP}], [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib]) # Check for flag to avoid builtin definitions - assumes unix is predefined, 2. '${CC} -E' can't be used at all in a context expected by XORG_PROG_RAWCPP: $ /usr/bin/x86_64-pc-linux-gnu-cpp < /dev/null # 1 "<stdin>" # 1 "<built-in>" # 1 "<command-line>" # 31 "<command-line>" # 1 "/usr/include/stdc-predef.h" 1 3 4 # 32 "<command-line>" 2 # 1 "<stdin>" $ /usr/bin/x86_64-pc-linux-gnu-gcc -E < /dev/null x86_64-pc-linux-gnu-gcc: fatal error: no input files compilation terminated. Looks like both should be fixed upstream. As a workaround xorg ebuilds could set RAWCPP to an absolute path of tool-prefixed CPP: --- a/x11-apps/xinit/xinit-1.4.1.ebuild +++ b/x11-apps/xinit/xinit-1.4.1.ebuild @@ -3,7 +3,7 @@ EAPI=7 -inherit xorg-3 +inherit xorg-3 toolchain-funcs DESCRIPTION="X Window System initializer" @@ -35,6 +35,12 @@ XORG_CONFIGURE_OPTIONS=( --with-xinitdir="${EPREFIX}"/etc/X11/xinit ) +src_prepare() { + default + + export RAWCPP=$(type -P "$(tc-getPROG RAWCPP cpp)") +} + src_install() { xorg-3_src_install
Upstream https://gitlab.freedesktop.org/trofi/macros/-/commit/bd66ce3ba4a9d1d1490cb5775a2fdd0b408879b6 commit might have fixed prefixed tool detection: """ On some distributions tools like cpp are prefixed with the host-triple, to check for this prefixed version first AC_PATH_TOOL should be used. If no prefixed cpp, it will fallback to the unprefixed name. """
Created attachment 644960 [details, diff] 0001-XORG_PROG_RAWCPP-Use-AC_PATH_TOOL-to-find-preprocess.patch Applying 0001-XORG_PROG_RAWCPP-Use-AC_PATH_TOOL-to-find-preprocess.patch to x11-misc/util-macros makes xinit compile for me.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8172b34489455d1cb6d6abef0a0742a3d463e919 commit 8172b34489455d1cb6d6abef0a0742a3d463e919 Author: Sergei Trofimovich <slyfox@gentoo.org> AuthorDate: 2020-10-11 09:33:29 +0000 Commit: Sergei Trofimovich <slyfox@gentoo.org> CommitDate: 2020-10-11 09:34:05 +0000 x11-misc/util-macros: lookup tool-prefixed 'cpp' Reported-by: Agostino Sarubbo Closes: https://bugs.gentoo.org/726130 Package-Manager: Portage-3.0.8, Repoman-3.0.1 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> .../util-macros/files/util-macros-1.19.2-CPP.patch | 33 ++++++++++++++++++++++ x11-misc/util-macros/util-macros-1.19.2-r2.ebuild | 21 ++++++++++++++ 2 files changed, 54 insertions(+)