Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 654424

Summary: toolchain-funcs.eclass: tc-env_build: Don't clobber *FLAGS when not cross compiling
Product: Gentoo Linux Reporter: Raul Rangel <rrangel>
Component: EclassesAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED FIXED    
Severity: normal CC: floppym
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=653902
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Copy *FLAGS to BUILD_*FLAGS so they get set correctly in tc-env_build

Description Raul Rangel 2018-04-30 13:59:52 UTC
Similar to https://bugs.gentoo.org/630282, we should make tc-env_build handle the non-cross compiler case. See https://bugs.gentoo.org/653902#c5 for context.

tc-env_build currently looks like so:

tc-env_build() {
	tc-export_build_env
	CFLAGS=${BUILD_CFLAGS} \
	CXXFLAGS=${BUILD_CXXFLAGS} \
	CPPFLAGS=${BUILD_CPPFLAGS} \
	LDFLAGS=${BUILD_LDFLAGS} \
	AR=$(tc-getBUILD_AR) \
	AS=$(tc-getBUILD_AS) \
	CC=$(tc-getBUILD_CC) \
	CPP=$(tc-getBUILD_CPP) \
	CXX=$(tc-getBUILD_CXX) \
	LD=$(tc-getBUILD_LD) \
	NM=$(tc-getBUILD_NM) \
	PKG_CONFIG=$(tc-getBUILD_PKG_CONFIG) \
	RANLIB=$(tc-getBUILD_RANLIB) \
	"$@"
}

In the non-cross case all the *FLAGS are overwritten.

This will allow the meson eclass to be simplified and just call:

tc-env_build "$@" || die

for cross and non-cross cases.
Comment 1 Raul Rangel 2018-05-01 18:49:52 UTC
Created attachment 529280 [details, diff]
Copy *FLAGS to BUILD_*FLAGS so they get set correctly in tc-env_build
Comment 2 Larry the Git Cow gentoo-dev 2018-05-05 20:16:07 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2dd9b21e7b9003c1dd6e7e71578449d01302d610

commit 2dd9b21e7b9003c1dd6e7e71578449d01302d610
Author:     Raul E Rangel <rrangel@chromium.org>
AuthorDate: 2018-05-01 18:40:30 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2018-05-05 20:15:55 +0000

    tc-export_build_env: handle non-cross compile case
    
    By handling the non-cross compiler case the meson.eclass can be
    simplified to `tc-env_build "$@" || die`.
    
    See https://bugs.gentoo.org/654424
    
    Change-Id: I1a90da46366c490abbf7d5660bf90482c7f22747
    Signed-off-by: Raul E Rangel <rrangel@chromium.org>
    Closes: https://bugs.gentoo.org/654424

 eclass/toolchain-funcs.eclass | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)