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

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

Re: [bug-gnu-libiconv] add windres -F option on Cygwin-MSVC


From: Feiyun Wang
Subject: Re: [bug-gnu-libiconv] add windres -F option on Cygwin-MSVC
Date: Wed, 6 Dec 2017 07:46:09 +0000 (UTC)

It looks like MSVC link.exe has similar problem.
We'd better add "/MACHINE:X86" or "/MACHINE:X64" to LDFLAGS on Cygwin-MSVC build.
I can get the dll/lib output without "/MACHINE" option, but I will fail when linking them to my test application with an x86/x64 mismatch error.
See the attached patch.
Feiyun Wang <address@hidden> 于 2017年12月2日, 星期六, 下午 5:02 写道:




Hi,

In libiconv/lib/Makefile.in:
libiconv.res.lo : $(srcdir)/../windows/libiconv.rc
 $(LIBTOOL_COMPILE) --tag=RC $(RC) `$(SHELL) $(srcdir)/../windows/windres-options --escape $(PACKAGE_VERSION)` -i $(srcdir)/../windows/libiconv.rc -o libiconv.res.lo --output-format=coff

In libiconv/src/Makefile.in:
iconv.res : $(srcdir)/../windows/iconv.rc
 $(WINDRES) `$(SHELL) $(srcdir)/../windows/windres-options --escape $(PACKAGE_VERSION)` -i $(srcdir)/../windows/iconv.rc -o iconv.res --output-format=coff

When compiling libiconv on Cygwin-MSVC, Both $(RC) and $(WINDRES) are default to windres program.
To build an x86 version libiconv in a 64-bit Windows machine, I have to set both RC="windres -Fpe-i386" and WINDRES="windres -Fpe-i386" in configure option.
However "-F" option is omitted by default, (I guess) as it comes from 32-bit old days and there is no need for 64-bit concerns at that time.
It is critical to have "-F" option now, otherwise I will fail to link a 32-bit dll/exe with a 64-bit res object.
See the attached patch file. But I only tested this patch on the Cygwin-MSVC build.

Sincerely,
Feiyun Wang



Attachment: 0001-Added-windres-F-option-and-link-MACHINE-flag-on-Cygw.patch
Description: Binary data


reply via email to

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