* [PATCH] gdbsupport: remove attempt to define TARGET_WORD_SIZE
@ 2021-09-24 16:44 Andrew Burgess
2021-09-24 16:54 ` Pedro Alves
0 siblings, 1 reply; 4+ messages in thread
From: Andrew Burgess @ 2021-09-24 16:44 UTC (permalink / raw)
To: gdb-patches
In the gdbsupport configure.ac file, there is an attempt to define
TARGET_WORD_SIZE. This is done by running grep on the file
../bfd/bfd-in3.h.
The problem with this is, the file bfd-in3.h is generated into the bfd
build directory when bfd is configured, and there is no dependency
between the gdbsupport module and the bfd module, so, for example, if
I do:
$ ../src/configure
$ make all-gdbsupport
Then bfd will neither be configured, or built. In this case
TARGET_WORD_SIZE ends up being defined, but with no value because the
grep on bfd-in3.h fails.
However, it turns out that this doesn't matter; we don't actually use
TARGET_WORD_SIZE anywhere.
My proposal in this commit is to just remove the definition of
TARGET_WORD_SIZE, the alternative would be to add a dependency between
configure-gdbsupport and configure-bfd into Makefile.def, but adding a
dependency for something we don't need seems pretty pointless.
---
gdbsupport/config.in | 3 ---
gdbsupport/configure | 7 -------
gdbsupport/configure.ac | 4 ----
3 files changed, 14 deletions(-)
diff --git a/gdbsupport/config.in b/gdbsupport/config.in
index f46e2612c74..e4e6fc062cc 100644
--- a/gdbsupport/config.in
+++ b/gdbsupport/config.in
@@ -354,9 +354,6 @@
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
-/* Define to the word size for the target. */
-#undef TARGET_WORD_SIZE
-
/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
diff --git a/gdbsupport/configure b/gdbsupport/configure
index a9dd02c5b72..08800228aa5 100755
--- a/gdbsupport/configure
+++ b/gdbsupport/configure
@@ -10286,13 +10286,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
-TARGET_WORD_SIZE=`sed -n 's,#define BFD_ARCH_SIZE \(.*\)$,\1,p' ../bfd/bfd-in3.h`
-
-cat >>confdefs.h <<_ACEOF
-#define TARGET_WORD_SIZE $TARGET_WORD_SIZE
-_ACEOF
-
-
case ${host} in
*mingw32*)
diff --git a/gdbsupport/configure.ac b/gdbsupport/configure.ac
index a8fcfe24c32..f10a856fe24 100644
--- a/gdbsupport/configure.ac
+++ b/gdbsupport/configure.ac
@@ -59,10 +59,6 @@ GDB_AC_PTRACE
# Detect support warning flags.
AM_GDB_WARNINGS
-TARGET_WORD_SIZE=`sed -n 's,#define BFD_ARCH_SIZE \(.*\)$,\1,p' ../bfd/bfd-in3.h`
-AC_DEFINE_UNQUOTED(TARGET_WORD_SIZE, $TARGET_WORD_SIZE,
- [Define to the word size for the target.])
-
case ${host} in
*mingw32*)
AC_DEFINE(USE_WIN32API, 1,
--
2.25.4
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] gdbsupport: remove attempt to define TARGET_WORD_SIZE
2021-09-24 16:44 [PATCH] gdbsupport: remove attempt to define TARGET_WORD_SIZE Andrew Burgess
@ 2021-09-24 16:54 ` Pedro Alves
2021-09-30 17:38 ` Tom Tromey
0 siblings, 1 reply; 4+ messages in thread
From: Pedro Alves @ 2021-09-24 16:54 UTC (permalink / raw)
To: Andrew Burgess, gdb-patches
On 2021-09-24 5:44 p.m., Andrew Burgess wrote:
> In the gdbsupport configure.ac file, there is an attempt to define
> TARGET_WORD_SIZE. This is done by running grep on the file
> ../bfd/bfd-in3.h.
>
> The problem with this is, the file bfd-in3.h is generated into the bfd
> build directory when bfd is configured, and there is no dependency
> between the gdbsupport module and the bfd module, so, for example, if
> I do:
>
> $ ../src/configure
> $ make all-gdbsupport
>
> Then bfd will neither be configured, or built. In this case
> TARGET_WORD_SIZE ends up being defined, but with no value because the
> grep on bfd-in3.h fails.
>
> However, it turns out that this doesn't matter; we don't actually use
> TARGET_WORD_SIZE anywhere.
>
> My proposal in this commit is to just remove the definition of
> TARGET_WORD_SIZE, the alternative would be to add a dependency between
> configure-gdbsupport and configure-bfd into Makefile.def, but adding a
> dependency for something we don't need seems pretty pointless.
Strange, that TARGET_WORD_SIZE bits was added by 01027315f540, and AFAICS, git
grep on 01027315f540^ only finds ChangeLog hits. But it wasn't used anywhere when it
was added by commit 01027315f540 either.
Maybe Tromey remembers.
The patch LGTM.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] gdbsupport: remove attempt to define TARGET_WORD_SIZE
2021-09-24 16:54 ` Pedro Alves
@ 2021-09-30 17:38 ` Tom Tromey
2021-10-04 10:24 ` Andrew Burgess
0 siblings, 1 reply; 4+ messages in thread
From: Tom Tromey @ 2021-09-30 17:38 UTC (permalink / raw)
To: Pedro Alves; +Cc: Andrew Burgess, gdb-patches
>>>>> "Pedro" == Pedro Alves <pedro@palves.net> writes:
Pedro> Strange, that TARGET_WORD_SIZE bits was added by 01027315f540,
Pedro> and AFAICS, git grep on 01027315f540^ only finds ChangeLog hits.
Pedro> But it wasn't used anywhere when it was added by commit
Pedro> 01027315f540 either.
Pedro> Maybe Tromey remembers.
I don't, sorry.
Pedro> The patch LGTM.
Me too.
Tom
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] gdbsupport: remove attempt to define TARGET_WORD_SIZE
2021-09-30 17:38 ` Tom Tromey
@ 2021-10-04 10:24 ` Andrew Burgess
0 siblings, 0 replies; 4+ messages in thread
From: Andrew Burgess @ 2021-10-04 10:24 UTC (permalink / raw)
To: Tom Tromey; +Cc: Pedro Alves, gdb-patches
Thanks for the reviews. I've pushed this patch now.
Andrew
* Tom Tromey <tom@tromey.com> [2021-09-30 11:38:54 -0600]:
> >>>>> "Pedro" == Pedro Alves <pedro@palves.net> writes:
>
> Pedro> Strange, that TARGET_WORD_SIZE bits was added by 01027315f540,
> Pedro> and AFAICS, git grep on 01027315f540^ only finds ChangeLog hits.
> Pedro> But it wasn't used anywhere when it was added by commit
> Pedro> 01027315f540 either.
>
> Pedro> Maybe Tromey remembers.
>
> I don't, sorry.
>
> Pedro> The patch LGTM.
>
> Me too.
>
> Tom
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-10-04 10:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-24 16:44 [PATCH] gdbsupport: remove attempt to define TARGET_WORD_SIZE Andrew Burgess
2021-09-24 16:54 ` Pedro Alves
2021-09-30 17:38 ` Tom Tromey
2021-10-04 10:24 ` Andrew Burgess
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).