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: CONFIRMED
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
Modified: 2020-06-09 19:58 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 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() {