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]

[PATCH] Two fixes for opcodes/i386-gen on cygwin.



    Hi gang!

  Currently, opcodes/i386-gen.exe fails to build on Cygwin (quite possibly
only in maintainer mode), for two reasons: firstly, it #includes libiberty's
getopt.h without checking for or setting HAVE_DECL_GETOPT, which leads to the
fallback non-ANSI prototype being seen by the compiler:

> cc1: warnings being treated as errors
> In file included from /gnu/binutils/src/opcodes/i386-gen.c:24:0:
> /gnu/binutils/src/opcodes/../include/getopt.h:116:1: error: function declaration
>  isn't a prototype
> make[3]: *** [i386-gen.o] Error 1

  All the other places where this header is included, there's an autoconf
test, which I copied to opcodes/configure.in.

  Secondly, i386-gen needs to link against -lintl on cygwin:

> i386-gen.o: In function `fail':
> /gnu/binutils/src/opcodes/i386-gen.c:435: undefined reference to `_libintl_gettext'
> i386-gen.o: In function `set_bitfield':
> /gnu/binutils/src/opcodes/i386-gen.c:544: undefined reference to `_libintl_gettext'
> /gnu/binutils/src/opcodes/i386-gen.c:546: undefined reference to `_libintl_gettext'
> i386-gen.o: In function `process_i386_cpu_flag':
> /gnu/binutils/src/opcodes/i386-gen.c:602: undefined reference to `_libintl_gettext'
> i386-gen.o: In function `process_i386_opcodes':
> /gnu/binutils/src/opcodes/i386-gen.c:867: undefined reference to `_libintl_gettext'
> i386-gen.o:/gnu/binutils/src/opcodes/i386-gen.c:998: more undefined references to `_libintl_gettext' follow
> collect2: ld returned 1 exit status
> make[4]: *** [i386-gen] Error 1

  I unconditionally added $(LIBINTL), it seemed like the simple thing to do.

opcodes/ChangeLog:

	* configure.in (for a known getopt prototype in unistd.h): Add test.
	* Makefile.am (i386-gen): Add $(LIBINTL).
	(ia64-gen): Likewise.
	* Makefile.in: Regenerate.
	* config.in: Likewise.
	* configure: Likewise.

  Built and tested on i686-pc-cygwin, no regressions.  OK?

    cheers,
      DaveK



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