OSDN Git Service

Tweaked Makefile.in so that post-configured Makefile tests for a Cygwin build
authorJohn Williams <jwilliams@itee.uq.edu.au>
Tue, 3 May 2005 23:26:11 +0000 (23:26 +0000)
committerJohn Williams <jwilliams@itee.uq.edu.au>
Tue, 3 May 2005 23:26:11 +0000 (23:26 +0000)
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 <jwilliams@itee.uq.edu.au>

Makefile.in
cygwin-elf.h
elf2flt.c

index 4299302..5a692a6 100644 (file)
@@ -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
index 9d91d7a..30faa94 100644 (file)
@@ -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 */
index c42a93b..7844a7c 100644 (file)
--- a/elf2flt.c
+++ b/elf2flt.c
 
 #if defined(TARGET_h8300)
 #include <elf/h8.h>      /* TARGET_* ELF support for the BFD library            */
-#elif defined(TARGET_microblaze)
-#include <elf/microblaze.h>    /* TARGET_* ELF support for the BFD library */
 #elif defined(__CYGWIN__)
 #include "cygwin-elf.h"        /* Cygwin uses a local copy */
+#elif defined(TARGET_microblaze)
+#include <elf/microblaze.h>    /* TARGET_* ELF support for the BFD library */
 #else
 #include <elf.h>      /* TARGET_* ELF support for the BFD library            */
 #endif