Since adding a simple C++ implementation of the Intl API seems like a big task (please discuss that idea in #16874 (moved)), I spent a little time trying to learn about and fix the cross-compile problems that are the subject of this ticket. I think I made a little progress but am out of time for today. Probably Georg got further than I did in the past, but I might as well record here what I learned.
Our build is using intl/icu/source/config/mh-mingw, which includes this comment:
# TODO: Finish the rest of this port. This platform port is incomplete.
(definitely a bad sign).
In general, there seems to be a mixup in the DLL and import library names. Strange suffixes are certainly used, e.g., .dll.a. I added a couple of config lines to intl/icu/source/config/mh-mingw, which seemed to help:
Since adding a simple C++ implementation of the Intl API seems like a big task (please discuss that idea in #16874 (moved)), I spent a little time trying to learn about and fix the cross-compile problems that are the subject of this ticket. I think I made a little progress but am out of time for today. Probably Georg got further than I did in the past, but I might as well record here what I learned.
Our build is using intl/icu/source/config/mh-mingw, which includes this comment:
# TODO: Finish the rest of this port. This platform port is incomplete.}}}(definitely a bad sign).In general, there seems to be a mixup in the DLL and import library names. Strange suffixes are certainly used, e.g., .dll.a. I added a couple of config lines to intl/icu/source/config/mh-mingw, which seemed to help:{{{LIBICUDT=$(top_builddir)/stubdata/$(LIBICU)$(DATA_STUBNAME)$(ICULIBSUFFIX)$(IMPORT_LIB_EXT)LIBICUUC=$(LIBDIR)/$(LIBICU)$(COMMON_STUBNAME)$(ICULIBSUFFIX)$(IMPORT_LIB_EXT) $(LIBICUDT)}}}
There are interesting things going on here. First I tried to tackle this from a different angle: I cross-compiled the ICU lib alone which is surprisingly working out of the box (at least the compilation does not break) and tried to determine what is wrong with Mozilla's one. I took the same version (52.1) and used the same toolchain but I am still puzzled.
I then applied the lines above to a plain ESR 38 build and used the toolchain I built for it. Somehow I am getting quite far. I am probably missing the libssp bits (have not checked yet) but still the build is failing close to the end while linking libxul:
{{{
INPUT("../../modules/zlib/src/zutil.o")
INPUT("StaticXULComponentsEnd/StaticXULComponentsEnd.o")
i686-w64-mingw32-g++: error: ../../intl/icu/target/lib/libicuin.a: Datei oder Verzeichnis nicht gefunden
i686-w64-mingw32-g++: error: ../../intl/icu/target/lib/libicuuc.a: Datei oder Verzeichnis nicht gefunden
i686-w64-mingw32-g++: error: ../../intl/icu/target/lib/libicudt.a: Datei oder Verzeichnis nicht gefunden
make[5]: *** [xul.dll] Fehler 1
Then I applied the two lines to a gitian build and this failed quite early indicating that both lines are not enough. I am fixing that right now I hope.> But now I get the following error:> {{{> /home/ubuntu/install/mingw-w64/lib/gcc/i686-w64-mingw32/5.1.0/../../../../i686-w64-mingw32/lib/../lib/libssp.a(ssp.o):ssp.c:(.text+0x239): multiple definition of `__stack_chk_fail'> ../lib/icuuc.dll.a(d001684.o):(.text+0x0): first defined here> collect2: error: ld returned 1 exit status> make[7]: Leaving directory `/home/ubuntu/build/tor-browser/obj-mingw/intl/icu/target/i18n'> make[7]: *** [../lib/icuin52.dll] Error 1> make[6]: Leaving directory `/home/ubuntu/build/tor-browser/obj-mingw/intl/icu/target'> make[6]: *** [all-recursive] Error 2> make[5]: Leaving directory `/home/ubuntu/build/tor-browser/obj-mingw/config/external/icu'> make[5]: *** [buildicu] Error 2> make[4]: *** [config/external/icu/target] Error 2> }}}Do you have a bit more context? When does this happen?
Do you have a bit more context? When does this happen?
It happens while building under /home/ubuntu/build/tor-browser/obj-mingw/intl/icu/target/i18n/, while trying to link ../lib/icuin52.dll. I ssh'd into the VM and grabbed the full command:
After a little more poking around this morning, I think the above command should be linking with the DLL (../lib/icuuc52.dll) instead of the static lib (../lib/icuuc.dll.a). I am going to make that change to the lines I suggested adding in comment:5 and see what happens. My revised additions to intl/icu/source/config/mh-mingw are:
# Use correct names for import libraries.# See https://trac.torproject.org/projects/tor/ticket/13419LIBICUDT= $(top_builddir)/stubdata/$(LIBICU)$(DATA_STUBNAME)$(ICULIBSUFFIX)$(IMPORT_LIB_EXT)LIBICUUC= $(LIBDIR)/$(LIBICU)$(COMMON_STUBNAME)$(ICULIBSUFFIX)$(SO_TARGET_VERSION_MAJOR).$(SO) $(LIBICUDT)
And now I get the same error as gk did (when linking xul.dll):
i686-w64-mingw32-g++: error: ../../intl/icu/target/lib/libicuin.a: No such file or directoryi686-w64-mingw32-g++: error: ../../intl/icu/target/lib/libicuuc.a: No such file or directoryi686-w64-mingw32-g++: error: ../../intl/icu/target/lib/libicudt.a: No such file or directory
The contents of ../../intl/icu/target/lib are:
icudt52.dll icuin52.dll icuin.dll.a icuuc52.dll icuuc.dll.a
I am out of time for now, but I guess things are still messed up with respect to import library names, DLL names, etc.
#18767 (moved) shows that the UI of Firefox itself is partly broken now without ICU support. Raising the prio and putting it on the 6.0a5 radar.
Trac: Reviewer: N/AtoN/A Priority: Medium to High Keywords: GeorgKoppen201511, TorBrowserTeam201512 deleted, tbb-6.0a5, ff45-esr, TorBrowserTeam201604 added Sponsor: N/AtoN/A Severity: N/Ato Major
There are interesting things going on here. First I tried to tackle this from a different angle: I cross-compiled the ICU lib alone which is surprisingly working out of the box (at least the compilation does not break) and tried to determine what is wrong with Mozilla's one. I took the same version (52.1) and used the same toolchain but I am still puzzled.
I thought it might be a good idea to start from here again trying to find out what the issue is. It turns out. ICU does not like the -static LDFLAG if it is configured with --disable-static --enable-shared as it is in a default setup. We have the former requirement due to bug 1116777. The patch in icu.m4 takes care of this.
The next issue was that all libraries have the Windows static library suffix .lib while .a is expected. This is addressed in the Makefile.in patch.
The final problem was that not all libraries are generated with the proper prefix lib. Changing that in the ICU mingw config and the Makefile.in file solves this.
This patch is only meant to get Tor Browser based on ESR45 into shape. Creating upstreamable ones (both to ICU and Mozilla) will be separate tickets. In fact, as I mentioned in my previous comment I guess we'd need a heavily modified one anyway.
Testing a resulting build solves both this bug, #16874 (moved) and #18767 (moved) without noticeable downsides for me.
Mozilla has started to go the right direction of integration its components with the mozbuild system. Unfortunately, they aren't going to do this for non tier 1 platforms. But for ICU they've done, as they stated, separate mozbuild "path" which is suitable for all platforms and cross-compilation. It can be easily back-ported.
Hi, I came across this by searching to fix a SpiderMonkey build under Windows with MinGW64 using mozilla build tools.
It still doesn't build as it creates libs like 'libX.dll.a'. I've managed to find where to name them 'libX.a', but still 'libX56.a' is needed, where 56 is the major version of ICU.
IMHO, it is not yet fixed in this case.