Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 726184 - =sys-devel/flex-2.6.4-r1 does not respect CC/CC_FOR_BUILD variable
Summary: =sys-devel/flex-2.6.4-r1 does not respect CC/CC_FOR_BUILD variable
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: tc-directly
  Show dependency tree
 
Reported: 2020-05-30 08:29 UTC by Sergei Trofimovich (RETIRED)
Modified: 2022-06-17 02:12 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 Sergei Trofimovich (RETIRED) gentoo-dev 2020-05-30 08:29:45 UTC
On sys-devel/gcc-config[-native-symlinks] system flex fails to build in configure phase as:

"""
...
checking for x86_64-pc-linux-gnu-gcc -m32 option to accept ISO C89... (cached) none needed
checking whether x86_64-pc-linux-gnu-gcc -m32 understands -c and -o together... (cached) yes
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/tmp/portage/sys-devel/flex-2.6.4-r1/work/flex-2.6.4-abi_x86_32.x86':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details
"""

sys-devel/gcc-config[-native-symlinks] removes default 'cc' and 'gcc' symlinks and relies on ebuilds passing CC/CXX variables.

In this case CC_FOR_BUILD variable is not set in the ebuild.

The following seems to be enough to get flex going again:

--- a/sys-devel/flex/flex-2.6.4-r1.ebuild
+++ b/sys-devel/flex/flex-2.6.4-r1.ebuild
@@ -3,7 +3,7 @@

 EAPI="6"

-inherit eutils flag-o-matic libtool ltprune multilib-minimal
+inherit eutils flag-o-matic libtool ltprune multilib-minimal toolchain-funcs

 DESCRIPTION="The Fast Lexical Analyzer"
 HOMEPAGE="https://flex.sourceforge.net/ https://github.com/westes/flex"
@@ -38,6 +38,8 @@ src_prepare() {
 			Makefile.in || die
 	fi
 	elibtoolize # Prefix always needs this
+
+	export CC_FOR_BUILD="$(tc-getBUILD_CC)"
 }

 src_configure() {
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-06-17 02:12:17 UTC
commit 3370923f46b01137d4e48d89c58a3b13eb2c10a6
Author: Manoj Gupta <manojgupta@google.com>
Date:   Wed Jun 10 14:40:11 2020 -0700

    sys-devel/flex: Respect portage host cc variable

    Pass CC_FOR_BUILD to econf. Otherwise it invokes gcc instead of portage
    specified HOST/BUILD CC.

    Signed-off-by: Manoj Gupta <manojgupta@google.com>
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>
    Closes: https://github.com/gentoo/gentoo/pull/16177