bug-gnu-libiconv
[Top][All Lists]
Advanced

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

[bug-gnu-libiconv] MSVC: 'invalid numeric argument'/Wl, -DLL, -IMPLIB:.l


From: sav_ix
Subject: [bug-gnu-libiconv] MSVC: 'invalid numeric argument'/Wl, -DLL, -IMPLIB:.libs\charset.dll.lib''for builds on Windows
Date: Fri, 12 Jan 2018 11:23:34 +0200


Hello everyone,

For libiconv builds using MSVC got error:
===============================================================
sh-4.4$ CC="cl" CXX="cl" AR="lib" RC="rc" ./configure --prefix="$PWD/../MSVC64RH" --enable-shared --disable-static && make

<snip>

builddir="`pwd`"; cd libcharset && make all && make install-lib libdir="$builddir/lib" includedir="$builddir/lib"
make[1]: Entering directory '/c/libICONV-1.15/build/libcharset'
cd lib && make all
make[2]: Entering directory '/c/libICONV-1.15/build/libcharset/lib'
/bin/sh ../libtool --mode=link cl  -g  -o libcharset.la -rpath /c/libICONV-1.15/build/../MSVC64RH/lib -version-info 1:0:0 -no-undefined localcharset.lo relocatable.lo
libtool: link: rm -fr  .libs/charset.exp
libtool: link: /usr/bin/nm -B  .libs/localcharset.obj .libs/relocatable.obj   | sed -n -e 's/^.*[        ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[         ][   ]*\([_A-Za-z][_A-Za-z0-9]*\)\{0,1\}$/\1 \2 \2/p' | sed '/ __gnu_lto/d' | /usr/bin/sed -e '/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/' | /usr/bin/sed -e '/^[AITW][ ]/s/.*[ ]//' | sort | uniq > .libs/charset.exp
libtool: link: if test DEF = "`/usr/bin/sed -n -e 's/^[  ]*//' -e '/^\(;.*\)*$/d' -e 's/^\(EXPORTS\|LIBRARY\)\([         ].*\)*$/DEF/p' -e q .libs/charset.exp`" ; then cp ".libs/charset.exp" ".libs/charset-1.dll.def"; echo ".libs\\charset-1.dll.def" > ".libs/charset-1.dll.exp"; else /usr/bin/sed -e 's/^/-link -EXPORT:/' < .libs/charset.exp > .libs/charset-1.dll.exp; fi
libtool: link:  cl -o .libs\\charset-1.dll  .libs/localcharset.obj .libs/relocatable.obj   -g    "@.libs\\charset-1.dll.exp" -Wl,-DLL,-IMPLIB:".libs\\charset.dll.lib"
Microsoft (R) C/C++ Optimizing Compiler Version 19.12.25830.2 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

cl : Command line warning D9035 : option 'o' has been deprecated and will be removed in a future release
cl -link -EXPORT:DllMain
   -link -EXPORT:__local_stdio_printf_options
   -link -EXPORT:_vsnprintf_l
   -link -EXPORT:_vsprintf_l
   -link -EXPORT:libcharset_relocate
   -link -EXPORT:libcharset_set_relocation_prefix
   -link -EXPORT:locale_charset
   -link -EXPORT:sprintf
cl : Command line error D8021 : invalid numeric argument '/Wl,-DLL,-IMPLIB:.libs\charset.dll.lib'
make[2]: *** [Makefile:59: libcharset.la] Error 2
make[2]: Leaving directory '/c/libICONV-1.15/build/libcharset/lib'
make[1]: *** [Makefile:34: all] Error 2
make[1]: Leaving directory '/c/libICONV-1.15/build/libcharset'
make: *** [Makefile:42: lib/localcharset.h] Error 2

===============================================================

Reproduced for:
- shared builds using ICC on Windows and MSVC,

not reproduced for:
- static builds using ICC on Windows and MSVC,
- shared builds using mingw-w64.


Environment:
  - Windows 10 x64,
  - ICC 2018 Update 1,
  - MSVC 2017 15.5.0,
  - Windows SDK 10.0.16299.15,
  - mingw-w64 x86_64 7.2.0,
  - MSYS2 x86_64 20170918,
  - libiconv 1.15.


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'.


Further investigation revealed, that:
- unlike of 'build-aux' folder, 'libcharset/build-aux' and 'preload' folders are missing 'compile' script,
- 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.

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.


Out of scope of this issue it also turned out, that nothing is done during 'preload' module 'make' and 'make check' run:
===============================================================
cd preload && make all
make[1]: Entering directory '/c/libICONV-1.15/build/preload'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/c/libICONV-1.15/build/preload'

<snip>

cd preload && make check
make[1]: Entering directory '/c/libICONV-1.15/build/preload'
make[1]: Nothing to be done for 'check'.
make[1]: Leaving directory '/c/libICONV-1.15/build/preload'

===============================================================

Taking into account the above, can you shed lite:
- what is 'preload' module purpose?
- why libiconv build system consists of three parts ('configure', 'libcharset/configure', and 'preload/configure') instead of one, common for all modules?
Thanks.


Best,

Alexander


reply via email to

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