aboutsummaryrefslogtreecommitdiff
path: root/gdb/Makefile.in
diff options
context:
space:
mode:
authorJose E. Marchesi <jose.marchesi@oracle.com>2022-11-05 11:52:09 +0100
committerJose E. Marchesi <jose.marchesi@oracle.com>2022-11-07 16:49:37 +0100
commitb686ecb5b10be9a33ab8f1bfdcff22eef920d1a5 (patch)
tree46c4ffd3257d7e1fba826b05564efc77fac23b6c /gdb/Makefile.in
parent240e07bd94a8da9270c57cde394f6883e43b8497 (diff)
downloadfsf-binutils-gdb-b686ecb5b10be9a33ab8f1bfdcff22eef920d1a5.zip
fsf-binutils-gdb-b686ecb5b10be9a33ab8f1bfdcff22eef920d1a5.tar.gz
fsf-binutils-gdb-b686ecb5b10be9a33ab8f1bfdcff22eef920d1a5.tar.bz2
gdb: link executables with libtool
This patch changes the GDB build system in order to use libtool to link the several built executables. This makes it possible to refer to libtool libraries (.la files) in CLIBS. As an application of the above, BFD now refers to ../libbfd/libbfd.la OPCODES now refers to ../opcodes/libopcodes.la LIBBACKTRACE_LIB now refers to ../libbacktrace/libbacktrace.la LIBCTF now refers to ../libctf/libctf.la NOTE1: The addition of libtool adds a few new configure-time options to GDB. Among these, --enable-shared and --disable-shared, which were previously ignored. Now GDB shall honor these options when linking, picking up the right version of the referred libtool libraries automagically. NOTE2: I have not tested the insight build. NOTE3: For regenerating configure I used an environment with Autoconf 2.69 and Automake 1.15.1. This should match the previously used version as announced in the configure script. NOTE4: Now the installed shared objects libbfd.so, libopcodes.so and libctf.so are used by gdb if binutils is installed with --enable-shared. Testing performed: - --enable-shared and --disable-shared (the default in binutils) work as expected: the linked executables link with the archive or shared libraries transparently. - Makefile.in modified for EXEEXT = .exe. It installs the binaries just fine. The installed gdb.exe runs fine. - Native build regtested in x86_64. No regressions found. - Cross build for aarch64-linux-gnu built to exercise program_transform_name and friends. The installed aarch64-linux-gnu-gdb runs fine. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29372 Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/Makefile.in')
-rw-r--r--gdb/Makefile.in14
1 files changed, 9 insertions, 5 deletions
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index c528ee5..522fc20 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -143,10 +143,12 @@ MAKEINFO_CMD = $(MAKEINFO) $(MAKEINFOFLAGS) $(MAKEINFO_EXTRA_FLAGS)
MAKEHTML = $(MAKEINFO_CMD) --html
MAKEHTMLFLAGS =
+LIBTOOL = @LIBTOOL@
+
# Set this up with gcc if you have gnu ld and the loader will print out
# line numbers for undefined references.
#CC_LD = g++ -static
-CC_LD = $(CXX) $(CXX_DIALECT)
+CC_LD = $(LIBTOOL) --mode=link $(CXX) $(CXX_DIALECT)
# Where is our "include" directory? Typically $(srcdir)/../include.
# This is essentially the header file directory for the library
@@ -163,7 +165,7 @@ CTF_DEPS = @CTF_DEPS@
# 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)
@@ -504,7 +506,7 @@ SUBDIR_TARGET_OBS = $(patsubst %.c,%.o,$(SUBDIR_TARGET_SRCS))
# disassemblers?
OPCODES_DIR = ../opcodes
OPCODES_SRC = $(srcdir)/$(OPCODES_DIR)
-OPCODES = $(OPCODES_DIR)/libopcodes.a
+OPCODES = $(OPCODES_DIR)/libopcodes.la
# Where are the other opcode tables which only have header file
# versions?
OP_INCLUDE = $(INCLUDE_DIR)/opcode
@@ -2017,7 +2019,8 @@ install-only: $(CONFIG_INSTALL)
true ; \
fi ; \
$(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(bindir) ; \
- $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) gdb$(EXEEXT) \
+ $(LIBTOOL) --mode=install $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) \
+ gdb$(EXEEXT) \
$(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) ; \
$(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(includedir)/gdb ; \
$(INSTALL_DATA) jit-reader.h $(DESTDIR)$(includedir)/gdb/jit-reader.h
@@ -2529,7 +2532,8 @@ install-gdbtk:
true ; \
fi ; \
$(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(bindir); \
- $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) insight$(EXEEXT) \
+ $(LIBTOOL) --mode=install $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) \
+ insight$(EXEEXT) \
$(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) ; \
$(SHELL) $(srcdir)/../mkinstalldirs \
$(DESTDIR)$(GDBTK_LIBRARY) ; \