From: John Williams Date: Tue, 3 May 2005 23:26:11 +0000 (+0000) Subject: Tweaked Makefile.in so that post-configured Makefile tests for a Cygwin build X-Git-Url: http://git.osdn.net/view?p=uclinux-h8%2Felf2flt.git;a=commitdiff_plain;h=d08b010353e4ec45749260fb49d4aa3e5a088b90 Tweaked Makefile.in so that post-configured Makefile tests for a Cygwin build environment, and if detected, explicitly adjusts the link order so that libcygwin links *before* libiberty.a. This gets around a Cygwin problem with getopt()'s optind/optarg symbols. See, for example: http://sources.redhat.com/ml/cygwin/2004-04/msg01179.html Also tweaked cygwin-elf.h and elf2flt.c so that Cygwin builds for MicroBlaze target work as expected. Patch sumbitted by John Williams --- diff --git a/Makefile.in b/Makefile.in index 4299302..5a692a6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -20,6 +20,11 @@ DEFS = @DEFS@ -DTARGET_$(CPU) EXEEXT = @EXEEXT@ OBJEXT = @OBJEXT@ +# force link order under cygwin to avoid getopts / libiberty clash +ifneq ($(strip $(shell gcc -v 2>&1 | grep "cygwin")),) + LIBS := -lcygwin $(LIBS) +endif + CCFLAGS = $(CFLAGS) $(DEFS) $(INCLUDES) LDFILE= elf2flt.ld diff --git a/cygwin-elf.h b/cygwin-elf.h index 9d91d7a..30faa94 100644 --- a/cygwin-elf.h +++ b/cygwin-elf.h @@ -2091,4 +2091,21 @@ typedef Elf32_Addr Elf32_Conflict; #define R_CRIS_NUM 20 +#define R_MICROBLAZE_NONE 0 +#define R_MICROBLAZE_32 1 +#define R_MICROBLAZE_32_PCREL 2 +#define R_MICROBLAZE_64_PCREL 3 +#define R_MICROBLAZE_32_PCREL_LO 4 +#define R_MICROBLAZE_64 5 +#define R_MICROBLAZE_32_LO 6 +#define R_MICROBLAZE_SRO32 7 +#define R_MICROBLAZE_SRW32 8 +#define R_MICROBLAZE_64_NONE 9 +#define R_MICROBLAZE_32_SYM_OP_SYM 10 +#define R_MICROBLAZE_GNU_VTINHERIT 11 +#define R_MICROBLAZE_GNU_VTENTRY 12 + +#define R_MICROBLAZE_NUM 13 + + #endif /* elf.h */ diff --git a/elf2flt.c b/elf2flt.c index c42a93b..7844a7c 100644 --- a/elf2flt.c +++ b/elf2flt.c @@ -52,10 +52,10 @@ #if defined(TARGET_h8300) #include /* TARGET_* ELF support for the BFD library */ -#elif defined(TARGET_microblaze) -#include /* TARGET_* ELF support for the BFD library */ #elif defined(__CYGWIN__) #include "cygwin-elf.h" /* Cygwin uses a local copy */ +#elif defined(TARGET_microblaze) +#include /* TARGET_* ELF support for the BFD library */ #else #include /* TARGET_* ELF support for the BFD library */ #endif