public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] tile: fix type of prfpregset_t in <sys/procfs.h>
@ 2012-09-06 16:17 Chris Metcalf
  2012-09-06 16:25 ` Carlos O'Donell
  0 siblings, 1 reply; 5+ messages in thread
From: Chris Metcalf @ 2012-09-06 16:17 UTC (permalink / raw)
  To: libc-ports, carlos_odonell

The previous dummy definition (as type int) was fine in general, since
tile doesn't have floating-point registers, but it confused gdb's
configure, leading to later compile errors.  This change also makes
prfpregset_t parallel to prgregset_t, which seems like generally the
right thing regardless of the non-existence of the actual registers :-)
---
Carlos, we should backport this to 2.16 and probably 2.15, so gdb will be
able to build without hackery against it.  Would you like me to integrate
the change to the branch(es)?

 ports/ChangeLog.tile                            |    2 ++
 ports/sysdeps/unix/sysv/linux/tile/sys/procfs.h |    2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/ports/ChangeLog.tile b/ports/ChangeLog.tile
index f02c9d8..a289d24 100644
--- a/ports/ChangeLog.tile
+++ b/ports/ChangeLog.tile
@@ -1,5 +1,7 @@
 2012-09-06  Chris Metcalf  <cmetcalf@tilera.com>
 
+	* sysdeps/unix/sysv/linux/tile/sys/procfs.h: Fix type of prfpregset_t.
+
 	[BZ #14237]
 	* sysdeps/tile/__tls_get_addr.S: Fix TLS module initialization bug.
 
diff --git a/ports/sysdeps/unix/sysv/linux/tile/sys/procfs.h b/ports/sysdeps/unix/sysv/linux/tile/sys/procfs.h
index 295ae50..f533eb1 100644
--- a/ports/sysdeps/unix/sysv/linux/tile/sys/procfs.h
+++ b/ports/sysdeps/unix/sysv/linux/tile/sys/procfs.h
@@ -113,7 +113,7 @@ typedef void *psaddr_t;
 typedef elf_gregset_t prgregset_t;
 
 /* Provide dummy declaration here; we don't have FP registers. */
-typedef int prfpregset_t;
+typedef elf_fpregset_t prfpregset_t;
 
 /* We don't have any differences between processes and threads,
    therefore have only one PID type.  */
-- 
1.7.10.3

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

* Re: [PATCH] tile: fix type of prfpregset_t in <sys/procfs.h>
  2012-09-06 16:17 [PATCH] tile: fix type of prfpregset_t in <sys/procfs.h> Chris Metcalf
@ 2012-09-06 16:25 ` Carlos O'Donell
  2012-09-06 17:06   ` Chris Metcalf
  0 siblings, 1 reply; 5+ messages in thread
From: Carlos O'Donell @ 2012-09-06 16:25 UTC (permalink / raw)
  To: Chris Metcalf; +Cc: libc-ports

On 9/6/2012 11:43 AM, Chris Metcalf wrote:
> The previous dummy definition (as type int) was fine in general, since
> tile doesn't have floating-point registers, but it confused gdb's
> configure, leading to later compile errors.  This change also makes
> prfpregset_t parallel to prgregset_t, which seems like generally the
> right thing regardless of the non-existence of the actual registers :-)
> ---
> Carlos, we should backport this to 2.16 and probably 2.15, so gdb will be
> able to build without hackery against it.  Would you like me to integrate
> the change to the branch(es)?

If the type hasn't changed size then yes, please backport and check to 2.16 and 2.15.

>  ports/ChangeLog.tile                            |    2 ++
>  ports/sysdeps/unix/sysv/linux/tile/sys/procfs.h |    2 +-
>  2 files changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/ports/ChangeLog.tile b/ports/ChangeLog.tile
> index f02c9d8..a289d24 100644
> --- a/ports/ChangeLog.tile
> +++ b/ports/ChangeLog.tile
> @@ -1,5 +1,7 @@
>  2012-09-06  Chris Metcalf  <cmetcalf@tilera.com>
>  
> +	* sysdeps/unix/sysv/linux/tile/sys/procfs.h: Fix type of prfpregset_t.
> +
>  	[BZ #14237]
>  	* sysdeps/tile/__tls_get_addr.S: Fix TLS module initialization bug.
>  
> diff --git a/ports/sysdeps/unix/sysv/linux/tile/sys/procfs.h b/ports/sysdeps/unix/sysv/linux/tile/sys/procfs.h
> index 295ae50..f533eb1 100644
> --- a/ports/sysdeps/unix/sysv/linux/tile/sys/procfs.h
> +++ b/ports/sysdeps/unix/sysv/linux/tile/sys/procfs.h
> @@ -113,7 +113,7 @@ typedef void *psaddr_t;
>  typedef elf_gregset_t prgregset_t;
>  
>  /* Provide dummy declaration here; we don't have FP registers. */
> -typedef int prfpregset_t;
> +typedef elf_fpregset_t prfpregset_t;
>  
>  /* We don't have any differences between processes and threads,
>     therefore have only one PID type.  */
> 

Cheers,
Carlos.
-- 
Carlos O'Donell
Mentor Graphics / CodeSourcery
carlos_odonell@mentor.com
carlos@codesourcery.com
+1 (613) 963 1026

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

* Re: [PATCH] tile: fix type of prfpregset_t in <sys/procfs.h>
  2012-09-06 16:25 ` Carlos O'Donell
