]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdbserver/Makefile.in
elf: Add GNU_PROPERTY_UINT32_AND_XXX/GNU_PROPERTY_UINT32_OR_XXX
[thirdparty/binutils-gdb.git] / gdbserver / Makefile.in
index cc1eb808e322cc9a1d131a7a7e166216f4a3fc18..12e9b2777aef115e686840cef56c0844919c96f5 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 1989-2020 Free Software Foundation, Inc.
+# Copyright (C) 1989-2021 Free Software Foundation, Inc.
 
 # This file is part of GDB.
 
@@ -75,15 +75,20 @@ abs_top_srcdir = @abs_top_srcdir@
 abs_srcdir = @abs_srcdir@
 VPATH = @srcdir@
 
+top_builddir = .
+
 include $(srcdir)/../gdb/silent-rules.mk
 
 # Note that these are overridden by GNU make-specific code below if
 # GNU make is used.  The overrides implement dependency tracking.
 COMPILE.pre = $(CXX) $(CXX_DIALECT)
 COMPILE.post = -c -o $@
-COMPILE = $(ECHO_CXX) $(COMPILE.pre) $(INTERNAL_CFLAGS) $(COMPILE.post)
 POSTCOMPILE = @true
 
+# CXXFLAGS is at the very end on purpose, so that user-supplied flags can
+# override internal flags.
+COMPILE = $(ECHO_CXX) $(COMPILE.pre) $(INTERNAL_CFLAGS) $(CXXFLAGS) $(COMPILE.post)
+
 # It is also possible that you will need to add -I/usr/include/sys to the
 # CFLAGS section if your system doesn't have fcntl.h in /usr/include (which
 # is where it should be according to Posix).
@@ -98,16 +103,32 @@ INCLUDE_DIR = ${srcdir}/../include
 INCLUDE_DEP = $$(INCLUDE_DIR)
 
 LIBIBERTY_BUILDDIR = ../libiberty
-LIBIBERTY = $(LIBIBERTY_BUILDDIR)/libiberty.a
+LIBIBERTY_NORMAL = $(LIBIBERTY_BUILDDIR)/libiberty.a
+LIBIBERTY_NOASAN = $(LIBIBERTY_BUILDDIR)/noasan/libiberty.a
+LIBIBERTY_PIC = $(LIBIBERTY_BUILDDIR)/pic/libiberty.a
+LIBIBERTY_FOR_SHLIB = \
+  $(if $(wildcard $(LIBIBERTY_NOASAN)),\
+       $(LIBIBERTY_NOASAN),\
+       $(if $(wildcard $(LIBIBERTY_PIC)),\
+           $(LIBIBERTY_PIC),\
+           $(LIBIBERTY_NORMAL)))
+LIBIBERTY = $(LIBIBERTY_NORMAL)
+
+GDBSUPPORT_BUILDDIR = ../gdbsupport
+GDBSUPPORT = $(GDBSUPPORT_BUILDDIR)/libgdbsupport.a
 
 # Where is ust?  These will be empty if ust was not available.
 ustlibs = @ustlibs@
 ustinc = @ustinc@
 
 # gnulib
-GNULIB_BUILDDIR = ../gnulib
-LIBGNU = $(GNULIB_BUILDDIR)/import/libgnu.a
-INCGNU = -I$(srcdir)/../gnulib/import -I$(GNULIB_BUILDDIR)/import
+GNULIB_PARENT_DIR = ..
+include $(GNULIB_PARENT_DIR)/gnulib/Makefile.gnulib.inc
+
+# Where is the INTL library?  Typically in ../intl.
+INTL = @LIBINTL@
+INTL_DEPS = @LIBINTL_DEP@
+INTL_CFLAGS = @INCINTL@
 
 INCSUPPORT = -I$(srcdir)/.. -I..
 
@@ -122,7 +143,8 @@ INCSUPPORT = -I$(srcdir)/.. -I..
 #
 INCLUDE_CFLAGS = -I. -I${srcdir} \
        -I$(srcdir)/../gdb/regformats -I$(srcdir)/.. -I$(INCLUDE_DIR) \
-       -I$(srcdir)/../gdb $(INCGNU) $(INCSUPPORT)
+       -I$(srcdir)/../gdb $(INCGNU) $(INCSUPPORT) \
+       $(INTL_CFLAGS)
 
 # M{H,T}_CFLAGS, if defined, has host- and target-dependent CFLAGS
 # from the config/ directory.
