[Top][All Lists]

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

Re: [bug-gnu-libiconv] MSVC: 'invalid numeric argument'/Wl, -DLL, -IMPLI

From: Bruno Haible
Subject: Re: [bug-gnu-libiconv] MSVC: 'invalid numeric argument'/Wl, -DLL, -IMPLIB:.libs\charset.dll.lib''for builds on Windows
Date: Fri, 12 Jan 2018 12:16:49 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-104-generic; KDE/5.18.0; x86_64; ; )

Hi Alexander,

You read the file libiconv/README.windows.

> The source of error are definitions:
> ===============================================================
> # A C compiler.
> LTCC="cl"
> <snip>
> # A language specific compiler.
> CC="cl"
> ===============================================================
> in file 'libcharset/libtool' (and presumably 'preload/libtool'), while 
> expected to be:
> ===============================================================
> # A C compiler.
> LTCC="/c/libICONV-1.15/build/build-aux/compile cl"
> <snip>
> # A language specific compiler.
> CC="/c/libICONV-1.15/build/build-aux/compile cl"
> ===============================================================
> or similar, as in file 'libtool'.

Yes, the README.windows file says that the scripts 'ar-lib' and 'compile'
ought to be used. The reason is that 'cl' has different argument conventions
than Unix C/C++ compilers, and the 'compile' script is the bridge between the

> $ CC="cl" CXX="cl" AR="lib" RC="rc" ./configure --prefix="$PWD/../MSVC64RH" 
> --enable-shared --disable-static

There's your mistake. The README.windows file specifies the values for the
variables CC, CXX, AR, etc., that you should use.

> - unlike of 'configure' script, 'libcharset/configure' and 
> 'preload/configure' scripts are missing '_AM_PROG_CC_C_O' subroutine 
> (http://git.savannah.gnu.org/cgit/automake.git/tree/m4/prog-cc-c-o.m4) call, 
> which enables 'compile' workaround for compilers like ICC on Windows and MSVC.

You don't need _AM_PROG_CC_C_O if you are using 'compile'. The 'compile' script
does understand -o with -c.

> If this issue would be fixed, it also allow to simplify 'Native binaries, 
> built using the MS Visual C/C++ tool chain' chapter in 'README.windows' 
> manual concerning explicit 'compile' script use in build commands.

This is not a goal. The major goal is that we can use the same build system
on Windows as on Unix, and that the Makefiles are simple. Supporting a compiler
that does understand -o with -c would make the Makefiles more complicated, or
even require the use of Automake. And I don't want to put /Fo instead of -o
into the Makefiles; that is too ugly. Whether you need to set a couple of
environment variables in a particular way, is not much burden.

> Environment:
> ...
>   - MSYS2 x86_64 20170918,

The README.windows file also specifies that you should use Cygwin's bash.
I don't want to deal with MSYS bugs. You didn't encounter MSYS bugs in this
case, but nevertheless.

> Taking into account the above, can you shed lite:
> - what is 'preload' module purpose?

This is described in the README.

> - why libiconv build system consists of three parts ('configure',
> 'libcharset/configure', and 'preload/configure') instead of one,
> common for all modules?

libcharset is a separate module. Its separate configure file predates the
inclusion of libcharset into gnulib. Thus you can see it as historical.

preload/configure is different because it needs to force enable_shared=yes.


reply via email to

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