This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project. See the GDB home page for more information.


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

[gdb 19981224] Enable linking gdb against shared libbfd


The following patch is a first shot at linking gdb 19981224 against a
shared libbfd (tried on IRIX 6.2).  It has a couple of shortcomings:

* libtool support was added manually to gdb/Makefile.in.  It currently
  lacks the libtool clean targets usually generated by automake's libtool
  support.  This will happen naturally once the gdb Makefile is converted
  to use automake.

* Using a shared libbfd isn't currently very useful since it doesn't
  support proper (in the libtool sense) interface versioning, without
  -release $(VERSION).  Since any release of binutils and gdb comes with
  it's own version of libbfd, there cannot happen any sharing, at least not
  between binutils and gdb.  Are there any plans to convert libbfd to
  proper versioning?  I doubt it is easy, if at all possible, given it's
  constant state of flux.

Mon Oct 26 20:19:27 1998  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>

	* Makefile.in (LIBTOOL): Add.
	(CC_LD, install_only): Invoke $(LIBTOOL) here.
	(BFD, OPCODES): Reference libtool libraries to drag in shared
	versions if present.
	(INSTALLED_LIBS, CLIBS, CDEPS): Link -lopcodes first, it depends on
	-lbfd.

	* gdb/configure.in (AM_PROG_LIBTOOL): Invoke.

===================================================================
RCS file: gdb/RCS/Makefile.in,v
retrieving revision 1.1
diff -u -r1.1 gdb/Makefile.in
--- gdb/Makefile.in	1998/12/24 22:30:09	1.1
+++ gdb/Makefile.in	1998/12/29 18:55:46
@@ -54,6 +54,7 @@
 AR = @AR@
 AR_FLAGS = qv
 RANLIB = @RANLIB@
+LIBTOOL = @LIBTOOL@
 DLLTOOL = @DLLTOOL@
 WINDRES = @WINDRES@
 
@@ -80,7 +81,7 @@
 # Set this up with gcc if you have gnu ld and the loader will print out
 # line numbers for undefined references.
 #CC_LD=gcc -static
-CC_LD=$(CC)
+CC_LD=$(LIBTOOL) --mode=link $(CC)
 
 # Where is our "include" directory?  Typically $(srcdir)/../include.
 # This is essentially the header file directory for the library
@@ -97,7 +98,7 @@
 
 # Where is the BFD library?  Typically in ../bfd.
 BFD_DIR = ../bfd
-BFD = $(BFD_DIR)/libbfd.a
+BFD = $(BFD_DIR)/libbfd.la
 BFD_SRC = $(srcdir)/$(BFD_DIR)
 BFD_CFLAGS = -I$(BFD_DIR) -I$(BFD_SRC)
 
@@ -121,7 +122,7 @@
 # in INCLUDE_DIR.
 # Where is the "-lopcodes" library, with (some of) the opcode tables and
 # disassemblers?
-OPCODES = ../opcodes/libopcodes.a
+OPCODES = ../opcodes/libopcodes.la
 # Where are the other opcode tables which only have header file
 # versions?
 OP_INCLUDE = $(INCLUDE_DIR)/opcode
@@ -183,19 +184,20 @@
 
 # Libraries and corresponding dependencies for compiling gdb.
 # {X,T}M_CLIBS, defined in *config files, have host- and target-dependent libs.
+# BFD comes after opcodes, since opcodes depends on it.
 # TERMCAP comes after readline, since readline depends on it.
 # MMALLOC comes after anything else that might want an allocation function.
 # LIBIBERTY appears twice on purpose.
 # If you have the Cygnus libraries installed,
 # you can use 'CLIBS=$(INSTALLED_LIBS)' 'CDEPS='
-INSTALLED_LIBS=-lbfd -lreadline -lopcodes -liberty \
+INSTALLED_LIBS=-lreadline -lopcodes -lbfd -liberty \
 	$(TERMCAP) $(XM_CLIBS) $(TM_CLIBS) $(NAT_CLIBS) $(GDBTKLIBS) @LIBS@ \
 	-lmmalloc -lintl -liberty
-CLIBS = $(SIM) $(BFD) $(READLINE) $(OPCODES) $(INTL) $(LIBIBERTY) \
+CLIBS = $(SIM) $(READLINE) $(OPCODES) $(BFD) $(INTL) $(LIBIBERTY) \
 	$(TERMCAP) $(XM_CLIBS) $(TM_CLIBS) $(NAT_CLIBS) $(GDBTKLIBS) @LIBS@ \
 	$(MMALLOC) $(LIBIBERTY) $(WIN32LIBS)
-CDEPS = $(XM_CDEPS) $(TM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE) \
-	$(OPCODES) $(MMALLOC) $(INTL_DEPS) $(LIBIBERTY) @CONFIG_DEPS@
+CDEPS = $(XM_CDEPS) $(TM_CDEPS) $(NAT_CDEPS) $(SIM) $(READLINE) \
+	$(OPCODES) $(BFD) $(MMALLOC) $(INTL_DEPS) $(LIBIBERTY) @CONFIG_DEPS@
 
 ADD_FILES = $(REGEX) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
 ADD_DEPS = $(REGEX1) $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
@@ -536,7 +538,7 @@
 		else \
 		  true ; \
 		fi ; \
-		$(INSTALL_PROGRAM) gdb$(EXEEXT) $(bindir)/$$transformed_name$(EXEEXT) ; \
+		$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) gdb$(EXEEXT) $(bindir)/$$transformed_name$(EXEEXT) ; \
 		$(INSTALL_DATA) $(srcdir)/gdb.1 $(man1dir)/$$transformed_name.1
 	@$(MAKE) DO=install "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do 
 
===================================================================
RCS file: gdb/RCS/configure.in,v
retrieving revision 1.1
diff -u -r1.1 gdb/configure.in
--- gdb/configure.in	1998/12/24 22:22:14	1.1
+++ gdb/configure.in	1998/12/29 17:46:31
@@ -54,6 +54,7 @@
 changequote([,])dnl
 
 AC_PROG_INSTALL
+AM_PROG_LIBTOOL
 AC_CHECK_TOOL(AR, ar)
 AC_CHECK_TOOL(RANLIB, ranlib, :)
 AC_PROG_YACC

-----------------------------------------------------------------------------
Rainer Orth, Technical Faculty, University of Bielefeld

Internet: ro@TechFak.Uni-Bielefeld.DE