summaryrefslogtreecommitdiff
path: root/eclass/toolchain-funcs.eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-05-06 11:18:16 +0100
committerV3n3RiX <venerix@redcorelinux.org>2018-05-06 11:18:16 +0100
commitebce8994fe3cc4ca9fbc96ca837cb4c4e98adcbd (patch)
treef2204ce5f94dc3cb13728ff93649d889944952bb /eclass/toolchain-funcs.eclass
parentfe1c8b732bd548b699d4c2ef725f67f8b8c8911c (diff)
gentoo resync : 06.05.2018
Diffstat (limited to 'eclass/toolchain-funcs.eclass')
-rw-r--r--eclass/toolchain-funcs.eclass22
1 files changed, 15 insertions, 7 deletions
diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index 4b1876b8e09b..1c8090cf75c7 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/eclass/toolchain-funcs.eclass
@@ -247,13 +247,21 @@ tc-stack-grows-down() {
# Export common build related compiler settings.
tc-export_build_env() {
tc-export "$@"
- # Some build envs will initialize vars like:
- # : ${BUILD_LDFLAGS:-${LDFLAGS}}
- # So make sure all variables are non-empty. #526734
- : ${BUILD_CFLAGS:=-O1 -pipe}
- : ${BUILD_CXXFLAGS:=-O1 -pipe}
- : ${BUILD_CPPFLAGS:= }
- : ${BUILD_LDFLAGS:= }
+ if tc-is-cross-compiler; then
+ # Some build envs will initialize vars like:
+ # : ${BUILD_LDFLAGS:-${LDFLAGS}}
+ # So make sure all variables are non-empty. #526734
+ : ${BUILD_CFLAGS:=-O1 -pipe}
+ : ${BUILD_CXXFLAGS:=-O1 -pipe}
+ : ${BUILD_CPPFLAGS:= }
+ : ${BUILD_LDFLAGS:= }
+ else
+ # https://bugs.gentoo.org/654424
+ : ${BUILD_CFLAGS:=${CFLAGS}}
+ : ${BUILD_CXXFLAGS:=${CXXFLAGS}}
+ : ${BUILD_CPPFLAGS:=${CPPFLAGS}}
+ : ${BUILD_LDFLAGS:=${LDFLAGS}}
+ fi
export BUILD_{C,CXX,CPP,LD}FLAGS
# Some packages use XXX_FOR_BUILD.