Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2660)

Unified Diff: build/linux/sysroot_scripts/install-sysroot.py

Issue 1473363002: Revert of Use sysroot by default for all linux builds (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/config/sysroot.gni ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/linux/sysroot_scripts/install-sysroot.py
diff --git a/build/linux/sysroot_scripts/install-sysroot.py b/build/linux/sysroot_scripts/install-sysroot.py
index 3b47c37352b2f10b2e78be91baeafd3fe9854184..38e8a5179f9d234c6ae8378c3c9f32529dad1c82 100755
--- a/build/linux/sysroot_scripts/install-sysroot.py
+++ b/build/linux/sysroot_scripts/install-sysroot.py
@@ -103,6 +103,28 @@
return None
+def UsingSysroot(target_arch, is_android, gyp_defines):
+ # ChromeOS uses a chroot, so doesn't need a sysroot
+ if gyp_defines.get('chromeos'):
+ return False
+
+ # When cross-compiling non-Android builds we always use a sysroot
+ if not is_android and target_arch in ('arm', 'mips', 'i386'):
+ return True
+
+ # Setting use_sysroot=1 GYP_DEFINES forces the use of the sysroot even
+ # when not cross compiling
+ if gyp_defines.get('use_sysroot'):
+ return True
+
+ # Official builds always use the sysroot.
+ if (gyp_defines.get('branding') == 'Chrome' and
+ gyp_defines.get('buildtype') == 'Official'):
+ return True
+
+ return False
+
+
def main():
if options.running_as_hook and not sys.platform.startswith('linux'):
return 0
@@ -111,10 +133,6 @@
supplemental_includes = gyp_chromium.GetSupplementalFiles()
gyp_defines = gyp_chromium.GetGypVars(supplemental_includes)
is_android = gyp_defines.get('OS') == 'android'
-
- if (options.running_as_hook and (not is_android) and
- (gyp_defines.get('chromeos') or gyp_defines.get('use_sysroot') == '0')):
- return 0
if options.arch:
target_arch = options.arch
@@ -123,6 +141,10 @@
if not target_arch:
print 'Unable to detect target architecture'
return 1
+
+ if (options.running_as_hook and
+ not UsingSysroot(target_arch, is_android, gyp_defines)):
+ return 0
if is_android:
# 32-bit Android builds require a 32-bit host sysroot for the v8 snapshot.
« no previous file with comments | « build/config/sysroot.gni ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698