[tor-bugs] #13419 [Tor Browser]: Fix cross-compiling ICU with mingw-w64 for Windows builds

Tor Bug Tracker & Wiki blackhole at torproject.org
Thu Sep 17 12:29:52 UTC 2015


#13419: Fix cross-compiling ICU with mingw-w64 for Windows builds
-------------------------+-------------------------------------------------
     Reporter:  gk       |      Owner:  gk
         Type:  task     |     Status:  assigned
     Priority:  normal   |  Milestone:
    Component:  Tor      |    Version:
  Browser                |   Keywords:  tbb-gitian, TorBrowserTeam201509,
   Resolution:           |  GeorgKoppen201509
Actual Points:           |  Parent ID:
       Points:           |
-------------------------+-------------------------------------------------

Comment (by gk):

 Replying to [comment:5 mcs]:
 > Since adding a simple C++ implementation of the Intl API seems like a
 big task (please discuss that idea in #16874), 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?

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/13419#comment:6>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list