The solution Mozilla did in Firefox 80, is to store the little endian data file (generated by the script you referenced) in the tree. Then if targeting big endian, they build icupkg ... a utility for dealing with the ICU data file for the host system and call it to convert the little endian file to big endian. This is what I ported over, with some modifications because they ONLY support building as a library, and not packaging the ICU data file in non-library form.
I tested it on MacPPC and it appeared to work, but GNU as on MacPPC is too old and doesn't support the "incbin" directive. (Also building newer versions of binutils on MacPPC don't include GNU as for some reason). So I disabled that... so on MacPPC it does not build the ICU data into the library.
The output shows it building the icupkg command but then it tries to build the ICU data library before it calls icupkg to convert it to big endian, so the file is missing. Just not sure why it is doing it in that order when I have it in the same order in the file as Mozilla... My first idea would be to move the .S bits of config/external/icu/data/moz.build to the bottom of the file and see if that changes the order.
https://bugzilla.mozilla.org/show_bug.cgi?id=1264836
Code: Select all
--- a/config/external/icu/data/moz.build
+++ b/config/external/icu/data/moz.build
@@ -28,15 +28,6 @@ ASFLAGS += [
]
LOCAL_INCLUDES += ['.']
-if CONFIG['HAVE_YASM']:
- USE_YASM = True
- SOURCES += ['icudata.s']
-elif CONFIG['OS_ARCH'] == 'Darwin':
- if CONFIG['CPU_ARCH'] != 'ppc':
- SOURCES += ['icudata_gas.S']
-elif CONFIG['GNU_AS']:
- SOURCES += ['icudata_gas.S']
-
if CONFIG['TARGET_ENDIANNESS'] == 'big':
# Generate a big-endian data file for inclusion in an ICU library
GeneratedFile(data_file['big'],
@@ -53,3 +44,12 @@ if CONFIG['MOZ_ICU_DATA_ARCHIVE']:
script='convert_icudata.py',
inputs=[data_file['little']])
+if CONFIG['HAVE_YASM']:
+ USE_YASM = True
+ SOURCES += ['icudata.s']
+elif CONFIG['OS_ARCH'] == 'Darwin':
+ if CONFIG['CPU_ARCH'] != 'ppc':
+ SOURCES += ['icudata_gas.S']
+elif CONFIG['GNU_AS']:
+ SOURCES += ['icudata_gas.S']