@ 2012-09-06 17:06   ` Chris Metcalf
  2012-09-06 19:02     ` Carlos O'Donell
  0 siblings, 1 reply; 5+ messages in thread
From: Chris Metcalf @ 2012-09-06 17:06 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: libc-ports

On 9/6/2012 12:25 PM, Carlos O'Donell wrote:
> On 9/6/2012 11:43 AM, Chris Metcalf wrote:
>> The previous dummy definition (as type int) was fine in general, since
>> tile doesn't have floating-point registers, but it confused gdb's
>> configure, leading to later compile errors.  This change also makes
>> prfpregset_t parallel to prgregset_t, which seems like generally the
>> right thing regardless of the non-existence of the actual registers :-)
>> ---
>> Carlos, we should backport this to 2.16 and probably 2.15, so gdb will be
>> able to build without hackery against it.  Would you like me to integrate
>> the change to the branch(es)?
> If the type hasn't changed size then yes, please backport and check to 2.16 and 2.15.

The type does change size for tilegx64 (not tilepro or tilegx32).  What is
the concern with prfpregset_t's size changing?  The type was never used for
anything before as far as I'm aware, other than gdb, and gdb 7.5 is the
first release of gdb that includes  tilegx support.  It requires the
correct, new type.

Interestingly, in glibc itself the type is only used as "prfpregset_t *",
so those references to the type will not change size, being a pointer
either way.  (The references are in nptl_db, as an argument to
ps_lgetfpregs(), ps_lsetfpregs(), td_thr_getfpregs(), and td_thr_setfpregs().)

