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: Binutils 2.20 - Windres problems building pthreads/libiconv on Open Solaris


Hi Nick,

Thanks for taking the time to look at this.

On 9 February 2010 21:57, Nick Clifton <nickc@redhat.com> wrote:
> Hi Tony,
>
> ÂI tried reproducing this problem on an x86 Linux host machine, but it fails
> with:

I've only seen the problem on Open Solaris (2009.06 - x86), and only
after updating to 2.20. A range of 32 and 64bit FreeBSD, Linux, and
OSX systems all work fine.

> Âwindres: version.rc:94: syntax error
>
> I suspect that this means that PTW32_VERSION is not defined. ÂIt is not
> clear to me where this macro should be defined. ÂMaybe in the pthread.h
> file ? ÂDo you have a local version of pthread.h that is different from the
> system version ?

Yes, it's in pthread.h, apologies they were already being found on my
system. pthread.h is patched to define PTW32_STATIC_LIB. I've attached
the three files - version.rc, pthreads.h and winver.h (from w32api).


> Which kind of destroys my theory about the C preprocessor being responsible,
> since the -c option is not passed along...
>
> Are you able to run windres inside a debugger and find out where the
> segmentation fault is happening ? ÂI have a horrible feeling that it might
> be inside a system/library call and there might not be a lot that can be
> done about it. :-(

It's the first time I've used it, but here is the log from gdb:

Starting program:
/export/home/tony/mingw-cross-env-binutils/usr/bin/i686-pc-mingw32-windres
version.rc version.o

Program received signal SIGSEGV, Segmentation fault.
0xcea46832 in iconv () from /lib/libc.so.1
#0  0xcea46832 in iconv () from /lib/libc.so.1
#1  0x08071dbd in iconv_onechar (cd=0xffffffff, s=0x81053d0 "FileDescription",
    d=0x8046940 "\022", d_len=32, n_s=0xffffffff, n_d=0xffffffff)
    at winduni.c:633
#2  0x08071fc3 in wind_MultiByteToWideChar (cp=4294967295,
    mb=0x81053d0 "FileDescription", u=0x0, u_len=0) at winduni.c:694
#3  0x08072052 in unicode_from_codepage (length=0x0, u=0x81053d0,
    src=0x81053d0 "FileDescription", cp=0) at winduni.c:584
#4  0x080720ae in unicode_from_ascii (length=0x0, unicode=0x8046a28,
    ascii=0x81053d0 "FileDescription") at winduni.c:194
#5  0x0806e74f in yyparse () at rcparse.y:1703
#6  0x08064c2e in read_rc_file (filename=0x8047ad7 "version.rc",
    preprocessor=0x80e002c "gcc -E -xc -DRC_INVOKED",
    preprocargs=0x80dfd80 "", language=1033, use_temp_file=0) at resrc.c:562
#7  0x08063aee in main (argc=3, argv=0x8047970) at windres.c:1025
Continuing.

Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.


> I *think* that you can do this by defining the macro CP_ACP to the codepage
> that you want. Â(See the binutils/winduni.h source file). Either that or you
> could edit winduni.h directly...

Ok, I'll give that a try. Specifying the default 0 via the -c option
also segfaults, so it seems this should work.

Thanks,

Tony

Attachment: version.rc
Description: Binary data

Attachment: pthread.h
Description: Binary data

Attachment: winver.h
Description: Binary data


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