This is the mail archive of the gdb-prs@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]
Other format: [Raw text]

gdb/484: gdb configured with --enable-shared --disable-static fails to link



>Number:         484
>Category:       gdb
>Synopsis:       gdb configured with --enable-shared --disable-static fails to link
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Apr 14 17:28:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     ac131313@redhat.com
>Release:        unknown-1.0
>Organization:
>Environment:

>Description:
The version of GDB: 5.1.1
The type of machine you are using: i686-pc-linux-gnu
The operating system name and version number: rock-linux-1.5.12
What compiler (and its version) was used to compile GDB: gcc-2.95.3
How gdb was configured: ./configure --enable-shared --disable-static
What compiler (and its version) was used to compile the example program: N/A

When gdb is configured with --enable-shared --disable-static, only libbfd.so
and libopcodes.so are created, but not .a, yet the link is still attempted
against the (unexisting) libbfd.a and libopcodes.a, which fails, of course.
This can probably be easily fixed, as demonstrated by the following example:

<cut here>
diff -rNC3 gdb-5.1.1/gdb/Makefile.in gdb/gdb/Makefile.in
*** gdb-5.1.1/gdb/Makefile.in	Sun Nov 18 07:08:36 2001
--- gdb/gdb/Makefile.in	Sat Mar  9 16:38:49 2002
***************
*** 59,64 ****
--- 59,65 ----
  AR_FLAGS = qv
  RANLIB = @RANLIB@
  DLLTOOL = @DLLTOOL@
+ LIBTOOL = $(SHELL) $(top_builddir)/../bfd/libtool
  WINDRES = @WINDRES@
  MIG = @MIG@
  
***************
*** 92,97 ****
--- 93,99 ----
  # line numbers for undefined references.
  #CC_LD=gcc -static
  CC_LD=$(CC)
+ LINK = $(LIBTOOL) --mode=link $(CC_LD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
  
  # Where is our "include" directory?  Typically $(srcdir)/../include.
  # This is essentially the header file directory for the library
***************
*** 115,121 ****
  
  # Where is the BFD library?  Typically in ../bfd.
  BFD_DIR = ../bfd
! BFD = $(BFD_DIR)/libbfd.a
  BFD_SRC = $(srcdir)/$(BFD_DIR)
  BFD_CFLAGS = -I$(BFD_DIR) -I$(BFD_SRC)
  
--- 117,123 ----
  
  # Where is the BFD library?  Typically in ../bfd.
  BFD_DIR = ../bfd
! BFD = $(BFD_DIR)/libbfd.la
  BFD_SRC = $(srcdir)/$(BFD_DIR)
  BFD_CFLAGS = -I$(BFD_DIR) -I$(BFD_SRC)
  
***************
*** 212,218 ****
  # in INCLUDE_DIR.
  # Where is the "-lopcodes" library, with (some of) the opcode tables and
  # disassemblers?
! OPCODES = ../opcodes/libopcodes.a
  # Where are the other opcode tables which only have header file
  # versions?
  OP_INCLUDE = $(INCLUDE_DIR)/opcode
--- 214,220 ----
  # in INCLUDE_DIR.
  # Where is the "-lopcodes" library, with (some of) the opcode tables and
  # disassemblers?
! OPCODES = ../opcodes/libopcodes.la
  # Where are the other opcode tables which only have header file
  # versions?
  OP_INCLUDE = $(INCLUDE_DIR)/opcode
***************
*** 762,768 ****
  		  true ; \
  		fi ; \
  		$(srcdir)/../mkinstalldirs $(bindir) ; \
! 		$(INSTALL_PROGRAM) gdb$(EXEEXT) $(bindir)/$$transformed_name$(EXEEXT) ; \
  		$(srcdir)/../mkinstalldirs $(man1dir) ; \
  		$(INSTALL_DATA) $(srcdir)/gdb.1 $(man1dir)/$$transformed_name.1
  	@$(MAKE) DO=install "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do 
--- 764,770 ----
  		  true ; \
  		fi ; \
  		$(srcdir)/../mkinstalldirs $(bindir) ; \
! 		$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) gdb$(EXEEXT) $(bindir)/$$transformed_name$(EXEEXT) ; \
  		$(srcdir)/../mkinstalldirs $(man1dir) ; \
  		$(INSTALL_DATA) $(srcdir)/gdb.1 $(man1dir)/$$transformed_name.1
  	@$(MAKE) DO=install "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do 
***************
*** 839,845 ****
  # Removing the old gdb first works better if it is running, at least on SunOS.
  gdb$(EXEEXT): main.o libgdb.a $(CONFIG_OBS) $(ADD_DEPS) $(CDEPS) $(TDEPLIBS)
  	rm -f gdb$(EXEEXT)
! 	$(HLDENV) $(CC_LD) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) -o gdb$(EXEEXT) \
  	main.o libgdb.a $(CONFIG_OBS) $(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS)\
  	$(LOADLIBES)
  
--- 841,847 ----
  # Removing the old gdb first works better if it is running, at least on SunOS.
  gdb$(EXEEXT): main.o libgdb.a $(CONFIG_OBS) $(ADD_DEPS) $(CDEPS) $(TDEPLIBS)
  	rm -f gdb$(EXEEXT)
! 	$(HLDENV) $(LINK) $(INTERNAL_LDFLAGS) $(WIN32LDAPP) \
  	main.o libgdb.a $(CONFIG_OBS) $(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS)\
  	$(LOADLIBES)
  
<cut here>

which produces a valid shared executable on i386 systems. Being unfamiliar
with the GNU autoconf/automake system, I wasn't able to set LIBTOOL properly.

E-gards: Jimmy


>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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