|
From: Vincent T. <vin...@gm...> - 2019-04-01 19:10:13
|
Hello I have had some issues with ICU 64.1 and MSYS2+mingw-w64 when linking with libraries using ICU (namely harfbuzz and libxml2). This is related to ticket ICU-20322 (https://unicode-org.atlassian.net/browse/ICU-20322) When I compile ICU, the list of installed files in libdir is (mainly) : /home/vtorri/icu_64/lib/icudt.dll /home/vtorri/icu_64/lib/icudt64.dll /home/vtorri/icu_64/lib/icuin.dll /home/vtorri/icu_64/lib/icuin64.dll /home/vtorri/icu_64/lib/icuio.dll /home/vtorri/icu_64/lib/icuio64.dll /home/vtorri/icu_64/lib/icutest.dll /home/vtorri/icu_64/lib/icutest64.dll /home/vtorri/icu_64/lib/icutu.dll /home/vtorri/icu_64/lib/icutu64.dll /home/vtorri/icu_64/lib/icuuc.dll /home/vtorri/icu_64/lib/icuuc64.dll /home/vtorri/icu_64/lib/libicudt.dll.a /home/vtorri/icu_64/lib/libicuin.dll.a /home/vtorri/icu_64/lib/libicuio.dll.a /home/vtorri/icu_64/lib/libicutest.dll.a /home/vtorri/icu_64/lib/libicutu.dll.a /home/vtorri/icu_64/lib/libicuuc.dll.a /home/vtorri/icu_64/lib/pkgconfig /home/vtorri/icu_64/lib/pkgconfig/icu-i18n.pc /home/vtorri/icu_64/lib/pkgconfig/icu-io.pc /home/vtorri/icu_64/lib/pkgconfig/icu-uc.pc Here, there are 3 kind of files 1) DLL files. As explained in issue ICU-20322, they should be in bin dir and not lib dir 2) import library (*.dll.a) : they are mainly stub DLL files 3) *.pc files To limit the list of files, let's take only icu uc files : /home/vtorri/icu_64/lib/icuuc.dll /home/vtorri/icu_64/lib/icuuc64.dll /home/vtorri/icu_64/lib/libicuuc.dll.a /home/vtorri/icu_64/lib/pkgconfig/icu-uc.pc So, i follow what i have written in issue ICU-20322 : i have moved the DLL files in bin dir, so I have now : /home/vtorri/icu_64/bin/icuuc.dll /home/vtorri/icu_64/bin/icuuc64.dll and /home/vtorri/icu_64/lib/libicuuc.dll.a /home/vtorri/icu_64/lib/pkgconfig/icu-uc.pc but now, when I link against icu using icu-uc.pc, the link flags are (see the content of icu-uc.pc) : -L${libdir} -licuuc64 -licudt64 that is (with my installation): -L/home/vtorri/icu_64/lib -licuuc64 -licudt64 Hence a linking error as the import library is libicuuc.dll.a and not libicuuc64.dll.a According to the "direct linking to a dll" paragraph of https://sourceware.org/binutils/docs/ld/WIN32.html I propose the following changes for this platform (MSYS2 (or cygwin) + mingw-w64) : 1) move DLL in the bin directory. Actually, only 1 DLL is useful : icuuc64.dll, the other one (icuuc.dll) is useless. It is also a *copy* of icuuc64.dll and not a symbolic link like on UNIX file systems, so it as a waste of disk space 2) change the pc file flags to -L${libdir} -licuuc -licudt (that is removing the '64' suffix) Note that the change in the pc file will work for UNIX too as the symbolic link libicuuc.does exist Final remark : icu-uc.pc link flags are -L${libdir} -licuuc64 -licudt64 but icu-io.pc and icu-i18n.pc are lacking -L${libdir}. I would add it. What do you think of this proposal ? thank you for reading Vincent Torri |