public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Find arm-linux-gnueabihf-gcc in compile
@ 2018-01-18  8:46 Yao Qi
  2018-01-18 15:35 ` Simon Marchi
  2018-01-18 18:32 ` Pedro Alves
  0 siblings, 2 replies; 4+ messages in thread
From: Yao Qi @ 2018-01-18  8:46 UTC (permalink / raw)
  To: gdb-patches

GCC for arm-linux has different names on different distros.  It is
arm-linux-gnu-gcc on fedora.  Debian/Ubuntu has arm-linux-gnueabihf-gcc.
So when I run gdb.compile/ tests on arm-linux, I get,

(gdb) compile code -- ;
Could not find a compiler matching "^arm(-[^-]*)?-linux(-gnu)?-gcc$"

This patch extend the regexp to match both arm-linux-gnu-gcc and
arm-linux-gnueabihf-gcc.

gdb:

2018-01-17  Yao Qi  <yao.qi@linaro.org>

	* osabi.c (gdb_osabi_names): Extend the regexp for
	arm-linux-gnueabihf.
---
 gdb/osabi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/osabi.c b/gdb/osabi.c
index 129164f..fd44deb 100644
--- a/gdb/osabi.c
+++ b/gdb/osabi.c
@@ -63,7 +63,7 @@ static const struct osabi_names gdb_osabi_names[] =
   { "SVR4", NULL },
   { "GNU/Hurd", NULL },
   { "Solaris", NULL },
-  { "GNU/Linux", "linux(-gnu)?" },
+  { "GNU/Linux", "linux(-gnu[^-]*)?" },
   { "FreeBSD", NULL },
   { "NetBSD", NULL },
   { "OpenBSD", NULL },
-- 
1.9.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Find arm-linux-gnueabihf-gcc in compile
  2018-01-18  8:46 [PATCH] Find arm-linux-gnueabihf-gcc in compile Yao Qi
@ 2018-01-18 15:35 ` Simon Marchi
  2018-01-18 18:32 ` Pedro Alves
  1 sibling, 0 replies; 4+ messages in thread
From: Simon Marchi @ 2018-01-18 15:35 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

On 2018-01-18 03:46, Yao Qi wrote:
> GCC for arm-linux has different names on different distros.  It is
> arm-linux-gnu-gcc on fedora.  Debian/Ubuntu has 
> arm-linux-gnueabihf-gcc.
> So when I run gdb.compile/ tests on arm-linux, I get,
> 
> (gdb) compile code -- ;
> Could not find a compiler matching "^arm(-[^-]*)?-linux(-gnu)?-gcc$"
> 
> This patch extend the regexp to match both arm-linux-gnu-gcc and
> arm-linux-gnueabihf-gcc.
> 
> gdb:
> 
> 2018-01-17  Yao Qi  <yao.qi@linaro.org>
> 
> 	* osabi.c (gdb_osabi_names): Extend the regexp for
> 	arm-linux-gnueabihf.
> ---
>  gdb/osabi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/gdb/osabi.c b/gdb/osabi.c
> index 129164f..fd44deb 100644
> --- a/gdb/osabi.c
> +++ b/gdb/osabi.c
> @@ -63,7 +63,7 @@ static const struct osabi_names gdb_osabi_names[] =
>    { "SVR4", NULL },
>    { "GNU/Hurd", NULL },
>    { "Solaris", NULL },
> -  { "GNU/Linux", "linux(-gnu)?" },
> +  { "GNU/Linux", "linux(-gnu[^-]*)?" },
>    { "FreeBSD", NULL },
>    { "NetBSD", NULL },
>    { "OpenBSD", NULL },

That seem reasonable to me.

