Only build against prebuilt sysroot when using clang

Its is not currently possible to use gcc with the sysroot
since the sysroot only contains C++ headers for gcc 4.6
and gcc 4.8 is required to build chromium.  Luckily clang
is more flexible and able to detect and work with the 4.6
headers in the sysroot.

BUG=504446

Review URL: https://codereview.chromium.org/1476923005

Cr-Original-Commit-Position: refs/heads/master@{#361905}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: ccc8c1e14c155255a8ef844704d97fa8e7d0dac2
This commit is contained in:
sbc 2015-11-26 08:41:15 -08:00 коммит произвёл Commit bot
Родитель 9fd7bacbdd
Коммит 76ce1e741b
2 изменённых файлов: 10 добавлений и 7 удалений

Просмотреть файл

@ -94,6 +94,12 @@
# if packaging for a linux distro)
'use_sysroot%': 1,
# Set this to true when building with Clang.
# See http://code.google.com/p/chromium/wiki/Clang for details.
# If this is set, clang is used as both host and target compiler in
# cross-compile builds.
'clang%': 0,
# Override buildtype to select the desired build flavor.
# Dev - everyday build for development/testing
# Official - release build (generally implies additional processing)
@ -153,6 +159,7 @@
# Copy conditionally-set variables out one scope.
'chromeos%': '<(chromeos)',
'chromecast%': '<(chromecast)',
'clang%': '<(clang)',
'desktop_linux%': '<(desktop_linux)',
'use_aura%': '<(use_aura)',
'use_ash%': '<(use_ash)',
@ -299,7 +306,7 @@
# Not used when chromecast=1 since ozone_platform_gbm doesn't
# currently build against the linux sysroot
# TODO(sbc): http://crbug.com/559708
['OS=="linux" and chromeos==0 and chromecast==0 and use_sysroot==1', {
['OS=="linux" and chromeos==0 and chromecast==0 and clang==1 and use_sysroot==1', {
# sysroot needs to be an absolute path otherwise it generates
# incorrect results when passed to pkg-config
'conditions': [
@ -325,6 +332,7 @@
# Copy conditionally-set variables out one scope.
'chromeos%': '<(chromeos)',
'chromecast%': '<(chromecast)',
'clang%': '<(clang)',
'host_arch%': '<(host_arch)',
'target_arch%': '<(target_arch)',
'target_subarch%': '<(target_subarch)',
@ -622,11 +630,6 @@
# Clang stuff.
'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
# Set this to true when building with Clang.
# See http://code.google.com/p/chromium/wiki/Clang for details.
# If this is set, clang is used as both host and target compiler in
# cross-compile builds.
'clang%': 0,
# Use experimental lld linker instead of the platform's default linker.
'use_lld%': 0,

Просмотреть файл

@ -33,7 +33,7 @@ if (current_toolchain == default_toolchain && target_sysroot != "") {
} else {
sysroot = ""
}
} else if (is_linux && !is_chromeos && use_sysroot) {
} else if (is_linux && !is_chromeos && is_clang && use_sysroot) {
# By default build against a sysroot image downloaded from Cloud Storage
# during gclient runhooks.
if (current_cpu == "x64") {