Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 654424 - toolchain-funcs.eclass: tc-env_build: Don't clobber *FLAGS when not cross compiling
Summary: toolchain-funcs.eclass: tc-env_build: Don't clobber *FLAGS when not cross com...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-30 13:59 UTC by Raul Rangel
Modified: 2018-05-05 20:16 UTC (History)
1 user (show)

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


Attachments
Copy *FLAGS to BUILD_*FLAGS so they get set correctly in tc-env_build (0002-tc-export_build_env-handle-non-cross-compile-case.patch,1.68 KB, patch)
2018-05-01 18:49 UTC, Raul Rangel
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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(-)