>>  ports/ChangeLog.tile                            |    2 ++
>>  ports/sysdeps/unix/sysv/linux/tile/sys/procfs.h |    2 +-
>>  2 files changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/ports/ChangeLog.tile b/ports/ChangeLog.tile
>> index f02c9d8..a289d24 100644
>> --- a/ports/ChangeLog.tile
>> +++ b/ports/ChangeLog.tile
>> @@ -1,5 +1,7 @@
>>  2012-09-06  Chris Metcalf  <cmetcalf@tilera.com>
>>  
>> +	* sysdeps/unix/sysv/linux/tile/sys/procfs.h: Fix type of prfpregset_t.
>> +
>>  	[BZ #14237]
>>  	* sysdeps/tile/__tls_get_addr.S: Fix TLS module initialization bug.
>>  
>> diff --git a/ports/sysdeps/unix/sysv/linux/tile/sys/procfs.h b/ports/sysdeps/unix/sysv/linux/tile/sys/procfs.h
>> index 295ae50..f533eb1 100644
>> --- a/ports/sysdeps/unix/sysv/linux/tile/sys/procfs.h
>> +++ b/ports/sysdeps/unix/sysv/linux/tile/sys/procfs.h
>> @@ -113,7 +113,7 @@ typedef void *psaddr_t;
>>  typedef elf_gregset_t prgregset_t;
>>  
>>  /* Provide dummy declaration here; we don't have FP registers. */
>> -typedef int prfpregset_t;
>> +typedef elf_fpregset_t prfpregset_t;
>>  
>>  /* We don't have any differences between processes and threads,
>>     therefore have only one PID type.  */
>>
> Cheers,
> Carlos.

-- 
Chris Metcalf, Tilera Corp.
http://www.tilera.com

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

* Re: [PATCH] tile: fix type of prfpregset_t in <sys/procfs.h>
  2012-09-06 17:06   ` Chris Metcalf
@ 2012-09-06 19:02     ` Carlos O'Donell
  2012-09-06 20:54       ` Chris Metcalf
  0 siblings, 1 reply; 5+ messages in thread
From: Carlos O'Donell @ 2012-09-06 19:02 UTC (permalink / raw)
  To: Chris Metcalf; +Cc: Carlos O'Donell, libc-ports

On 9/6/2012 1:06 PM, Chris Metcalf wrote:
> On 9/6/2012 12:25 PM, Carlos O'Donell wrote:
>> On 9/6/2012 11:43 AM, Chris Metcalf wrote:
>>> The previous dummy definition (as type int) was fine in general, since
>>> tile doesn't have floating-point registers, but it confused gdb's
>>> configure, leading to later compile errors.  This change also makes
>>> prfpregset_t parallel to prgregset_t, which seems like generally the
>>> right thing regardless of the non-existence of the actual registers :-)
>>> ---
>>> Carlos, we should backport this to 2.16 and probably 2.15, so gdb will be
>>> able to build without hackery against it.  Would you like me to integrate
>>> the change to the branch(es)?
>> If the type hasn't changed size then yes, please backport and check to 2.16 and 2.15.
> 
> The type does change size for tilegx64 (not tilepro or tilegx32).  What is
> the concern with prfpregset_t's size changing?  The type was never used for
> anything before as far as I'm aware, other than gdb, and gdb 7.5 is the
> first release of gdb that includes  tilegx support.  It requires the
> correct, new type.

The implication is clear, if the type changes size then you need to give
a good argument about why it doesn't matter to the ABI.

It sounds like you're arguing that:

(a) The type was never used for tile.

(b) The only consumer you know about is gdb and it requires the correct type.

and...

> Interestingly, in glibc itself the type is only used as "prfpregset_t *",
> so those references to the type will not change size, being a pointer
> either way.  (The references are in nptl_db, as an argument to
> ps_lgetfpregs(), ps_lsetfpregs(), td_thr_getfpregs(), and td_thr_setfpregs().)

(c) The change in size doesn't alter the layout of other structures.

It sounds like you've covered your bases.

Please checkin the change to 2.15 and 2.16.

Cheers,
Carlos.
-- 
Carlos O'Donell
Mentor Graphics / CodeSourcery
carlos_odonell@mentor.com
carlos@codesourcery.com
+1 (613) 963 1026

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

* Re: [PATCH] tile: fix type of prfpregset_t in <sys/procfs.h>
  2012-09-06 19:02     ` Carlos O'Donell
@ 2012-09-06 20:54       ` Chris Metcalf
  0 siblings, 0 replies; 5+ messages in thread
From: Chris Metcalf @ 2012-09-06 20:54 UTC (permalink / raw)
  To: Carlos O'Donell; +Cc: libc-ports

On 9/6/2012 3:01 PM, Carlos O'Donell wrote:
> Please checkin the change to 2.15 and 2.16. 

Done, thanks!

-- 
Chris Metcalf, Tilera Corp.
http://www.tilera.com

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

end of thread, other threads:[~2012-09-06 20:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-06 16:17 [PATCH] tile: fix type of prfpregset_t in <sys/procfs.h> Chris Metcalf
2012-09-06 16:25 ` Carlos O'Donell
2012-09-06 17:06   ` Chris Metcalf
2012-09-06 19:02     ` Carlos O'Donell
2012-09-06 20:54       ` Chris Metcalf

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