Simon

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Find arm-linux-gnueabihf-gcc in compile
  2018-01-18  8:46 [PATCH] Find arm-linux-gnueabihf-gcc in compile Yao Qi
  2018-01-18 15:35 ` Simon Marchi
@ 2018-01-18 18:32 ` Pedro Alves
  2018-01-19  9:12   ` Yao Qi
  1 sibling, 1 reply; 4+ messages in thread
From: Pedro Alves @ 2018-01-18 18:32 UTC (permalink / raw)
  To: Yao Qi, gdb-patches

On 01/18/2018 08:46 AM, Yao Qi wrote:
> GCC for arm-linux has different names on different distros.  It is
> arm-linux-gnu-gcc on fedora.  Debian/Ubuntu has arm-linux-gnueabihf-gcc.
> So when I run gdb.compile/ tests on arm-linux, I get,
> 
> (gdb) compile code -- ;
> Could not find a compiler matching "^arm(-[^-]*)?-linux(-gnu)?-gcc$"
> 
> This patch extend the regexp to match both arm-linux-gnu-gcc and
> arm-linux-gnueabihf-gcc.

Debian seems to have a "arm-linux-gnueabi-gcc" as well,
<https://packages.debian.org/sid/gcc-7-arm-linux-gnueabi>, 
which I assume is a version that defaults to soft-float.  (Or
is that softfp?)

So it's not entirely accurate to say that it's
arm-linux-gnueabihf-gcc on Debian.  It has both (and maybe more).

The "hf" in the name is encoding the default float ABI the compiler
outputs (hf is for hard float), which may not be the right one if
you have multiple versions of the compiler around in the PATH.
(more likely in a cross setup than on native, I guess.)

I think either gnueabihf/gnueabi compiler would be able to emit
code for either ABI, it's just a matter of what is the default, so
which ABI to pick can be left to making gdb pass the
right -mfloat-abi=soft/softfp/hard (and likewise other
"-m" options).

Thus, seems OK.

Thanks,
Pedro Alves

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Find arm-linux-gnueabihf-gcc in compile
  2018-01-18 18:32 ` Pedro Alves
@ 2018-01-19  9:12   ` Yao Qi
  0 siblings, 0 replies; 4+ messages in thread
From: Yao Qi @ 2018-01-19  9:12 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches

Pedro Alves <palves@redhat.com> writes:

> Debian seems to have a "arm-linux-gnueabi-gcc" as well,
> <https://packages.debian.org/sid/gcc-7-arm-linux-gnueabi>, 
> which I assume is a version that defaults to soft-float.  (Or
> is that softfp?)

Yes, arm-linux-gnueabi implies the EABI with -mfloat-abi=soft or
-mfloat-abi=softfp, while arm-linux-gnueabihf implies -mfloat-abi=hard.
I amend the commitlog a little, and push the patch below in.

-- 
Yao (齐尧)
From dea445b940545f9564972c5410ac8792b72cc9c3 Mon Sep 17 00:00:00 2001
From: Yao Qi <yao.qi@linaro.org>
Date: Fri, 19 Jan 2018 09:08:36 +0000
Subject: [PATCH] Find arm-linux-gnueabi(hf)?-gcc in compile

GCC for arm-linux has different names on different distros.  It is
arm-linux-gnu-gcc on fedora.  Debian/Ubuntu has arm-linux-gnueabihf-gcc
and arm-linux-gnueabi-gcc.  So when I run gdb.compile/ tests on arm-linux,
I get,

(gdb) compile code -- ;
Could not find a compiler matching "^arm(-[^-]*)?-linux(-gnu)?-gcc$"

This patch extend the regexp to match both arm-linux-gnu-gcc and
arm-linux-gnueabihf-gcc.

gdb:

2018-01-19  Yao Qi  <yao.qi@linaro.org>

	* osabi.c (gdb_osabi_names): Extend the regexp for
	arm-linux-gnueabihf and arm-linux-gnueabi.

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 90dacd2..6709f44 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2018-01-19  Yao Qi  <yao.qi@linaro.org>
+
+	* osabi.c (gdb_osabi_names): Extend the regexp for
+	arm-linux-gnueabihf.
+
 2018-01-18  Yao Qi  <yao.qi@linaro.org>
 
 	* dwarf2read.c (abbrev_table) <abbrevs>: Rename it to
diff --git a/gdb/osabi.c b/gdb/osabi.c
index 129164f..fd44deb 100644
--- a/gdb/osabi.c
+++ b/gdb/osabi.c
@@ -63,7 +63,7 @@ static const struct osabi_names gdb_osabi_names[] =
   { "SVR4", NULL },
   { "GNU/Hurd", NULL },
   { "Solaris", NULL },
-  { "GNU/Linux", "linux(-gnu)?" },
+  { "GNU/Linux", "linux(-gnu[^-]*)?" },
   { "FreeBSD", NULL },
   { "NetBSD", NULL },
   { "OpenBSD", NULL },

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-01-19  9:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-18  8:46 [PATCH] Find arm-linux-gnueabihf-gcc in compile Yao Qi
2018-01-18 15:35 ` Simon Marchi
2018-01-18 18:32 ` Pedro Alves
2018-01-19  9:12   ` Yao Qi

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).