bug-libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

possible bug in libtool w/ MinGW on Chinese locale


From: Pete Batard
Subject: possible bug in libtool w/ MinGW on Chinese locale
Date: Mon, 08 Mar 2010 17:36:23 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3

Hi,

When running libtool with the attached files to produce a DLL, on Windows Vista 32 bit Chinese (PRC) with MinGW/MSYS and with no locale set in the shell (i.e. LANG, LC_ALL, LC_TYPE, etc. undefined), the attached files fail with the following:

$ ./runme.sh
libtool: compile: gcc -Wshadow -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -g -O2 -MT test.lo -MD -MP -MF test.
Tpo -c test.c  -DDLL_EXPORT -DPIC -o .libs/test.o
libtool: compile: gcc -Wshadow -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -g -O2 -MT test.lo -MD -MP -MF test.
Tpo -c test.c -o test.o >/dev/null 2>&1

*** Warning: linker path does not have real file for library -lole32.
*** I have the capability to make that library automatically link in when
*** you link to this library.  But I can only do this if you have a
*** shared version of the library, which you do not appear to have
*** because I did check the linker path looking for a file starting
*** with libole32 and none of the candidates passed a file format test
*** using a file magic. Last file checked: c:/MinGW/lib/libole32.a
*** The inter-library dependencies that have been dropped here will be
*** automatically added whenever a program is linked with this library
*** or is declared to -dlopen it.

*** Since this library must not contain undefined symbols,
*** because either the platform does not support them or
*** it was explicitly requested with -no-undefined,
*** libtool will only create a static version of it.
libtool: link: ar cru .libs/libtest.a  test.o
libtool: link: ranlib .libs/libtest.a
libtool: link: ( cd ".libs" && rm -f "libtest.la" && cp -p "../libtest.la" "libtest.la" )


As soon as you set the locale in the shell, the problem disappears:

$ export LANG=en_US
$ ./runme.sh
libtool: compile: gcc -Wshadow -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -g -O2 -MT test.lo -MD -MP -MF test.
Tpo -c test.c  -DDLL_EXPORT -DPIC -o .libs/test.o
libtool: compile: gcc -Wshadow -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration -g -O2 -MT test.lo -MD -MP -MF test.Tpo -c test.c -o test.o >/dev/null 2>&1
libtool: link: rm -fr  .libs/libtest.a .libs/libtest.la .libs/libtest.lai
libtool: link: gcc -shared .libs/test.o -lole32 -o .libs/libtest.dll -Wl,-
-enable-auto-image-base -Xlinker --out-implib -Xlinker .libs/libtest.dll.a
Creating library file: .libs/libtest.dll.a
libtool: link: ar cru .libs/libtest.a  test.o
libtool: link: ranlib .libs/libtest.a
libtool: link: ( cd ".libs" && rm -f "libtest.la" && cp -p "../libtest.la" "libtest.la" )


The problem also does not seem to occur with cygwin, as locale environment variable seem to be defined by default there.

Note that it might not be possible to reproduce the issue on non Chinese versions of Windows, by trying to change the default locale (or at least, I haven't managed to do so).

Our current workaround then is to force the "# NLS nuisances" test of libtool to set the locale variables always, even if none are currently defined.

For background information on the issue, you can consult the libusb mailing list archive at:
http://old.nabble.com/Problem-compiling-with-MingW-td27762662i80.html

Regards,

/Pete

Attachment: libtool-mingw.zip
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]