This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Cegcc-devel] windres compilation doesn't check for iconv


> > On Wed, 2009-05-20 at 20:25 -0700, Eric House wrote:
> > > I've finally figured out why arm-mingw32ce-windres doesn't handle
> > > utf8-encoded .rc files correctly but don't know what to do about it.
> > > It has to do with how autoconf works for binutils.
> > > 
> > > The problem is in wind_MultiByteToWideChar(), in
> > > src/binutils/binutils/winduni.c.  That function has three
> > > conditionally compilied sections coded:
> > > 
> > > #if defined (_WIN32) || defined (__CYGWIN__)
> > > // use win32 API to convert utf-8 to utf-16
> > > #elif defined (HAVE_ICONV_H)
> > > // use iconv() to convert utf-8 to utf-16
> > > #else
> > > // do something stupid that only works for 7-bit ascii
> > > #endif
> > > 
> > > I'm compiling cegcc on Debian, and it's the #else path that's being
> > > used.  It's broken -- that is, it doesn't know what to do with utf8,
> > > and instead of failing noisily it does the wrong thing silently.  The
> > > fix would seem to be to get HAVE_ICONV_H defined by the configure
> > > process, but I can't figure out how to do that.  configure.ac for
> > > binutils doesn't reference iconv.h the way configure.ac does for gcc,
> > > so there's no way for HAVE_ICONV_H to get defined.
> > > 
> > > I haven't checked whether the precompiled cegcc tarball on sourceforge
> > > has the same problem (mishandled utf-8 .rc files) but suspect that it
> > > does.  The problem seems to be that configuring binutils doesn't check
> > > for iconv at all.
> > > 
> > > I'm new to autoconf.  Any suggestions on how to fix this?

On Fri, 2009-05-22 at 18:19 -0700, Eric House wrote:
> > Date: Thu, 21 May 2009 11:15:41 +0200
> > From: Danny Backx <danny.backx@scarlet.be>
> > Subject: Re: [Cegcc-devel] windres compilation doesn't check for iconv
> 
> > Could you apply this patch to src/binutils/configure.ac :
> > 
> > pavilion: {343} svn diff configure.ac
> > Index: configure.ac
> > ===================================================================
> > --- configure.ac        (revision 1225)
> > +++ configure.ac        (working copy)
> > @@ -1187,6 +1187,8 @@
> >  ACX_PROG_GNAT
> >  ACX_PROG_CMP_IGNORE_INITIAL
> >  
> > +AC_CHECK_HEADERS(iconv.h)
> > +
> >  # Check for GMP and MPFR
> >  gmplibs="-lmpfr -lgmp"
> >  gmpinc=
> > pavilion: {344} 
> > 
> > and then run
> > 	autoreconf
> > in the src/binutils directory.
> > 
> > After that, rebuild binutils.
> > 
> > You should find that HAVE_ICONV_H is defined. You or I can send this
> > upstream if it works.
> 
> I applied the patch and it seems to work -- at least, syntax errors I
> put in the #ifdef HAVE_ICONV_H code started tripping the compiler, and
> with those removed the .dll files produced by windres are different,
> and not clearly wrong.  However, the (Polish) menus and strings are
> still not displaying correctly, even in localised M$ emulators, so
> there may be other problems.  Is it appropriate to push fixes upstream
> before the problem is fully understood?  Or should this go now and any
> other problem found go later?
> 
> Oddly, the mingw32 version of windres (current Debian testing system)
> has the same problem, and in that code there's no test for
> HAVE_ICONV_H: it just always does the wrong thing if compiled on
> Linux.  I've filed a bug with Debian about that, presumably to be
> pushed upstream.  I'm surprised that cegcc's windres code seems newer
> than Debian's.
> 
> Thanks for the quick patch on this!

Pedro upgraded our binutils to CVS head in February.
That's just about when they released binutils 2.19.1 .

CVS log winduni.c shows that Kai Tietz and Nick Clifton worked on it
this month, but nothing for two years before that.

FYI, you can access the binutils CVS from a cegcc SVN tree (the CVS
files are in our SVN).

Looks like you need to talk to Kai and Nick, they may be looking at the
same thing as you but from a different angle.

	Danny
-- 
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]