Article View: gnu.gdb.bug
Article #2623gdb configured with --enable-shared --disable-static fails to link
From: Dimitar Zhekov
Date: Mon, 11 Mar 2002 08:09
Date: Mon, 11 Mar 2002 08:09
110 lines
5130 bytes
5130 bytes
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
Technical Details
Message-ID:
<Pine.LNX.4.20.0203111005250.2925-100000@ncp.infonet.bg>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!news.gtei.net!news-out.visi.com!hermes.visi.com!uunet!ash.uu.net!spool0901.news.uu.net!wendy-fate.uu.net!bug-gdbShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f5053,5cdd741a3f0594ad,start X-Google-Attributes: gidf5053,public X-Google-ArrivalTime: 2002-03-11 00:09:49 PST x-uunet-gateway: sjc3sosrv11.alter.net from bug-gdb to gnu.gdb.bug; Mon, 11 Mar 2002 08:09:46 GMT Date: Mon, 11 Mar 2002 10:09:51 +0200 From: jimmy@is-vn.bg (Dimitar Zhekov) X-Sender: jimmy@ncp.infonet.bg Subject: gdb configured with --enable-shared --disable-static fails to link Message-ID: <Pine.LNX.4.20.0203111005250.2925-100000@ncp.infonet.bg> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-AntiVirus: scanned for viruses by AMaViS 0.2.1 (http://amavis.org/) Approved: bug-gdb-request@mail.gnu.org Newsgroups: gnu.gdb.bug Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!news.gtei.net!news-out.visi.com!hermes.visi.com!uunet!ash.uu.net!spool0901.news.uu.net!wendy-fate.uu.net!bug-gdb Sender: bug-gdb-request@mail.gnu.org Lines: 111