Browse Source

Build ia32 target with sysroot

Cheng Zhao 9 years ago
parent
commit
f2daeb9d70
5 changed files with 23 additions and 12 deletions
  1. 1 0
      .gitignore
  2. 0 2
      common.gypi
  3. 6 4
      script/bootstrap.py
  4. 2 2
      script/install-sysroot.py
  5. 14 4
      toolchain.gypi

+ 1 - 0
.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/

+ 0 - 2
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': {

+ 6 - 4
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():

+ 2 - 2
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'

+ 14 - 4
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': [