]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Hurd: do not include defs.h when compiling MiG stubs since they are compiled as C...
authorFlavio Cruz <flaviocruz@gmail.com>
Wed, 3 Jul 2024 22:05:06 +0000 (23:05 +0100)
committerTom Tromey <tromey@adacore.com>
Tue, 17 Dec 2024 17:39:36 +0000 (10:39 -0700)
Otherwise, GDB will fail to compile for Hurd.

Approved-By: Tom Tromey <tom@tromey.com>
gdb/Makefile.in
gdb/config/i386/i386gnu.mn

index 52950759711af139f18e963b13fef7e70a5fc6e0..2bd17495dcc24606941574818f1824039bcf3ab1 100644 (file)
@@ -603,11 +603,12 @@ CONFIG_DEP_SUBDIR = $(addsuffix /$(DEPDIR),$(CONFIG_SRC_SUBDIR))
 # your system doesn't have fcntl.h in /usr/include (which is where it
 # should be according to Posix).
 DEFS = @DEFS@
+GDB_INCLUDED_HEADER = -include $(srcdir)/defs.h
 GDB_CFLAGS = \
        -I. \
        -I$(srcdir) \
        -I$(srcdir)/config \
-       -include $(srcdir)/defs.h \
+       $(GDB_INCLUDED_HEADER) \
        -DLOCALEDIR="\"$(localedir)\"" \
        $(DEFS)
 
index b7414e3bcb426fb4d7e989e064b7af71e291586d..24c58b02e98deb827f2d55d9a99f21543cc6d476 100644 (file)
@@ -21,7 +21,9 @@ MIGCOM = $(MIG) -cc cat - /dev/null
        | $(MIGCOM) -sheader /dev/null -server /dev/null -user $*_U.c -header $*_U.h
 
 # MIG stubs are not yet ready for C++ compilation.
-%_S.o %_U.o : COMPILE.post += -x c -include gnu-nat-mig.h
+%_S.o %_U.o : COMPILE.post += -x c
+# Do not include defs.h since it requires C++. Rather include our own gnu-nat-mig.h
+%_S.o %_U.o : GDB_INCLUDED_HEADER = -include gnu-nat-mig.h
 
 NAT_GENERATED_FILES = notify_S.h notify_S.c \
        process_reply_S.h process_reply_S.c \