This is the mail archive of the 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]

gdbserver: add dependency on gnulib generated files

There's still (at least) one problem with #including gnulib's generated headers.
On i686-pc-mingw32:

../../../src/gdb/gdbserver/server.c: In function 'handle_search_memory_1':
../../../src/gdb/gdbserver/server.c:757:7: error: implicit declaration of function 'memmem' [-Werror=implicit-function-declaration]
../../../src/gdb/gdbserver/server.c:757:17: error: assignment makes pointer from integer without a cast [-Werror]
cc1: all warnings being treated as errors

When that happens, gnulib's headers, where the string.h that declares memmem
should be found, hadn't been generated yet:

$ ls gdbserver/gnulib/

... because nothing is actually forcing it to be built (through make dependencies).

"make -jN" builds mask this off most of the times for me, but of course a serial
"make" build trips on it every time.

This fixes it by making server.h depend on the generated files.   I actually misread
gdb's solution to this, and assumed it depended on the automatic dependency
tracking machinery, but I now see it doesn't, so it'd be simple to pull just that
bit in, it seems, but I only realized that after having committed this...


2012-04-19  Pedro Alves  <>

	* (generated_files): New.
	(server_h): Remove the explicit dependency on config.h, and depend
	on $generated_files.
 gdb/gdbserver/ |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/gdb/gdbserver/ b/gdb/gdbserver/
index 1e78f98..4f0ba19 100644
--- a/gdb/gdbserver/
+++ b/gdb/gdbserver/
@@ -207,6 +207,9 @@ FLAGS_TO_PASS = \

+# All generated files which can be included by another file.
+generated_files = config.h $(GNULIB_H)
 # Prevent Sun make from putting in the machine type.  Setting
 # TARGET_ARCH to nothing works for SunOS 3, 4.0, but not for 4.1.
@@ -388,7 +391,9 @@ ax_h = $(srcdir)/ax.h
 agent_h = $(srcdir)/../common/agent.h
 linux_osdata_h = $(srcdir)/../common/linux-osdata.h
 vec_h = $(srcdir)/../common/vec.h
-server_h = $(srcdir)/server.h $(regcache_h) config.h $(srcdir)/target.h \
+# Since everything must include server.h, we make that depend on
+# generated files.
+server_h = $(srcdir)/server.h $(regcache_h) $(srcdir)/target.h \
 		$(srcdir)/mem-break.h $(srcdir)/../common/gdb_signals.h \
 		$(srcdir)/../common/common-utils.h \
 		$(srcdir)/../common/xml-utils.h \
@@ -396,7 +401,8 @@ server_h = $(srcdir)/server.h $(regcache_h) config.h $(srcdir)/target.h \
 		$(srcdir)/../common/gdb_assert.h \
 		$(srcdir)/../common/gdb_locale.h \
 		$(ptid_h) \
-		$(signals_h)
+		$(signals_h) \
+		$(generated_files)

 linux_low_h = $(srcdir)/linux-low.h

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