Bug 1480558 - part 4 - add icudata support for aarch64 windows; r=mshal
authorNathan Froyd <froydnj@mozilla.com>
Tue, 21 Aug 2018 11:00:34 -0400
changeset 487704 8eac225243d8e0846f39c0fc1e4d831765ff6991
parent 487703 90a93173d2474aab0374c02c3af23f5110e4e456
child 487705 a2181b2ee1fc61dfc9bbb20e36df656b251704ad
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs1480558
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1480558 - part 4 - add icudata support for aarch64 windows; r=mshal yasm doesn't support aarch64, and trying to use GNU as with an MSVC build seems like sadness waiting to happen. Instead, we'll generate our own assembly file that armasm64 will accept.
build/autoconf/icu.m4
config/external/icu/data/genicudata.py
config/external/icu/data/moz.build
--- a/build/autoconf/icu.m4
+++ b/build/autoconf/icu.m4
@@ -86,16 +86,23 @@ AC_SUBST(USE_ICU)
 AC_SUBST(ICU_DATA_FILE)
 
 if test -n "$USE_ICU"; then
     dnl Source files that use ICU should have control over which parts of the ICU
     dnl namespace they want to use.
     AC_DEFINE(U_USING_ICU_NAMESPACE,0)
 
     if test -z "$MOZ_SYSTEM_ICU"; then
-        if test -z "$YASM" -a -z "$GNU_AS" -a "$COMPILE_ENVIRONMENT"; then
-            AC_MSG_ERROR([Building ICU requires either yasm or a GNU assembler. If you do not have either of those available for this platform you must use --without-intl-api])
-        fi
+        case "$OS_TARGET:$CPU_ARCH" in
+        WINNT:aarch64)
+            dnl we use non-yasm, non-GNU as solutions here.
+            ;;
+        *)
+            if test -z "$YASM" -a -z "$GNU_AS" -a "$COMPILE_ENVIRONMENT"; then
+                AC_MSG_ERROR([Building ICU requires either yasm or a GNU assembler. If you do not have either of those available for this platform you must use --without-intl-api])
+            fi
+            ;;
+        esac
         dnl We build ICU as a static library.
         AC_DEFINE(U_STATIC_IMPLEMENTATION)
     fi
 fi
 ])
new file mode 100644
--- /dev/null
+++ b/config/external/icu/data/genicudata.py
@@ -0,0 +1,14 @@
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+
+def main(output, data_file, data_symbol):
+    output.write('''    AREA .rdata,ALIGN=4,DATA,READONLY
+    EXPORT _{data_symbol}[DATA]
+_{data_symbol}
+    INCBIN {data_file}
+    END
+'''.format(data_file=data_file, data_symbol=data_symbol))
--- a/config/external/icu/data/moz.build
+++ b/config/external/icu/data/moz.build
@@ -9,19 +9,30 @@
 Library('icudata')
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     if CONFIG['CPU_ARCH'] == 'x86':
         ASFLAGS += ['-DPREFIX']
 elif CONFIG['OS_ARCH'] == 'Darwin':
     ASFLAGS += ['-DPREFIX']
 
-ASFLAGS += [
+data_symbol = 'icudt%s_dat' % CONFIG['MOZ_ICU_VERSION']
+asflags = [
     '-DICU_DATA_FILE="%s"' % CONFIG['ICU_DATA_FILE'],
-    '-DICU_DATA_SYMBOL=icudt%s_dat' % CONFIG['MOZ_ICU_VERSION'],
+    '-DICU_DATA_SYMBOL=%s' % data_symbol,
 ]
 LOCAL_INCLUDES += ['.']
 
-if CONFIG['HAVE_YASM']:
+if CONFIG['OS_TARGET'] == 'WINNT' and CONFIG['CPU_ARCH'] == 'aarch64':
+    icudata = 'icudata.asm'
+    GENERATED_FILES += [icudata]
+    SOURCES += ['!%s' % icudata]
+    icudata = GENERATED_FILES[icudata]
+    icudata.script = 'genicudata.py'
+    icudata.inputs = [CONFIG['ICU_DATA_FILE']]
+    icudata.flags = [data_symbol]
+elif CONFIG['HAVE_YASM']:
     USE_YASM = True
     SOURCES += ['icudata.s']
+    ASFLAGS += asflags
 elif CONFIG['GNU_AS']:
     SOURCES += ['icudata_gas.S']
+    ASFLAGS += asflags