@@ -144,8 +166,10 @@ CPPFLAGS = @CPPFLAGS@
 PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
 PTHREAD_LIBS = @PTHREAD_LIBS@
 
+WIN32APILIBS = @WIN32APILIBS@
+
 # INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros.
-INTERNAL_CFLAGS_BASE = ${CXXFLAGS} ${GLOBAL_CFLAGS} \
+INTERNAL_CFLAGS_BASE = ${GLOBAL_CFLAGS} \
        ${PROFILE_CFLAGS} ${INCLUDE_CFLAGS} ${CPPFLAGS} $(PTHREAD_CFLAGS)
 INTERNAL_WARN_CFLAGS = ${INTERNAL_CFLAGS_BASE} $(WARN_CFLAGS)
 INTERNAL_CFLAGS = ${INTERNAL_WARN_CFLAGS} $(WERROR_CFLAGS) -DGDBSERVER
@@ -162,17 +186,13 @@ SFILES = \
        $(srcdir)/dll.cc \
        $(srcdir)/gdbreplay.cc \
        $(srcdir)/hostio.cc \
-       $(srcdir)/hostio-errno.cc \
        $(srcdir)/i387-fp.cc \
        $(srcdir)/inferiors.cc \
        $(srcdir)/linux-aarch64-low.cc \
+       $(srcdir)/linux-arc-low.cc \
        $(srcdir)/linux-arm-low.cc \
-       $(srcdir)/linux-bfin-low.cc \
-       $(srcdir)/linux-cris-low.cc \
-       $(srcdir)/linux-crisv32-low.cc \
        $(srcdir)/linux-ia64-low.cc \
        $(srcdir)/linux-low.cc \
-       $(srcdir)/linux-m32r-low.cc \
        $(srcdir)/linux-m68k-low.cc \
        $(srcdir)/linux-mips-low.cc \
        $(srcdir)/linux-nios2-low.cc \
@@ -181,10 +201,14 @@ SFILES = \
        $(srcdir)/linux-s390-low.cc \
        $(srcdir)/linux-sh-low.cc \
        $(srcdir)/linux-sparc-low.cc \
-       $(srcdir)/linux-tile-low.cc \
        $(srcdir)/linux-x86-low.cc \
        $(srcdir)/linux-xtensa-low.cc \
        $(srcdir)/mem-break.cc \
+       $(srcdir)/netbsd-aarch64-low.cc \
+       $(srcdir)/netbsd-amd64-low.cc \
+       $(srcdir)/netbsd-i386-low.cc \
+       $(srcdir)/netbsd-low.cc \
+       $(srcdir)/netbsd-low.h \
        $(srcdir)/proc-service.cc \
        $(srcdir)/proc-service.list \
        $(srcdir)/regcache.cc \
@@ -194,43 +218,17 @@ SFILES = \
        $(srcdir)/target.cc \
        $(srcdir)/thread-db.cc \
        $(srcdir)/utils.cc \
-       $(srcdir)/win32-arm-low.cc \
        $(srcdir)/win32-i386-low.cc \
        $(srcdir)/win32-low.cc \
-       $(srcdir)/wincecompat.cc \
        $(srcdir)/x86-low.cc \
        $(srcdir)/../gdb/alloc.c \
+       $(srcdir)/../gdb/arch/arc.c \
        $(srcdir)/../gdb/arch/arm.c \
        $(srcdir)/../gdb/arch/arm-get-next-pcs.c \
        $(srcdir)/../gdb/arch/arm-linux.c \
        $(srcdir)/../gdb/arch/ppc-linux-common.c \
        $(srcdir)/../gdb/arch/riscv.c \
