* [autodeps] gnu-nat, autogenerated files
@ 2008-09-09 15:07 Pedro Alves
2008-09-09 16:09 ` Tom Tromey
2008-09-10 18:01 ` Joel Brobecker
0 siblings, 2 replies; 10+ messages in thread
From: Pedro Alves @ 2008-09-09 15:07 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 746 bytes --]
Hi,
Another patch I had here laying around, from my recent all-targets
excursions.
Pre auto-dependencies, gnu-nat.o had these, among others, in its
dependency list:
gnu-nat.o: ... $(exc_request_S_h) $(notify_S_h) $(process_reply_S_h) \
$(msg_reply_S_h) $(exc_request_U_h) $(msg_U_h)
But, we no longer specify those explicit dependencies, so
currently, the build fails when trying to compile gnu-nat.c, claiming
exc_request_S.h, etc, are nowhere to be found.
These are generated headers, built from the corresponding .defs files in
the tree. Their build rules are in config/i386/i386gnu.mh.
With this patch I was able to build GDB on i686-unknown-gnu0.3 again
successfully.
Is this the right approach? If so, OK?
--
Pedro Alves
[-- Attachment #2: hurd_gen_files.diff --]
[-- Type: text/x-diff, Size: 1487 bytes --]
2008-09-09 Pedro Alves <pedro@codesourcery.com>
* Makefile.in (generated_files): Add $(host_generated_files).
* config/i386/i386gnu.mh (host_generated_files): New.
---
gdb/Makefile.in | 3 ++-
gdb/config/i386/i386gnu.mh | 4 ++++
2 files changed, 6 insertions(+), 1 deletion(-)
Index: src/gdb/Makefile.in
===================================================================
--- src.orig/gdb/Makefile.in 2008-09-09 15:10:33.000000000 +0100
+++ src/gdb/Makefile.in 2008-09-09 15:39:00.000000000 +0100
@@ -831,7 +831,8 @@ DISTSTUFF = $(YYFILES)
# All generated files which can be included by another file.
-generated_files = config.h observer.h observer.inc ada-lex.c $(GNULIB_H)
+generated_files = config.h observer.h observer.inc ada-lex.c \
+ $(GNULIB_H) $(host_generated_files)
.c.o:
$(COMPILE) $<
Index: src/gdb/config/i386/i386gnu.mh
===================================================================
--- src.orig/gdb/config/i386/i386gnu.mh 2008-09-09 15:24:54.000000000 +0100
+++ src/gdb/config/i386/i386gnu.mh 2008-09-09 15:37:11.000000000 +0100
@@ -29,3 +29,7 @@ MIGCOM = $(MIG) -cc cat - /dev/null
%_U.h %_U.c: %.defs
$(CPP) $(CPPFLAGS) $($*-MIGUFLAGS) -x c $< \
| $(MIGCOM) -sheader /dev/null -server /dev/null -user $*_U.c -header $*_U.h
+
+host_generated_files = notify_S.h notify_S.c process_reply_S.h process_reply_S.c \
+ msg_reply_S.h msg_reply_S.c msg_U.h msg_U.c \
+ exc_request_U.h exc_request_U.c exc_request_S.h exc_request_S.c
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [autodeps] gnu-nat, autogenerated files 2008-09-09 15:07 [autodeps] gnu-nat, autogenerated files Pedro Alves @ 2008-09-09 16:09 ` Tom Tromey 2008-09-09 16:18 ` Daniel Jacobowitz 2008-09-10 18:01 ` Joel Brobecker 1 sibling, 1 reply; 10+ messages in thread From: Tom Tromey @ 2008-09-09 16:09 UTC (permalink / raw) To: Pedro Alves; +Cc: gdb-patches >>>>> "Pedro" == Pedro Alves <pedro@codesourcery.com> writes: Pedro> These are generated headers, built from the corresponding .defs files in Pedro> the tree. Their build rules are in config/i386/i386gnu.mh. Pedro> Is this the right approach? Yes. I didn't know about the .mh files, sorry about that. I read through them all just now and I noticed that they inconsistently use NAT_FILE. Some use config/ and some do not, e.g.: config/pa/linux.mh:NAT_FILE= config/nm-linux.h config/alpha/alpha-osf3.mh:NAT_FILE= nm-osf3.h AFAICT this variable is only used for the TAGS rule. So, maybe it doesn't matter much. Or maybe it could just be deleted. Tom ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [autodeps] gnu-nat, autogenerated files 2008-09-09 16:09 ` Tom Tromey @ 2008-09-09 16:18 ` Daniel Jacobowitz 2008-09-09 16:28 ` Tom Tromey 0 siblings, 1 reply; 10+ messages in thread From: Daniel Jacobowitz @ 2008-09-09 16:18 UTC (permalink / raw) To: Tom Tromey; +Cc: Pedro Alves, gdb-patches On Tue, Sep 09, 2008 at 10:03:13AM -0600, Tom Tromey wrote: > >>>>> "Pedro" == Pedro Alves <pedro@codesourcery.com> writes: > > Pedro> These are generated headers, built from the corresponding .defs files in > Pedro> the tree. Their build rules are in config/i386/i386gnu.mh. > > Pedro> Is this the right approach? > > Yes. > > > I didn't know about the .mh files, sorry about that. I read through > them all just now and I noticed that they inconsistently use NAT_FILE. > Some use config/ and some do not, e.g.: > > config/pa/linux.mh:NAT_FILE= config/nm-linux.h > config/alpha/alpha-osf3.mh:NAT_FILE= nm-osf3.h > > AFAICT this variable is only used for the TAGS rule. So, maybe it > doesn't matter much. Or maybe it could just be deleted. No, search for NAT_FILE in configure.ac. This file is included as nm.h in native GDBs; it's where native target configuration used to live, and the remaining ones are still used. Also: case "${nativefile}" in nm-*.h ) GDB_NM_FILE="config/${gdb_host_cpu}/${nativefile}" ;; * ) GDB_NM_FILE="${nativefile}" esac -- Daniel Jacobowitz CodeSourcery ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [autodeps] gnu-nat, autogenerated files 2008-09-09 16:18 ` Daniel Jacobowitz @ 2008-09-09 16:28 ` Tom Tromey 0 siblings, 0 replies; 10+ messages in thread From: Tom Tromey @ 2008-09-09 16:28 UTC (permalink / raw) To: Pedro Alves; +Cc: gdb-patches >>>>> "Daniel" == Daniel Jacobowitz <drow@false.org> writes: >> AFAICT this variable is only used for the TAGS rule. So, maybe it >> doesn't matter much. Or maybe it could just be deleted. Daniel> No, search for NAT_FILE in configure.ac. Thanks. Tom ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [autodeps] gnu-nat, autogenerated files 2008-09-09 15:07 [autodeps] gnu-nat, autogenerated files Pedro Alves 2008-09-09 16:09 ` Tom Tromey @ 2008-09-10 18:01 ` Joel Brobecker 2008-09-10 18:13 ` Daniel Jacobowitz 2008-09-10 18:49 ` Pedro Alves 1 sibling, 2 replies; 10+ messages in thread From: Joel Brobecker @ 2008-09-10 18:01 UTC (permalink / raw) To: Pedro Alves; +Cc: gdb-patches > 2008-09-09 Pedro Alves <pedro@codesourcery.com> > > * Makefile.in (generated_files): Add $(host_generated_files). > * config/i386/i386gnu.mh (host_generated_files): New. This one is a little beyond my knowledge of Makefile, particularly since the build system has changed recently. The idea seems right to me (adding a new variable in the mh file). But I'm still wondering whether it would be possible to use the NAT_FILE to include the list of generated files. Tom, what do you think? Probably be a little hacky... If we introduce a new variable, I propose that its name be capitalized, like most (if not all) variables we have been using so far. I like HOST_GENERATED_FILES as you suggested. We also need to document this new variable in gdbint. Perhaps around there: @table @file @vindex NATDEPFILES @item gdb/config/@var{arch}/@var{xyz}.mh Specifies Makefile fragments needed by a @emph{native} configuration on machine @var{xyz}. In particular, this lists the required native-dependent object files, by defining @samp{NATDEPFILES=@dots{}}. Also specifies the header file which describes native support on @var{xyz}, by defining @samp{NAT_FILE= nm-@var{xyz}.h}. You can also define @samp{NAT_CFLAGS}, @samp{NAT_ADD_FILES}, @samp{NAT_CLIBS}, @samp{NAT_CDEPS}, etc.; see @file{Makefile.in}. @emph{Maintainer's note: The @file{.mh} suffix is because this file originally contained @file{Makefile} fragments for hosting @value{GDBN} on machine @var{xyz}. While the file is no longer used for this purpose, the @file{.mh} suffix remains. Perhaps someone will eventually rename these fragments so that they have a @file{.mn} suffix.} GMs, Tom, help! -- Joel ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [autodeps] gnu-nat, autogenerated files 2008-09-10 18:01 ` Joel Brobecker @ 2008-09-10 18:13 ` Daniel Jacobowitz 2008-09-10 18:49 ` Pedro Alves 1 sibling, 0 replies; 10+ messages in thread From: Daniel Jacobowitz @ 2008-09-10 18:13 UTC (permalink / raw) To: Joel Brobecker; +Cc: Pedro Alves, gdb-patches On Wed, Sep 10, 2008 at 11:00:18AM -0700, Joel Brobecker wrote: > This one is a little beyond my knowledge of Makefile, particularly > since the build system has changed recently. The idea seems right to me > (adding a new variable in the mh file). But I'm still wondering whether > it would be possible to use the NAT_FILE to include the list of generated > files. Tom, what do you think? Probably be a little hacky... I agree with all your comments; otherwise it seems OK to me. -- Daniel Jacobowitz CodeSourcery ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [autodeps] gnu-nat, autogenerated files 2008-09-10 18:01 ` Joel Brobecker 2008-09-10 18:13 ` Daniel Jacobowitz @ 2008-09-10 18:49 ` Pedro Alves 2008-09-12 5:06 ` Joel Brobecker 1 sibling, 1 reply; 10+ messages in thread From: Pedro Alves @ 2008-09-10 18:49 UTC (permalink / raw) To: Joel Brobecker; +Cc: gdb-patches [-- Attachment #1: Type: text/plain, Size: 2705 bytes --] On Wednesday 10 September 2008 19:00:18, Joel Brobecker wrote: > > 2008-09-09 Pedro Alves <pedro@codesourcery.com> > > > > * Makefile.in (generated_files): Add $(host_generated_files). > > * config/i386/i386gnu.mh (host_generated_files): New. > > This one is a little beyond my knowledge of Makefile, particularly > since the build system has changed recently. The idea seems right to me > (adding a new variable in the mh file). But I'm still wondering whether > it would be possible to use the NAT_FILE to include the list of generated > files. Tom, what do you think? Probably be a little hacky... I think it would be hacky. We want this list for a specific purpose: These are autogenerated files, that need to be generated before compiling the NATDEPFILES. > If we introduce a new variable, I propose that its name be capitalized, > like most (if not all) variables we have been using so far. I like > HOST_GENERATED_FILES as you suggested. > Hmmmm, looking at the docs you pointed below, I believe NAT_GENERATED_FILES is more correct. These files shouldn't be generated when building a cross debugger hosted on the hurd. I've made that change, hope it's OK. > We also need to document this new variable in gdbint. Perhaps around > there: > > @table @file > @vindex NATDEPFILES > @item gdb/config/@var{arch}/@var{xyz}.mh > Specifies Makefile fragments needed by a @emph{native} configuration on > machine @var{xyz}. In particular, this lists the required > native-dependent object files, by defining @samp{NATDEPFILES=@dots{}}. > Also specifies the header file which describes native support on > @var{xyz}, by defining @samp{NAT_FILE= nm-@var{xyz}.h}. You can also > define @samp{NAT_CFLAGS}, @samp{NAT_ADD_FILES}, @samp{NAT_CLIBS}, > @samp{NAT_CDEPS}, etc.; see @file{Makefile.in}. > > @emph{Maintainer's note: The @file{.mh} suffix is because this file > originally contained @file{Makefile} fragments for hosting @value{GDBN} > on machine @var{xyz}. While the file is no longer used for this > purpose, the @file{.mh} suffix remains. Perhaps someone will > eventually rename these fragments so that they have a @file{.mn} > suffix.} > Hmmm, errmmm, I don't know what to do here. :-) The logical place would be to add the new variable to the "You can also define" list, as in the patch below, and possibly describe each of those variables... but, looking closer, I don't see any variable of the "You can also define" list being in use currently. Looks like an oportunity for further Makefile.in cleanup --- TM_CLIBS and TM_CDEPS also looks like looking for garbage collection. What do you think? -- Pedro Alves [-- Attachment #2: hurd_gen_files.diff --] [-- Type: text/x-diff, Size: 2433 bytes --] gdb/ 2008-09-10 Pedro Alves <pedro@codesourcery.com> * Makefile.in (generated_files): Add $(NAT_GENERATED_FILES). * config/i386/i386gnu.mh (NAT_GENERATED_FILES): New. gdb/doc/ 2008-09-10 Pedro Alves <pedro@codesourcery.com> * gdbint.texinfo (Native Debugging): Mention NAT_GENERATED_FILES. --- gdb/Makefile.in | 3 ++- gdb/config/i386/i386gnu.mh | 4 ++++ gdb/doc/gdbint.texinfo | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) Index: src/gdb/Makefile.in =================================================================== --- src.orig/gdb/Makefile.in 2008-09-10 19:13:36.000000000 +0100 +++ src/gdb/Makefile.in 2008-09-10 19:24:54.000000000 +0100 @@ -831,7 +831,8 @@ DISTSTUFF = $(YYFILES) # All generated files which can be included by another file. -generated_files = config.h observer.h observer.inc ada-lex.c $(GNULIB_H) +generated_files = config.h observer.h observer.inc ada-lex.c \ + $(GNULIB_H) $(NAT_GENERATED_FILES) .c.o: $(COMPILE) $< Index: src/gdb/config/i386/i386gnu.mh =================================================================== --- src.orig/gdb/config/i386/i386gnu.mh 2008-09-10 19:02:40.000000000 +0100 +++ src/gdb/config/i386/i386gnu.mh 2008-09-10 19:25:45.000000000 +0100 @@ -29,3 +29,7 @@ MIGCOM = $(MIG) -cc cat - /dev/null %_U.h %_U.c: %.defs $(CPP) $(CPPFLAGS) $($*-MIGUFLAGS) -x c $< \ | $(MIGCOM) -sheader /dev/null -server /dev/null -user $*_U.c -header $*_U.h + +NAT_GENERATED_FILES = notify_S.h notify_S.c process_reply_S.h process_reply_S.c \ + msg_reply_S.h msg_reply_S.c msg_U.h msg_U.c \ + exc_request_U.h exc_request_U.c exc_request_S.h exc_request_S.c Index: src/gdb/doc/gdbint.texinfo =================================================================== --- src.orig/gdb/doc/gdbint.texinfo 2008-09-10 19:15:21.000000000 +0100 +++ src/gdb/doc/gdbint.texinfo 2008-09-10 19:27:41.000000000 +0100 @@ -4417,7 +4417,7 @@ native-dependent object files, by defini Also specifies the header file which describes native support on @var{xyz}, by defining @samp{NAT_FILE= nm-@var{xyz}.h}. You can also define @samp{NAT_CFLAGS}, @samp{NAT_ADD_FILES}, @samp{NAT_CLIBS}, -@samp{NAT_CDEPS}, etc.; see @file{Makefile.in}. +@samp{NAT_CDEPS}, @samp{NAT_GENERATED_FILES}, etc.; see @file{Makefile.in}. @emph{Maintainer's note: The @file{.mh} suffix is because this file originally contained @file{Makefile} fragments for hosting @value{GDBN} ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [autodeps] gnu-nat, autogenerated files 2008-09-10 18:49 ` Pedro Alves @ 2008-09-12 5:06 ` Joel Brobecker 2008-09-12 9:10 ` Eli Zaretskii 0 siblings, 1 reply; 10+ messages in thread From: Joel Brobecker @ 2008-09-12 5:06 UTC (permalink / raw) To: Pedro Alves; +Cc: gdb-patches > Hmmmm, looking at the docs you pointed below, I believe NAT_GENERATED_FILES > is more correct. These files shouldn't be generated when building a cross > debugger hosted on the hurd. I've made that change, hope it's OK. That makes sense. > Hmmm, errmmm, I don't know what to do here. :-) Eli is the documentation guru, I'll let him decide :). > TM_CLIBS and TM_CDEPS also looks like looking for garbage collection. Yes - If I'm not mistaken, we have finally gotten rid of tm files. So they can definitely go. > 2008-09-10 Pedro Alves <pedro@codesourcery.com> > > * Makefile.in (generated_files): Add $(NAT_GENERATED_FILES). > * config/i386/i386gnu.mh (NAT_GENERATED_FILES): New. This part is OK. > gdb/doc/ > 2008-09-10 Pedro Alves <pedro@codesourcery.com> > > * gdbint.texinfo (Native Debugging): Mention NAT_GENERATED_FILES. That part needs to be reviewed by Eli. > + > +NAT_GENERATED_FILES = notify_S.h notify_S.c process_reply_S.h process_reply_S.c \ Just a very minor comment: I wonder if you might have exceeded 80 chars on this line. -- Joel ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [autodeps] gnu-nat, autogenerated files 2008-09-12 5:06 ` Joel Brobecker @ 2008-09-12 9:10 ` Eli Zaretskii 2008-09-12 10:44 ` Pedro Alves 0 siblings, 1 reply; 10+ messages in thread From: Eli Zaretskii @ 2008-09-12 9:10 UTC (permalink / raw) To: Joel Brobecker; +Cc: pedro, gdb-patches > Date: Thu, 11 Sep 2008 22:05:01 -0700 > From: Joel Brobecker <brobecker@adacore.com> > Cc: gdb-patches@sourceware.org > > > Hmmmm, looking at the docs you pointed below, I believe NAT_GENERATED_FILES > > is more correct. These files shouldn't be generated when building a cross > > debugger hosted on the hurd. I've made that change, hope it's OK. > > That makes sense. > > > Hmmm, errmmm, I don't know what to do here. :-) > > Eli is the documentation guru, I'll let him decide :). Pedro's patch for the documentation looks fine to me. Thanks. > > gdb/doc/ > > 2008-09-10 Pedro Alves <pedro@codesourcery.com> > > > > * gdbint.texinfo (Native Debugging): Mention NAT_GENERATED_FILES. > > That part needs to be reviewed by Eli. Done. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [autodeps] gnu-nat, autogenerated files 2008-09-12 9:10 ` Eli Zaretskii @ 2008-09-12 10:44 ` Pedro Alves 0 siblings, 0 replies; 10+ messages in thread From: Pedro Alves @ 2008-09-12 10:44 UTC (permalink / raw) To: gdb-patches, Eli Zaretskii; +Cc: Joel Brobecker On Friday 12 September 2008 06:05:01, Joel Brobecker wrote: > > + > > +NAT_GENERATED_FILES = notify_S.h notify_S.c process_reply_S.h > > process_reply_S.c \ > > Just a very minor comment: I wonder if you might have exceeded 80 chars > on this line. Sorry about that. Fixed. On Friday 12 September 2008 10:09:56, Eli Zaretskii wrote: > Pedro's patch for the documentation looks fine to me. Thanks guys. I've checked it in. -- Pedro Alves ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2008-09-12 10:44 UTC | newest] Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2008-09-09 15:07 [autodeps] gnu-nat, autogenerated files Pedro Alves 2008-09-09 16:09 ` Tom Tromey 2008-09-09 16:18 ` Daniel Jacobowitz 2008-09-09 16:28 ` Tom Tromey 2008-09-10 18:01 ` Joel Brobecker 2008-09-10 18:13 ` Daniel Jacobowitz 2008-09-10 18:49 ` Pedro Alves 2008-09-12 5:06 ` Joel Brobecker 2008-09-12 9:10 ` Eli Zaretskii 2008-09-12 10:44 ` Pedro Alves
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox