* [PATCH v3] gdbserver: fix the standalone build
@ 2013-06-28 12:05 Mircea Gherzan
2013-06-28 12:18 ` Yao Qi
2013-06-28 12:18 ` Pedro Alves
0 siblings, 2 replies; 10+ messages in thread
From: Mircea Gherzan @ 2013-06-28 12:05 UTC (permalink / raw)
To: yao, tromey, palves; +Cc: gdb-patches, Mircea Gherzan
When directly invoking gdb/gdbserver/configure && make, the build will
fail because the $(host_alias) is empty and thus create-version.sh does
not get enough parameters.
The output of gdbserver --version without this patch (built like above):
[...]
This gdbserver was configured as ""
After applying this patch:
[...]
This gdbserver was configured as "x86_64-unknown-linux-gnu"
Ok to commit?
2013-06-28 Mircea Gherzan <mircea.gherzan@intel.com>
gdbserver:
* configure.ac (version_host): Add it.
(version_host): Add it.
* configure: Rebuild.
* Makefile.in (version_host): Add it.
(version_target): Add it.
(version.c): Use $(version_host) and $(version_target).
Signed-off-by: Mircea Gherzan <mircea.gherzan@intel.com>
---
gdb/gdbserver/Makefile.in | 4 +++-
gdb/gdbserver/configure | 10 ++++++++++
gdb/gdbserver/configure.ac | 8 ++++++++
3 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index e5ecdd3..9053cf8 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -20,6 +20,8 @@ exec_prefix = @exec_prefix@
host_alias = @host_alias@
target_alias = @target_alias@
+version_host = @version_host@
+version_target = @version_target@
program_transform_name = @program_transform_name@
bindir = @bindir@
libdir = @libdir@
@@ -391,7 +393,7 @@ force:
version.c: Makefile $(srcdir)/../common/version.in $(srcdir)/../../bfd/version.h $(srcdir)/../common/create-version.sh
$(SHELL) $(srcdir)/../common/create-version.sh $(srcdir)/.. \
- $(host_alias) $(target_alias) version.c
+ $(version_host) $(version_target) version.c
xml-builtin.c: stamp-xml; @true
stamp-xml: $(XML_DIR)/feature_to_c.sh Makefile $(XML_FILES)
diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure
index b87fedb..0588c94 100755
--- a/gdb/gdbserver/configure
+++ b/gdb/gdbserver/configure
@@ -589,6 +589,8 @@ ac_includes_default="\
#endif"
ac_subst_vars='LTLIBOBJS
+version_target
+version_host
GNULIB_STDINT_H
extra_libraries
IPA_DEPFILES
@@ -5926,6 +5928,14 @@ if test x"$STDINT_H" != x; then
fi
+# For --version, we want to the print --host/--target exactly
+# as passed to configure. But if those were not specified, then
+# print the canonical host/target.
+version_host=${host_alias:-$host}
+version_target=${target_alias:-$target}
+
+
+
ac_config_files="$ac_config_files Makefile"
ac_config_commands="$ac_config_commands default"
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index b9928d7..c983d41 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -471,6 +471,14 @@ if test x"$STDINT_H" != x; then
fi
AC_SUBST(GNULIB_STDINT_H)
+# For --version, we want to the print --host/--target exactly
+# as passed to configure. But if those were not specified, then
+# print the canonical host/target.
+version_host=${host_alias:-$host}
+version_target=${target_alias:-$target}
+AC_SUBST(version_host)
+AC_SUBST(version_target)
+
AC_OUTPUT(Makefile,
[case x$CONFIG_HEADERS in
xconfig.h:config.in)
--
1.7.12.4
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH v3] gdbserver: fix the standalone build
2013-06-28 12:05 [PATCH v3] gdbserver: fix the standalone build Mircea Gherzan
@ 2013-06-28 12:18 ` Yao Qi
2013-06-28 12:43 ` Pedro Alves
2013-06-28 12:18 ` Pedro Alves
1 sibling, 1 reply; 10+ messages in thread
From: Yao Qi @ 2013-06-28 12:18 UTC (permalink / raw)
To: Mircea Gherzan; +Cc: tromey, palves, gdb-patches
On 06/28/2013 07:59 PM, Mircea Gherzan wrote:
> When directly invoking gdb/gdbserver/configure && make, the build will
> fail because the $(host_alias) is empty and thus create-version.sh does
> not get enough parameters.
>
> The output of gdbserver --version without this patch (built like above):
>
> [...]
> This gdbserver was configured as ""
>
> After applying this patch:
>
> [...]
> This gdbserver was configured as "x86_64-unknown-linux-gnu"
>
> Ok to commit?
>
> 2013-06-28 Mircea Gherzan<mircea.gherzan@intel.com>
>
> gdbserver:
>
> * configure.ac (version_host): Add it.
> (version_host): Add it.
> * configure: Rebuild.
> * Makefile.in (version_host): Add it.
> (version_target): Add it.
> (version.c): Use $(version_host) and $(version_target).
If we commit this patch, probably my patch to common/create-version.sh
becomes useless, because 'target_alias' or 'target' will be always
passed to it.
2013-06-27 Yao Qi <yao@codesourcery.com>
* common/create-version.sh: Update comments. Handle the case
that TARGET_ALIAS is empty.
revert it?
--
Yao (é½å°§)
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3] gdbserver: fix the standalone build
2013-06-28 12:18 ` Yao Qi
@ 2013-06-28 12:43 ` Pedro Alves
2013-06-29 3:11 ` Yao Qi
0 siblings, 1 reply; 10+ messages in thread
From: Pedro Alves @ 2013-06-28 12:43 UTC (permalink / raw)
To: Yao Qi; +Cc: Mircea Gherzan, tromey, gdb-patches
On 06/28/2013 01:17 PM, Yao Qi wrote:
> On 06/28/2013 07:59 PM, Mircea Gherzan wrote:
>> When directly invoking gdb/gdbserver/configure && make, the build will
>> fail because the $(host_alias) is empty and thus create-version.sh does
>> not get enough parameters.
>>
>> The output of gdbserver --version without this patch (built like above):
>>
>> [...]
>> This gdbserver was configured as ""
>>
>> After applying this patch:
>>
>> [...]
>> This gdbserver was configured as "x86_64-unknown-linux-gnu"
>>
>> Ok to commit?
>>
>> 2013-06-28 Mircea Gherzan<mircea.gherzan@intel.com>
>>
>> gdbserver:
>>
>> * configure.ac (version_host): Add it.
>> (version_host): Add it.
>> * configure: Rebuild.
>> * Makefile.in (version_host): Add it.
>> (version_target): Add it.
>> (version.c): Use $(version_host) and $(version_target).
>
> If we commit this patch, probably my patch to common/create-version.sh
> becomes useless, because 'target_alias' or 'target' will be always
> passed to it.
>
> 2013-06-27 Yao Qi <yao@codesourcery.com>
>
> * common/create-version.sh: Update comments. Handle the case
> that TARGET_ALIAS is empty.
>
> revert it?
Doesn't GDB, and whatever other users of create-version.h, need the
same treatment first?
--
Pedro Alves
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3] gdbserver: fix the standalone build
2013-06-28 12:43 ` Pedro Alves
@ 2013-06-29 3:11 ` Yao Qi
2013-07-01 15:39 ` Pedro Alves
0 siblings, 1 reply; 10+ messages in thread
From: Yao Qi @ 2013-06-29 3:11 UTC (permalink / raw)
To: Pedro Alves; +Cc: Mircea Gherzan, tromey, gdb-patches
On 06/28/2013 08:22 PM, Pedro Alves wrote:
> Doesn't GDB, and whatever other users of create-version.h, need the
> same treatment first?
In GDB, the 'target_alias' and 'host_alias' can't be empty, and
create-version.sh only has two users, GDB and GDBserver.
GDB is configured from the top level. On the top level, the FOO_alias
is set to @FOO_noncanonical@ (in Makefile.tpl). The
'target_noncanonical' is similar to 'version_target' we computed in
gdbserver/configure.ac. See config/acx.m4,
dnl ####
dnl # _GCC_TOPLEV_NONCANONICAL_TARGET
dnl # $target_alias or $host_noncanonical if blank.
dnl # Used when we would use $target_alias, but empty is not OK.
AC_DEFUN([_GCC_TOPLEV_NONCANONICAL_TARGET],
[AC_REQUIRE([_GCC_TOPLEV_NONCANONICAL_HOST]) []dnl
case ${target_alias} in
"") target_noncanonical=${host_noncanonical} ;;
*) target_noncanonical=${target_alias} ;;
esac
]) []dnl # _GCC_TOPLEV_NONCANONICAL_TARGET
and macro ACX_NONCANONICAL_TARGET is invoked in configure.ac.
the gdb/configure is invoked by passing "--build=${build_alias}
--host=${host_alias} --target=${target_alias}" from the top level (see
rule configure-gdb in Makefile.in).
--
Yao (é½å°§)
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH v3] gdbserver: fix the standalone build
2013-06-29 3:11 ` Yao Qi
@ 2013-07-01 15:39 ` Pedro Alves
2013-07-03 15:04 ` Yao Qi
0 siblings, 1 reply; 10+ messages in thread
From: Pedro Alves @ 2013-07-01 15:39 UTC (permalink / raw)
To: Yao Qi; +Cc: Pedro Alves, Mircea Gherzan, tromey, gdb-patches
On 06/29/2013 03:11 AM, Yao Qi wrote:
> On 06/28/2013 08:22 PM, Pedro Alves wrote:
>> Doesn't GDB, and whatever other users of create-version.h, need the
>> same treatment first?
>
> In GDB, the 'target_alias' and 'host_alias' can't be empty, and
> create-version.sh only has two users, GDB and GDBserver.
>
> GDB is configured from the top level. On the top level, the FOO_alias
> is set to @FOO_noncanonical@ (in Makefile.tpl). The
> 'target_noncanonical' is similar to 'version_target' we computed in
> gdbserver/configure.ac. See config/acx.m4,
...
> and macro ACX_NONCANONICAL_TARGET is invoked in configure.ac.
Hmm, gdb/testsuite/configure.ac is also using that, added here:
http://www.sourceware.org/ml/gdb-patches/2006-06/msg00330.html
Sounds like we should be making gdbserver use that too, instead
of reinventing our own...
>
> the gdb/configure is invoked by passing "--build=${build_alias}
> --host=${host_alias} --target=${target_alias}" from the top level (see
> rule configure-gdb in Makefile.in).
--
Pedro Alves
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH v3] gdbserver: fix the standalone build
2013-07-01 15:39 ` Pedro Alves
@ 2013-07-03 15:04 ` Yao Qi
2013-07-03 15:11 ` Yao Qi
0 siblings, 1 reply; 10+ messages in thread
From: Yao Qi @ 2013-07-03 15:04 UTC (permalink / raw)
To: Pedro Alves; +Cc: Mircea Gherzan, tromey, gdb-patches
On 07/01/2013 11:38 PM, Pedro Alves wrote:
> Hmm, gdb/testsuite/configure.ac is also using that, added here:
>
> http://www.sourceware.org/ml/gdb-patches/2006-06/msg00330.html
>
> Sounds like we should be making gdbserver use that too, instead
> of reinventing our own...
The following patches are to use @target_noncanonical@ and
@host_noncanonical@ in GDBserver. In order to make review easier, I
split the patch into two, #1 is to revert two previous commits, and #2
is to use noncanonical stuff. These two patches should be committed to
cvs in one go. Here is the patch 1/2.
I tested these patches by build gdb via 'configure & make' and
'configure --host=mips-linux & make', the generated version.c looks
right to me.
--
Yao (é½å°§)
gdb:
2013-07-03 Yao Qi <yao@codesourcery.com>
Revert:
2013-06-27 Yao Qi <yao@codesourcery.com>
* common/create-version.sh: Update comments. Handle the case
that TARGET_ALIAS is empty.
gdb/gdbserver:
2013-07-03 Yao Qi <yao@codesourcery.com>
Revert:
2013-06-28 Mircea Gherzan <mircea.gherzan@intel.com>
* configure.ac (version_host, version_target): Set and AC_SUBST them.
* configure: Rebuild.
* Makefile.in (version_host, version_target): Get from configure.
(version.c): Use $(version_host) and $(version_target).
---
gdb/common/create-version.sh | 17 ++++-------------
gdb/gdbserver/Makefile.in | 4 +---
gdb/gdbserver/configure | 10 ----------
gdb/gdbserver/configure.ac | 8 --------
4 files changed, 5 insertions(+), 34 deletions(-)
diff --git a/gdb/common/create-version.sh b/gdb/common/create-version.sh
index 0bdd0fd..ad50946 100755
--- a/gdb/common/create-version.sh
+++ b/gdb/common/create-version.sh
@@ -20,17 +20,12 @@
# Create version.c from version.in.
# Usage:
# create-version.sh PATH-TO-GDB-SRCDIR HOST_ALIAS \
-# [TARGET_ALIAS] OUTPUT-FILE-NAME
+# TARGET_ALIAS OUTPUT-FILE-NAME
srcdir="$1"
host_alias="$2"
-
-if [ "$#" = "4" ]; then
- target_alias="$3"
- output="$4"
-else
- output="$3"
-fi
+target_alias="$3"
+output="$4"
rm -f version.c-tmp $output version.tmp
date=`sed -n -e 's/^.* BFD_VERSION_DATE \(.*\)$/\1/p' $srcdir/../bfd/version.h`
@@ -38,10 +33,6 @@ sed -e "s/DATE/$date/" < $srcdir/version.in > version.tmp
echo '#include "version.h"' >> version.c-tmp
echo 'const char version[] = "'"`sed q version.tmp`"'";' >> version.c-tmp
echo 'const char host_name[] = "'"$host_alias"'";' >> version.c-tmp
-
-if [ "$#" = "4" ]; then
- echo 'const char target_name[] = "'"$target_alias"'";' >> version.c-tmp
-fi
-
+echo 'const char target_name[] = "'"$target_alias"'";' >> version.c-tmp
mv version.c-tmp $output
rm -f version.tmp
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index db4e086..d6c3ea8 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -20,8 +20,6 @@ exec_prefix = @exec_prefix@
host_alias = @host_alias@
target_alias = @target_alias@
-version_host = @version_host@
-version_target = @version_target@
program_transform_name = @program_transform_name@
bindir = @bindir@
libdir = @libdir@
@@ -393,7 +391,7 @@ force:
version.c: Makefile $(srcdir)/../version.in $(srcdir)/../../bfd/version.h $(srcdir)/../common/create-version.sh
$(SHELL) $(srcdir)/../common/create-version.sh $(srcdir)/.. \
- $(version_host) $(version_target) version.c
+ $(host_alias) $(target_alias) version.c
xml-builtin.c: stamp-xml; @true
stamp-xml: $(XML_DIR)/feature_to_c.sh Makefile $(XML_FILES)
diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure
index 49b9ab6..173797a 100755
--- a/gdb/gdbserver/configure
+++ b/gdb/gdbserver/configure
@@ -589,8 +589,6 @@ ac_includes_default="\
#endif"
ac_subst_vars='LTLIBOBJS
-version_target
-version_host
GNULIB_STDINT_H
extra_libraries
IPA_DEPFILES
@@ -5928,14 +5926,6 @@ if test x"$STDINT_H" != x; then
fi
-# For --version, we want to the print --host/--target exactly
-# as passed to configure. But if those were not specified, then
-# print the canonical host/target.
-version_host=${host_alias:-$host}
-version_target=${target_alias:-$target}
-
-
-
ac_config_files="$ac_config_files Makefile"
ac_config_commands="$ac_config_commands default"
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index 2658bef..95bb0c6 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -471,14 +471,6 @@ if test x"$STDINT_H" != x; then
fi
AC_SUBST(GNULIB_STDINT_H)
-# For --version, we want to the print --host/--target exactly
-# as passed to configure. But if those were not specified, then
-# print the canonical host/target.
-version_host=${host_alias:-$host}
-version_target=${target_alias:-$target}
-AC_SUBST(version_host)
-AC_SUBST(version_target)
-
AC_OUTPUT(Makefile,
[case x$CONFIG_HEADERS in
xconfig.h:config.in)
--
1.7.7.6
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH v3] gdbserver: fix the standalone build
2013-07-03 15:04 ` Yao Qi
@ 2013-07-03 15:11 ` Yao Qi
2013-07-03 15:19 ` Pedro Alves
0 siblings, 1 reply; 10+ messages in thread
From: Yao Qi @ 2013-07-03 15:11 UTC (permalink / raw)
To: Pedro Alves; +Cc: Mircea Gherzan, tromey, gdb-patches
On 07/03/2013 11:04 PM, Yao Qi wrote:
> The following patches are to use @target_noncanonical@ and
> @host_noncanonical@ in GDBserver. In order to make review easier, I
> split the patch into two, #1 is to revert two previous commits, and #2
> is to use noncanonical stuff. These two patches should be committed to
> cvs in one go.
Here is the patch 2/2.
Since config/acx.m4 was included in gdb/gdbserver/acinclude.m4, we don't
have to include it.
--
Yao (é½å°§)
gdb/gdbserver:
2013-07-03 Yao Qi <yao@codesourcery.com>
* Makefile.in (host_alias): Use @host_noncanonical@.
(target_alias): Use @target_noncanonical@.
* configure.ac: Use ACX_NONCANONICAL_TARGET and
ACX_NONCANONICAL_HOST.
* configure: Regenerated.
---
gdb/gdbserver/Makefile.in | 4 ++--
gdb/gdbserver/configure | 22 ++++++++++++++++++++++
gdb/gdbserver/configure.ac | 3 +++
3 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index d6c3ea8..8f297c6 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -18,8 +18,8 @@
prefix = @prefix@
exec_prefix = @exec_prefix@
-host_alias = @host_alias@
-target_alias = @target_alias@
+host_alias = @host_noncanonical@
+target_alias = @target_noncanonical@
program_transform_name = @program_transform_name@
bindir = @bindir@
libdir = @libdir@
diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure
index 173797a..d4d12ae 100755
--- a/gdb/gdbserver/configure
+++ b/gdb/gdbserver/configure
@@ -612,6 +612,8 @@ MAKE
CCDEPMODE
DEPDIR
am__leading_dot
+host_noncanonical
+target_noncanonical
ALLOCA
RANLIB
INSTALL_DATA
@@ -4478,6 +4480,26 @@ _ACEOF
fi
+ case ${build_alias} in
+ "") build_noncanonical=${build} ;;
+ *) build_noncanonical=${build_alias} ;;
+esac
+
+ case ${host_alias} in
+ "") host_noncanonical=${build_noncanonical} ;;
+ *) host_noncanonical=${host_alias} ;;
+esac
+
+ case ${target_alias} in
+ "") target_noncanonical=${host_noncanonical} ;;
+ *) target_noncanonical=${target_alias} ;;
+esac
+
+
+
+
+
+
# Dependency checking.
rm -rf .tst 2>/dev/null
mkdir .tst 2>/dev/null
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index 95bb0c6..3c8569f 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -41,6 +41,9 @@ AC_HEADER_DIRENT
AC_FUNC_ALLOCA
+ACX_NONCANONICAL_TARGET
+ACX_NONCANONICAL_HOST
+
# Dependency checking.
ZW_CREATE_DEPDIR
ZW_PROG_COMPILER_DEPENDENCIES([CC])
--
1.7.7.6
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH v3] gdbserver: fix the standalone build
2013-07-03 15:11 ` Yao Qi
@ 2013-07-03 15:19 ` Pedro Alves
2013-07-04 1:27 ` Yao Qi
0 siblings, 1 reply; 10+ messages in thread
From: Pedro Alves @ 2013-07-03 15:19 UTC (permalink / raw)
To: Yao Qi; +Cc: Mircea Gherzan, tromey, gdb-patches
On 07/03/2013 04:10 PM, Yao Qi wrote:
> On 07/03/2013 11:04 PM, Yao Qi wrote:
>> The following patches are to use @target_noncanonical@ and
>> @host_noncanonical@ in GDBserver. In order to make review easier, I
>> split the patch into two, #1 is to revert two previous commits, and #2
>> is to use noncanonical stuff. These two patches should be committed to
>> cvs in one go.
>
> Here is the patch 2/2.
>
> Since config/acx.m4 was included in gdb/gdbserver/acinclude.m4, we don't
> have to include it.
>
Both patches are OK, thanks.
--
Pedro Alves
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v3] gdbserver: fix the standalone build
2013-06-28 12:05 [PATCH v3] gdbserver: fix the standalone build Mircea Gherzan
2013-06-28 12:18 ` Yao Qi
@ 2013-06-28 12:18 ` Pedro Alves
1 sibling, 0 replies; 10+ messages in thread
From: Pedro Alves @ 2013-06-28 12:18 UTC (permalink / raw)
To: Mircea Gherzan; +Cc: yao, tromey, gdb-patches
On 06/28/2013 12:59 PM, Mircea Gherzan wrote:
> gdbserver:
>
> * configure.ac (version_host): Add it.
> (version_host): Add it.
Typo, version_target. Say:
* configure.ac (version_host, version_target): Set and
AC_SUBST them.
> * configure: Rebuild.
> * Makefile.in (version_host): Add it.
> (version_target): Add it.
* Makefile.in (version_host, version_target): Get from
configure.
> (version.c): Use $(version_host) and $(version_target).
Otherwise OK, thanks.
--
Pedro Alves
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2013-07-04 1:27 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-28 12:05 [PATCH v3] gdbserver: fix the standalone build Mircea Gherzan
2013-06-28 12:18 ` Yao Qi
2013-06-28 12:43 ` Pedro Alves
2013-06-29 3:11 ` Yao Qi
2013-07-01 15:39 ` Pedro Alves
2013-07-03 15:04 ` Yao Qi
2013-07-03 15:11 ` Yao Qi
2013-07-03 15:19 ` Pedro Alves
2013-07-04 1:27 ` Yao Qi
2013-06-28 12:18 ` Pedro Alves
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox