bugGNU gettext - Bugs: bug #48405, Can't compile gettext for...


You are not allowed to post comments on this tracker with your current authentication level.

bug #48405: Can't compile gettext for Windows

Submitted by:  Michele Locati <mlocati>
Submitted on:  Tue 05 Jul 2016 09:11:00 AM UTC  
Category:  Build Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  Daiki Ueno <ueno>
Open/Closed:  Closed

( Jump to the original submission)

Thu 09 May 2019 07:23:42 PM UTC, comment #9: 

The fix is contained in the gettext-0.20 release.

Bruno Haible <haible>
Project Administrator
Fri 05 Oct 2018 01:14:17 AM UTC, comment #8: 

To get rid of the link error, you also need the attached LIBXML_STATIC.diff (which will be committed into git soon).

(file #45143)

Bruno Haible <haible>
Project Administrator
Thu 04 Oct 2018 05:10:14 PM UTC, comment #7: 

On mingw, I don't observe the '__imp_xmlFree' link error. Probably it was fixed by the xmlexports.in.h part of this commit:

I saw the link error regarding '__imp_xmlFree' on Cygwin, however, but fixed it through this commit:

Bruno Haible <haible>
Project Administrator
Tue 12 Jul 2016 08:44:21 AM UTC, comment #6: 

Thanks to you, Daiki! A community project is as strong as its community is... together we stand divided we fall ;)

The only remaining problem is building the static versions (both 32 and 64 bits): I have to manually add -DLIBXML_STATIC to the configure CPPFLAGS in order to avoid undefined references like "__imp_xmlFree".
This leads to some "LIBXML_STATIC already defined" warnings, but the project gets compiled and everything seems to work fine.

Michele Locati <mlocati>
Tue 12 Jul 2016 03:22:12 AM UTC, comment #5: 

Thanks for tracking it down.  I have updated the gnulib submodule to the latest so the next release will hopefully fix the issue:

Daiki Ueno <ueno>
Project AdministratorIn charge of this item.
Mon 11 Jul 2016 09:44:39 AM UTC, comment #4: 

I finally found the problem: it was a gnulib problem.

They fixed this error in http://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=68b6adebef05670a312fb92b05e7bd089d2ed43a

And here's the patch for the current gettext https://github.com/mlocati/gettext-iconv-windows/commit/027da4c58d26786d87a14570df3ca228496f512e

Now the compilation for 32-bit shared works ;)

Michele Locati <mlocati>
Sun 10 Jul 2016 10:57:13 AM UTC, comment #3: 

Re-posting the difference because of the markup rendering on savannah bug page:

32-bit shared

GLOBAL_SYMBOL_PIPE = sed -n -e 's/^.*[         ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[         ][         ]*_\([_A-Za-z][_A-Za-z0-9]*\)$/\1 _\2 \2/p' | sed '/ __gnu_lto/d'

64-bit shared

GLOBAL_SYMBOL_PIPE = sed -n -e 's/^.*[         ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[         ][         ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' | sed '/ __gnu_lto/d'

Michele Locati <mlocati>
Sun 10 Jul 2016 10:46:35 AM UTC, comment #2: 

I absolutely don't know neither if it's related nor if it's relevant, but when running configure on the (failing) shared 32 bits the value of GLOBAL_SYMBOL_PIPE (in Makefiles) is different when running configure on the (successful) shared 64 bits:

shared 32 bit:
GLOBAL_SYMBOL_PIPE = sed -n -e 's/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*_\([_A-Za-z][_A-Za-z0-9]*\)$/\1 _\2 \2/p' | sed '/ __gnu_lto/d'

shared 64 bit:
GLOBAL_SYMBOL_PIPE = sed -n -e 's/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' | sed '/ __gnu_lto/d'

(please note the lack of an "_" in the first one).

The same difference is present in the config.cache files for lt_cv_sys_global_symbol_pipe

Is this helpful?

PS: I removed the branch mxe branch in https://github.com/mlocati/gettext-iconv-windows : everything's now in the master branch

Michele Locati <mlocati>
Wed 06 Jul 2016 01:29:42 PM UTC, comment #1: 

I added -DLIBXML_STATIC to the CPPFLAGS argument of configure when building static.

I have a few "LIBXML_STATIC already defined" warnings, but now the compilation for static works, for both 32 and 64 bit - no more "undefined reference to __imp_xmlFree" errors.

Maybe there's some point where LIBXML_STATIC isn't defined when we specify "--disable-shared --enable-static" in configure?

PS: the problem with the 32-bit shared persists, and I really don't know how to fix it...

Michele Locati <mlocati>
Tue 05 Jul 2016 09:11:00 AM UTC, original submission:  

Hi all,

I'm trying to compile gettext (and iconv 0.14) for Windows.

I'm on a clean Ubuntu Server 16.04 and I'm using mxe ( http://mxe.cc/ ), but I also tried mingw32 / mingw-w64 on Ubuntu 14.04 with the same problems.

I'm only able to build for 64-bit shared.

Here's the errors I met when compiling gettext (iconv gets always compiled correctly):
- for 64-bit static: undefined reference to `__imp_xmlFree'
- for 32-bit static: undefined reference to `_imp__xmlFree'
- for 32-bit shared: undefined reference to `_imp__exit_failure' / `_imp__argmatch_die', ...

For the full build logs see the attached files. You can find the script I'm using here: https://github.com/mlocati/gettext-iconv-windows/blob/mxe/compile-iconv-gettext-windows.sh

Any hint would be really appreciated...



Michele Locati <mlocati>


Attached Files
file #45143:  LIBXML_STATIC.diff added by haible (1KiB - text/x-patch)
file #37712:  shared32.zip added by mlocati (62KiB - application/octet-stream)
file #37713:  shared64.zip added by mlocati (117KiB - application/octet-stream)
file #37714:  static32.zip added by mlocati (65KiB - application/octet-stream)
file #37715:  static64.zip added by mlocati (71KiB - application/octet-stream)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by haible (Updated the item)
  • -email is unavailable- added by ueno (Posted a comment)
  • -email is unavailable- added by mlocati (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-10-05 haible Attached File- => Added LIBXML_STATIC.diff, #45143
    2018-10-04 haible StatusNone => Fixed
        Assigned toNone => ueno
        Open/ClosedOpen => Closed
    2016-11-27 haible CategoryNone => Build
    2016-07-05 mlocati Attached File- => Added shared32.zip, #37712
        Attached File- => Added shared64.zip, #37713
        Attached File- => Added static32.zip, #37714
        Attached File- => Added static64.zip, #37715

    Back to the top

    Powered by Savane 3.5