Removed CXX_target for Android
Don't rely on compiler_version.py, we pass in the gcc_version for Android Also revert the previous compiler_version.py change. BUG=143889 Review URL: https://chromiumcodereview.appspot.com/11185059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162808 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
@@ -107,24 +107,12 @@ export ANDROID_GOMA_WRAPPER
|
|||||||
# Declare Android are cross compile.
|
# Declare Android are cross compile.
|
||||||
export GYP_CROSSCOMPILE=1
|
export GYP_CROSSCOMPILE=1
|
||||||
|
|
||||||
export CXX_target="${ANDROID_GOMA_WRAPPER} \
|
|
||||||
$(echo -n ${ANDROID_TOOLCHAIN}/*-g++)"
|
|
||||||
|
|
||||||
# Performs a gyp_chromium run to convert gyp->Makefile for android code.
|
# Performs a gyp_chromium run to convert gyp->Makefile for android code.
|
||||||
android_gyp() {
|
android_gyp() {
|
||||||
|
# This is just a simple wrapper of gyp_chromium, please don't add anything
|
||||||
|
# in this function.
|
||||||
echo "GYP_GENERATORS set to '$GYP_GENERATORS'"
|
echo "GYP_GENERATORS set to '$GYP_GENERATORS'"
|
||||||
# http://crbug.com/143889.
|
|
||||||
# In case we are doing a Clang build, we have to unset CC_target and
|
|
||||||
# CXX_target. Otherwise GYP ends up generating a gcc build (although we set
|
|
||||||
# 'clang' to 1). This behavior was introduced by
|
|
||||||
# 54d2f6fe6d8a7b9d9786bd1f8540df6b4f46b83f in GYP.
|
|
||||||
(
|
(
|
||||||
# Fork to avoid side effects on the user's environment variables.
|
|
||||||
if echo "$GYP_DEFINES" | grep -qE '(clang|asan)'; then
|
|
||||||
if echo "$CXX_target" | grep -q g++; then
|
|
||||||
unset CXX_target
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
"${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" --check "$@"
|
"${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" --check "$@"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@@ -33,6 +33,9 @@ common_vars_defines() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
toolchain_version="4.6"
|
toolchain_version="4.6"
|
||||||
|
# We directly set the gcc_version since we know what we use, and it should
|
||||||
|
# be set to xx instead of x.x. Refer the output of compiler_version.py.
|
||||||
|
gcc_version="46"
|
||||||
toolchain_target=$(basename \
|
toolchain_target=$(basename \
|
||||||
${ANDROID_NDK_ROOT}/toolchains/${toolchain_arch}-${toolchain_version})
|
${ANDROID_NDK_ROOT}/toolchains/${toolchain_arch}-${toolchain_version})
|
||||||
toolchain_path="${ANDROID_NDK_ROOT}/toolchains/${toolchain_target}"\
|
toolchain_path="${ANDROID_NDK_ROOT}/toolchains/${toolchain_target}"\
|
||||||
@@ -70,6 +73,7 @@ common_vars_defines() {
|
|||||||
# to canonicalize them (remove double '/', remove trailing '/', etc).
|
# to canonicalize them (remove double '/', remove trailing '/', etc).
|
||||||
DEFINES="OS=android"
|
DEFINES="OS=android"
|
||||||
DEFINES+=" host_os=${host_os}"
|
DEFINES+=" host_os=${host_os}"
|
||||||
|
DEFINES+=" gcc_version=${gcc_version}"
|
||||||
|
|
||||||
if [[ -n "$CHROME_ANDROID_OFFICIAL_BUILD" ]]; then
|
if [[ -n "$CHROME_ANDROID_OFFICIAL_BUILD" ]]; then
|
||||||
DEFINES+=" branding=Chrome"
|
DEFINES+=" branding=Chrome"
|
||||||
|
@@ -33,42 +33,21 @@ def GetVersion(compiler):
|
|||||||
print >> sys.stderr, e
|
print >> sys.stderr, e
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
def GetVersionFromEnvironment(compiler_env):
|
|
||||||
""" Returns the version of compiler
|
|
||||||
|
|
||||||
If the compiler was set by the given environment variable and exists,
|
|
||||||
return its version, otherwise None is returned.
|
|
||||||
"""
|
|
||||||
cxx = os.getenv(compiler_env, None)
|
|
||||||
if cxx:
|
|
||||||
cxx_version = GetVersion(cxx)
|
|
||||||
if cxx_version != "":
|
|
||||||
return cxx_version
|
|
||||||
return None
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
# Check if CXX_target or CXX environment variable exists an if it does use
|
# Check if CXX environment variable exists and
|
||||||
# that compiler.
|
# if it does use that compiler.
|
||||||
# TODO: Fix ninja (see http://crbug.com/140900) instead and remove this code
|
cxx = os.getenv("CXX", None)
|
||||||
# In ninja's cross compile mode, the CXX_target is target compiler, while
|
if cxx:
|
||||||
# the CXX is host. The CXX_target needs be checked first, though the target
|
cxxversion = GetVersion(cxx)
|
||||||
# and host compiler have different version, there seems no issue to use the
|
if cxxversion != "":
|
||||||
# target compiler's version number as gcc_version in Android.
|
print cxxversion
|
||||||
cxx_version = GetVersionFromEnvironment("CXX_target")
|
return 0
|
||||||
if cxx_version:
|
else:
|
||||||
print cxx_version
|
# Otherwise we check the g++ version.
|
||||||
return 0
|
gccversion = GetVersion("g++")
|
||||||
|
if gccversion != "":
|
||||||
cxx_version = GetVersionFromEnvironment("CXX")
|
print gccversion
|
||||||
if cxx_version:
|
return 0
|
||||||
print cxx_version
|
|
||||||
return 0
|
|
||||||
|
|
||||||
# Otherwise we check the g++ version.
|
|
||||||
gccversion = GetVersion("g++")
|
|
||||||
if gccversion != "":
|
|
||||||
print gccversion
|
|
||||||
return 0
|
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user