-       $(srcdir)/../gdbsupport/btrace-common.cc \
-       $(srcdir)/../gdbsupport/buffer.cc \
-       $(srcdir)/../gdbsupport/cleanups.cc \
-       $(srcdir)/../gdbsupport/common-debug.cc \
-       $(srcdir)/../gdbsupport/common-exceptions.cc \
-       $(srcdir)/../gdbsupport/common-inferior.cc \
-       $(srcdir)/../gdbsupport/common-regcache.cc \
-       $(srcdir)/../gdbsupport/common-utils.cc \
-       $(srcdir)/../gdbsupport/errors.cc \
-       $(srcdir)/../gdbsupport/environ.cc \
-       $(srcdir)/../gdbsupport/fileio.cc \
-       $(srcdir)/../gdbsupport/filestuff.cc \
-       $(srcdir)/../gdbsupport/job-control.cc \
-       $(srcdir)/../gdbsupport/gdb-dlfcn.cc \
-       $(srcdir)/../gdbsupport/gdb_tilde_expand.cc \
-       $(srcdir)/../gdbsupport/gdb_vecs.cc \
-       $(srcdir)/../gdbsupport/gdb_wait.cc \
-       $(srcdir)/../gdbsupport/netstuff.cc \
-       $(srcdir)/../gdbsupport/new-op.cc \
-       $(srcdir)/../gdbsupport/pathstuff.cc \
-       $(srcdir)/../gdbsupport/print-utils.cc \
-       $(srcdir)/../gdbsupport/ptid.cc \
-       $(srcdir)/../gdbsupport/rsp-low.cc \
-       $(srcdir)/../gdbsupport/safe-strerror.cc \
-       $(srcdir)/../gdbsupport/tdesc.cc \
-       $(srcdir)/../gdbsupport/xml-utils.cc \
+       $(srcdir)/../gdb/nat/aarch64-mte-linux-ptrace.c \
        $(srcdir)/../gdb/nat/aarch64-sve-linux-ptrace.c \
        $(srcdir)/../gdb/nat/linux-btrace.c \
        $(srcdir)/../gdb/nat/linux-namespaces.c \
@@ -252,39 +250,8 @@ TAGFILES = $(SOURCES) ${HFILES} ${ALLPARAM} ${POSSLIBS}
 OBS = \
        alloc.o \
        ax.o \
-       gdbsupport/agent.o \
-       gdbsupport/btrace-common.o \
-       gdbsupport/buffer.o \
-       gdbsupport/cleanups.o \
-       gdbsupport/common-debug.o \
-       gdbsupport/common-exceptions.o \
-       gdbsupport/common-inferior.o \
-       gdbsupport/job-control.o \
-       gdbsupport/common-regcache.o \
-       gdbsupport/common-utils.o \
-       gdbsupport/errors.o \
-       gdbsupport/environ.o \
-       gdbsupport/fileio.o \
-       gdbsupport/filestuff.o \
-       gdbsupport/format.o \
-       gdbsupport/gdb-dlfcn.o \
-       gdbsupport/gdb_tilde_expand.o \
-       gdbsupport/gdb_vecs.o \
-       gdbsupport/gdb_wait.o \
-       gdbsupport/netstuff.o \
-       gdbsupport/new-op.o \
-       gdbsupport/pathstuff.o \
-       gdbsupport/print-utils.o \
-       gdbsupport/ptid.o \
-       gdbsupport/rsp-low.o \
-       gdbsupport/safe-strerror.o \
-       gdbsupport/signals.o \
-       gdbsupport/signals-state-save-restore.o \
-       gdbsupport/tdesc.o \
-       gdbsupport/xml-utils.o \
        debug.o \
        dll.o \
-       event-loop.o \
        hostio.o \
        inferiors.o \
        mem-break.o \
@@ -304,14 +271,6 @@ OBS = \
        $(XML_BUILTIN)
 
 GDBREPLAY_OBS = \
-       gdbsupport/cleanups.o \
-       gdbsupport/common-exceptions.o \
-       gdbsupport/common-utils.o \
-       gdbsupport/rsp-low.o \
-       gdbsupport/errors.o \
-       gdbsupport/netstuff.o \
-       gdbsupport/print-utils.o \
-       gdbsupport/safe-strerror.o \
        gdbreplay.o \
        utils.o \
        version.o
@@ -403,17 +362,23 @@ html:
 install-html:
 clean-info:
 
-gdbserver$(EXEEXT): $(sort $(OBS)) ${CDEPS} $(LIBGNU) $(LIBIBERTY)
+gdbserver$(EXEEXT): $(sort $(OBS)) ${CDEPS} $(LIBGNU) $(LIBIBERTY) \
+               $(INTL_DEPS) $(GDBSUPPORT)
        $(SILENCE) rm -f gdbserver$(EXEEXT)
        $(ECHO_CXXLD) $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
-               -o gdbserver$(EXEEXT) $(OBS) $(LIBGNU) $(LIBIBERTY) \
-               $(GDBSERVER_LIBS) $(XM_CLIBS)
+               $(CXXFLAGS) \
+               -o gdbserver$(EXEEXT) $(OBS) $(GDBSUPPORT) $(LIBGNU) \
+               $(LIBGNU_EXTRA_LIBS) $(LIBIBERTY) $(INTL) \
+               $(GDBSERVER_LIBS) $(XM_CLIBS) $(WIN32APILIBS)
 
