From f2daeb9d70ca9311c0b035b7bde63f2e681d09cb Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Thu, 2 Jul 2015 05:07:56 +0000 Subject: [PATCH] Build ia32 target with sysroot --- .gitignore | 1 + common.gypi | 2 -- script/bootstrap.py | 10 ++++++---- script/install-sysroot.py | 4 ++-- toolchain.gypi | 18 ++++++++++++++---- 5 files changed, 23 insertions(+), 12 deletions(-) diff --git a/.gitignore b/.gitignore index 204fce0d65b1..0c6f4cb79dd0 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ /out/ /vendor/brightray/vendor/download/ /vendor/debian_wheezy_arm-sysroot/ +/vendor/debian_wheezy_i386-sysroot/ /vendor/python_26/ /vendor/npm/ /vendor/llvm/ diff --git a/common.gypi b/common.gypi index f1a77b6de958..84c2b6c9826a 100644 --- a/common.gypi +++ b/common.gypi @@ -33,8 +33,6 @@ 'V8_BASE': '', 'v8_postmortem_support': 'false', 'v8_enable_i18n_support': 'false', - # Required by Linux (empty for now, should support it in future). - 'sysroot': '', }, # Settings to compile node under Windows. 'target_defaults': { diff --git a/script/bootstrap.py b/script/bootstrap.py index 6d89dbe358e1..efe96eacbb39 100755 --- a/script/bootstrap.py +++ b/script/bootstrap.py @@ -33,8 +33,8 @@ def main(): update_node_modules('.') bootstrap_brightray(args.dev, args.url, args.target_arch) - if args.target_arch == 'arm': - download_arm_sysroot() + if args.target_arch in ['arm', 'ia32'] and PLATFORM == 'linux': + download_sysroot(args.target_arch) create_chrome_version_h() touch_config_gypi() @@ -123,9 +123,11 @@ def update_clang(): execute_stdout([os.path.join(SOURCE_ROOT, 'script', 'update-clang.sh')]) -def download_arm_sysroot(): +def download_sysroot(target_arch): + if target_arch == 'ia32': + target_arch = 'i386' execute_stdout([os.path.join(SOURCE_ROOT, 'script', 'install-sysroot.py'), - '--arch', 'arm']) + '--arch', target_arch]) def create_chrome_version_h(): diff --git a/script/install-sysroot.py b/script/install-sysroot.py index 50b0d6b7b634..69acfb13269a 100755 --- a/script/install-sysroot.py +++ b/script/install-sysroot.py @@ -31,13 +31,13 @@ SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) URL_PREFIX = 'https://github.com' URL_PATH = 'atom/debian-sysroot-image-creator/releases/download' REVISION_AMD64 = 264817 -REVISION_I386 = 264817 +REVISION_I386 = 'v0.2.0' REVISION_ARM = 'v0.1.0' TARBALL_AMD64 = 'debian_wheezy_amd64_sysroot.tgz' TARBALL_I386 = 'debian_wheezy_i386_sysroot.tgz' TARBALL_ARM = 'debian_wheezy_arm_sysroot.tgz' TARBALL_AMD64_SHA1SUM = '74b7231e12aaf45c5c5489d9aebb56bd6abb3653' -TARBALL_I386_SHA1SUM = 'fe3d284926839683b00641bc66c9023f872ea4b4' +TARBALL_I386_SHA1SUM = 'f5b2ceaeb3f7e6bc2058733585fe877d002b5fa7' TARBALL_ARM_SHA1SUM = '72e668c57b8591e108759584942ddb6f6cee1322' SYSROOT_DIR_AMD64 = 'debian_wheezy_amd64-sysroot' SYSROOT_DIR_I386 = 'debian_wheezy_i386-sysroot' diff --git a/toolchain.gypi b/toolchain.gypi index e2aa7de3fbed..aeed967782c2 100644 --- a/toolchain.gypi +++ b/toolchain.gypi @@ -8,6 +8,9 @@ # Set this to true when building with Clang. 'clang%': 1, + # Path to sysroot dir. + 'sysroot%': '', + 'variables': { # Set ARM architecture version. 'arm_version%': 7, @@ -90,11 +93,18 @@ }], # clang==1 # Setup sysroot environment. - ['OS=="linux" and target_arch=="arm"', { + ['OS=="linux" and target_arch in ["arm", "ia32"]', { 'variables': { - # sysroot needs to be an absolute path otherwise it generates - # incorrect results when passed to pkg-config - 'sysroot': '<(source_root)/vendor/debian_wheezy_arm-sysroot', + 'conditions': [ + ['target_arch=="arm"', { + # sysroot needs to be an absolute path otherwise it generates + # incorrect results when passed to pkg-config + 'sysroot': '<(source_root)/vendor/debian_wheezy_arm-sysroot', + }], + ['target_arch=="ia32"', { + 'sysroot': '<(source_root)/vendor/debian_wheezy_i386-sysroot', + }], + ], }, 'target_defaults': { 'target_conditions': [