This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


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

igen won't run on Solaris-based Canadian crosses


There's something in Solaris' getopt() that prevents igen from running
with it.  If host == build, this problem doesn't show up because
libiberty's getopt is linked in, but on Canadian crosses, libiberty
isn't linked in since it's compiled for the host, while igen must run
on the build machine.

This patch arranges for getopt to be compiled and linked into igen
when appropriate.  Ok to install?

Index: sim/igen/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* configure.in (LIBIBERTY_LIB): Set to getopt.o, if
	cross-compiling.
	* configure: Rebuilt.
	* Makefile.in (getopt.o): New target, for Canadian crosses.
	(igen): Depend in $(LIBIBERTY_LIB)

Index: sim/igen/Makefile.in
===================================================================
RCS file: /cvs/src/src/sim/igen/Makefile.in,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 Makefile.in
--- sim/igen/Makefile.in	1999/09/09 00:01:54	1.1.1.2
+++ sim/igen/Makefile.in	2000/09/02 07:07:27
@@ -114,7 +114,7 @@ IGEN_OBJS=\
 	gen-engine.o \
 	gen.o
 
-igen: igen.o $(IGEN_OBJS)
+igen: igen.o $(IGEN_OBJS) $(LIBIBERTY_LIB)
 	$(CC_FOR_BUILD) $(BUILD_LDFLAGS) -o igen igen.o $(IGEN_OBJS) $(LIBIBERTY_LIB)
 
 igen.o: igen.c misc.h filter_host.h lf.h table.h ld-decode.h ld-cache.h ld-insn.h filter.h gen-model.h gen-itable.h gen-icache.h gen-idecode.h gen-engine.h gen-semantics.h gen-support.h gen.h igen.h 
@@ -155,6 +155,9 @@ gen-support.o: gen-support.c misc.h lf.h
 gen.o: gen.c misc.h lf.h table.h gen-icache.h ld-decode.h gen.h igen.h ld-insn.h gen-semantics.h gen-idecode.h filter.h
 misc.o: misc.c misc.h filter_host.h
 
+getopt.o: $(srcdir)/../../libiberty/getopt.c $(srcdir)/../../include/getopt.h
+	$(CC_FOR_BUILD) -c $(BUILD_CFLAGS) \
+	  -I$(srcdir)/../../include $(srcdir)/../../libiberty/getopt.c
 
 tags etags: TAGS
 
Index: sim/igen/configure
===================================================================
RCS file: /cvs/src/src/sim/igen/configure,v
retrieving revision 1.2
diff -u -p -r1.2 configure
--- sim/igen/configure	2000/05/24 04:39:48	1.2
+++ sim/igen/configure	2000/09/02 07:07:28
@@ -1013,7 +1013,7 @@ else
   CC_FOR_BUILD=${CC_FOR_BUILD-gcc}
   CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-"-g"}
   RANLIB_FOR_BUILD=${RANLIB_FOR_BUILD-ranlib}
-  LIBIBERTY_LIB=
+  LIBIBERTY_LIB=getopt.o
 fi
 
 
Index: sim/igen/configure.in
===================================================================
RCS file: /cvs/src/src/sim/igen/configure.in,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 configure.in
--- sim/igen/configure.in	1999/04/16 01:35:04	1.1.1.1
+++ sim/igen/configure.in	2000/09/02 07:07:28
@@ -22,7 +22,7 @@ else
   CC_FOR_BUILD=${CC_FOR_BUILD-gcc}
   CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-"-g"}
   RANLIB_FOR_BUILD=${RANLIB_FOR_BUILD-ranlib}
-  LIBIBERTY_LIB=
+  LIBIBERTY_LIB=getopt.o
 fi
 
 

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

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