-gdbreplay$(EXEEXT): $(sort $(GDBREPLAY_OBS)) $(LIBGNU) $(LIBIBERTY)
+gdbreplay$(EXEEXT): $(sort $(GDBREPLAY_OBS)) $(LIBGNU) $(LIBIBERTY) \
+               $(INTL_DEPS) $(GDBSUPPORT)
        $(SILENCE) rm -f gdbreplay$(EXEEXT)
        $(ECHO_CXXLD) $(CC_LD) $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
-               -o gdbreplay$(EXEEXT) $(GDBREPLAY_OBS) $(XM_CLIBS) $(LIBGNU) \
-               $(LIBIBERTY)
+               $(CXXFLAGS) \
+               -o gdbreplay$(EXEEXT) $(GDBREPLAY_OBS) $(XM_CLIBS) \
+               $(GDBSUPPORT) $(LIBGNU) $(LIBGNU_EXTRA_LIBS) \
+               $(LIBIBERTY) $(INTL) $(WIN32APILIBS)
 
 IPA_OBJS = \
        alloc-ipa.o \
@@ -438,7 +403,8 @@ $(IPA_LIB): $(sort $(IPA_OBJS)) ${CDEPS}
        $(SILENCE) rm -f $(IPA_LIB)
        $(ECHO_CXXLD) $(CC_LD) -shared -fPIC -Wl,--soname=$(IPA_LIB) \
                -Wl,--no-undefined $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) \
-               -o $(IPA_LIB) ${IPA_OBJS} -ldl -pthread
+                $(CXXFLAGS) \
+               -o $(IPA_LIB) ${IPA_OBJS} $(LIBIBERTY_FOR_SHLIB) -ldl -pthread
 
 # Put the proper machine-specific files first, so M-. on a machine
 # specific routine gets the one for the correct machine.
@@ -449,7 +415,6 @@ TAGS:       ${TAGFILES}
             if [ x$$i != xyzzy ]; then \
               echo ${srcdir}/$$i | sed -e 's/\.o$$/\.cc/' \
                 -e 's,/\(arch\|nat\|target\)/,/../\1/,' \
-                -e 's,/\(gdbsupport\)/,/../../\1/,'; \
             fi; \
           done` \
          ${TAGFILES}
@@ -525,7 +490,7 @@ UST_CFLAGS = $(ustinc) -DCONFIG_UST_GDB_INTEGRATION
 # Undo gnulib replacements for the IPA shared library build.
 # The gnulib headers are still needed, but gnulib is not linked
 # into the IPA lib so replacement apis don't work.
-UNDO_GNULIB_CFLAGS = -Drpl_strerror_r=strerror_r
+UNDO_GNULIB_CFLAGS = -Drpl_strerror_r=strerror_r -Drpl_free=free
 
 # Note, we only build the IPA if -fvisibility=hidden is supported in
 # the first place.
@@ -534,7 +499,9 @@ IPAGENT_CFLAGS = $(INTERNAL_CFLAGS) $(UST_CFLAGS) \
        -fPIC -DIN_PROCESS_AGENT \
        -fvisibility=hidden
 
-IPAGENT_COMPILE = $(ECHO_CXX) $(COMPILE.pre) $(IPAGENT_CFLAGS) $(COMPILE.post)
+# CXXFLAGS is at the very end on purpose, so that user-supplied flags can
+# override internal flags.
+IPAGENT_COMPILE = $(ECHO_CXX) $(COMPILE.pre) $(IPAGENT_CFLAGS) $(CXXFLAGS) $(COMPILE.post)
 
 # Rules for special cases.
 
@@ -585,10 +552,6 @@ arch/%.o: ../gdb/arch/%.c
        $(COMPILE) -x c++ $<
        $(POSTCOMPILE)
 
-gdbsupport/%.o: ../gdbsupport/%.cc
-       $(COMPILE) $<
-       $(POSTCOMPILE)
-
 %.o: %-generated.cc
        $(COMPILE) $<
        $(POSTCOMPILE)
@@ -615,9 +578,6 @@ target/%.o: ../gdb/target/%.c
 %-generated.cc: ../gdb/regformats/%.dat $(regdat_sh)
        $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@
 
-%-generated.cc: ../gdb/regformats/arm/%.dat $(regdat_sh)
-       $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@
-
 %-generated.cc: ../gdb/regformats/rs6000/%.dat $(regdat_sh)
        $(ECHO_REGDAT) $(SHELL) $(regdat_sh) $< $@