Re: [patch] for mig check in GDB's configure

2013-05-04 Thread Doug Evans
On Fri, May 3, 2013 at 3:43 AM, 陆岳  wrote:
>> Hmm, I think that instead of only examining the host system, $host, this
>> also needs to examine the target system, $target.  (Please tell if the
>> difference between build, host, and target system is not clear to you.)
>> The MIG tool is used to generate files (from RPC definition files) that
>> are used by the native GDB port for GNU Hurd (which, of couse, is the
>> only GNU Hurd port that currently exists.)  But if someone, for example,
>> builds GDB targeting mips-linux-gnu on a GNU Hurd system, they would not
>> need the MIG tool.
>>
>
> To my knowledge now, $target just need to set when building a compiler
> which specify which plateform your compiler generate code for. When we
> build GDB, it is trivial to check the variable.
> In your example, builds GDB targeting mips-linux-gnu means the GDB is
> running on mips-linux. So we only need to set the
> $host=mips-linux-gnu, $build=*-*-gnu.
> Maybe I have got a wrong understanding about these gcc terms.

I can run gdb on an x86 system and debug a program running on a mips
system via gdbserver (or some other program that speaks gdb's remote
protocol).

--build = system you're building the tool on
--host = system the tool will run on
--target = system the tool will handle or target (generate code for in
the case of gcc, debug in the case of gdb)

[These terms are common to all GNU tools, not just gcc btw.]

All three can be different for gdb as well as gcc.

So for example I *could*, given appropriately ported tools,
build gdb on x86, run it on mips, and have it debug programs running on arm.



Re: [patch] for mig check in GDB's configure

2013-05-04 Thread Yue Lu
Hi,

On Sun, May 5, 2013 at 1:22 AM, Doug Evans  wrote:
> On Fri, May 3, 2013 at 3:43 AM, 陆岳  wrote:
>>> Hmm, I think that instead of only examining the host system, $host, this
>>> also needs to examine the target system, $target.  (Please tell if the
>>> difference between build, host, and target system is not clear to you.)
>>> The MIG tool is used to generate files (from RPC definition files) that
>>> are used by the native GDB port for GNU Hurd (which, of couse, is the
>>> only GNU Hurd port that currently exists.)  But if someone, for example,
>>> builds GDB targeting mips-linux-gnu on a GNU Hurd system, they would not
>>> need the MIG tool.
>>>
> I can run gdb on an x86 system and debug a program running on a mips
> system via gdbserver (or some other program that speaks gdb's remote
> protocol).
>
> --build = system you're building the tool on
> --host = system the tool will run on
> --target = system the tool will handle or target (generate code for in
> the case of gcc, debug in the case of gdb)
>
> [These terms are common to all GNU tools, not just gcc btw.]

Thanks for the explanation. I have known about these three terms.

> So for example I *could*, given appropriately ported tools,
> build gdb on x86, run it on mips, and have it debug programs running on arm.

But I have one more question, why the one run on GNU Hurd which
targeting arm doesn't need to use MIG? As it run under GNU Hurd, it
must use the message transport facility and need to use MIG to
generate the interface file automatically or someone  write it by
hands.

-- 
Yue Lu (陆岳)



A quarter of the Hurd, Q3/Q4 of 2012: *pthreads*, *hardware* and *porting*.

2013-05-04 Thread Arne Babenhauserheide
Hi,

I finally managed to write the qoth for the 3rd and 4th quarter of 2012, and it 
would be great if you could review it:

http://darnassus.sceen.net/~hurd-web/contributing/web_pages/news/qoth_next/

---to simplify reading it, I pasted the text here, too---

A quarter of the Hurd, Q3/Q4 of 2012: *pthreads*, *hardware* and *porting*.

At the end of the last 2 quarters, Samuel Thibault pushed the [pthread 
patches](http://lists.gnu.org/archive/html/bug-hurd/2012-11/msg00088.html) from 
Vincente, Barry, Thomas, Richard and Samuel and others to the different 
upstream packages, finally enabling modern pthreads for the Hurd, which makes 
it possible to implement full Hurd bindings for languages which require 
pthreads, so for example [PyHurd](http://savannah.nongnu.org/projects/pyhurd/) 
can profit from the Hurd libraries instead of having to rely on low-level Mach 
bindings to implement Hurd features like translators. 

As followups, Thomas Schwinge [debugged and 
fixed](http://lists.gnu.org/archive/html/bug-hurd/2012-12/msg00044.html) a 
deadlock with child threads resulting from a regression due to earlier fixes, 
and Cyril Roelandt shared a [patch 
series](http://lists.gnu.org/archive/html/bug-hurd/2012-12/msg00018.html) to 
fix double mutex unlocking with pthreads. We will likely see more fixes like 
these, given that the whole threading interface changed, which will expose 
previously invisible bugs.

Also Samuel Thibault 
[provided](http://lists.gnu.org/archive/html/bug-hurd/2012-12/msg00052.html) 
new [installation 
CDs](http://people.debian.org/~sthibault/hurd-i386/installer/cdimage/current) 
and a new [qemu image](http://people.debian.org/~sthibault/hurd-i386/). 
Additionally to using pthreads, these now offer keyboard layout configuration.

Pino Toscano [implemented 
syncfs](http://lists.gnu.org/archive/html/bug-hurd/2012-11/msg00046.html) which 
ensures that all data in the filesystem gets written to disk, as well as 
[statfs](http://lists.gnu.org/archive/html/bug-hurd/2012-12/msg5.html), 
which adds additional statistics to procfs.

Thomas Schwinge and Samuel Thibault improved the hardware compatibility of the 
Hurd by fixing [some 
errors](http://lists.gnu.org/archive/html/bug-hurd/2012-11/msg00077.html) which 
caused a miscalculation of the size of medium sized disks reporting 15 heads 
instead of 16 and adding [network-card 
detection](http://lists.debian.org/debian-hurd/2012/07/msg00011.html) 
network-card detection on busses other than 0 and 2. And Svante Signell 

And several people ported and fixed packages, further increasing the number of 
debian packages which work on the Hurd: *Svante Signell* ported 
[mlocate-0.25](http://lists.debian.org/debian-hurd/2012/07/msg00015.html), 
[gnat-gps](http://lists.debian.org/debian-hurd/2012/07/msg00011.html), 
[libpst](http://lists.debian.org/debian-hurd/2012/08/msg00039.html), 
[libetpan](http://lists.debian.org/debian-hurd/2012/08/msg00046.html), 
[spl](http://lists.debian.org/debian-hurd/2012/09/msg4.html), 
[dovecot](http://lists.debian.org/debian-hurd/2012/09/msg7.html), 
[xplc](http://lists.debian.org/debian-hurd/2012/08/msg00054.html) and 
[parrot](http://lists.debian.org/debian-hurd/2012/08/msg00056.html), 
[x86info](http://lists.debian.org/debian-hurd/2012/09/msg8.html), 
[atlas](http://lists.debian.org/debian-hurd/2012/09/msg9.html), 
[rrdtool](http://lists.debian.org/debian-hurd/2012/09/msg00011.html) and 
[gdb](http://lists.debian.org/debian-hurd/2012/09/msg00018.html). Also he fixed 
[yodl](http://lists.debian.org/debian-hurd/2012/08/msg00030.html), fixed 
[ntpdate](http://lists.debian.org/debian-hurd/2012/12/msg2.html) to work 
again and 
[improved](http://lists.gnu.org/archive/html/bug-hurd/2012-11/msg00062.html) 
the error handling in pflocal. *Pino Toscano* added patches for 
[procfs](http://lists.gnu.org/archive/html/bug-hurd/2012-09/msg4.html),  
[ptrace](http://lists.gnu.org/archive/html/bug-hurd/2012-10/msg00035.html), 
[fsync on 
stdout](http://lists.gnu.org/archive/html/bug-hurd/2012-10/msg00046.html), 
[muntrace](http://lists.gnu.org/archive/html/bug-hurd/2012-11/msg00033.html), 
[ulimit](http://lists.gnu.org/archive/html/bug-hurd/2012-11/msg00034.html), 
[glibc](http://lists.gnu.org/archive/html/bug-hurd/2012-11/msg00029.html) which 
among others improve POSIX conformance, making it easier to write programs 
which work on the Hurd and GNU/Linux. And he made the test pass for [FIFO 
sockets](http://lists.gnu.org/archive/html/bug-hurd/2012-09/msg00053.html) with 
mknod and 
[added](http://lists.gnu.org/archive/html/bug-hurd/2012-09/msg5.html) a 
size parameter to tmpfs for easier usage in scripts and a [version suffix 
option](http://lists.gnu.org/archive/html/bug-hurd/2012-10/msg9.html) for 
gnumach configure. *Cyril Roelandt* fixed a 
[ps](http://lists.gnu.org/archive/html/bug-hurd/2012-12/msg00012.html) bug, a 
documentation typo [in 
ps](http://lists.gnu.org/archive/html/bug-hurd/2012-1

Re: [patch] for mig check in GDB's configure

2013-05-04 Thread Yue Lu
Hi!

thanks for your review.

On Fri, May 3, 2013 at 8:57 PM, Ivan Shmakov  wrote:
> A few minor points.
>

I have update this patch after your feedback.

>From b50f9b2f9ab1792ad584d07c9d2da3c5857d82fe Mon Sep 17 00:00:00 2001
From: hacklu 
Date: Sat, 4 May 2013 16:17:25 +0800
Subject: [PATCH] Ensure MIG is available On GNU Hurd

* configure.ac: Ensure MIG is available when building for GNU
* Hurd.
* configure: Regenerate.
---
 gdb/ChangeLog|5 +
 gdb/configure.ac |   11 +--
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 12254b7..4fa69ac 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2013-05-04  Yue Lu  
+
+   * configure.ac: Ensure MIG is available when building for GNU Hurd.
+   * configure: Regenerate.
+
 2013-04-30  Samuel Thibault  

* i386gnu-nat.c (CREG_OFFSET): New macro.
diff --git a/gdb/configure.ac b/gdb/configure.ac
index bb7fbdd..29c68b4 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -486,8 +486,15 @@ AC_CHECK_TOOL(AR, ar)
 AC_CHECK_TOOL(DLLTOOL, dlltool)
 AC_CHECK_TOOL(WINDRES, windres)

-# Needed for GNU/Hurd.
-AC_CHECK_TOOL(MIG, mig)
+case $host_os in
+  gnu* )
+# Needed for GNU/Hurd.
+AC_CHECK_TOOL(MIG, mig)
+if test "$MIG" = "" ; then
+  AC_MSG_ERROR([MIG not found but required for $host])
+fi
+;;
+esac

 # -- #
 # Checks for libraries.  #
--
1.7.0.4


-- 
Yue Lu (陆岳)



Re: [patch] for mig check in GDB's configure

2013-05-04 Thread Yue Lu
Hi,

On Fri, May 3, 2013 at 11:22 PM, Pino Toscano  wrote:
> Hi,
>
> instead of the above, what about something like this:
>   case "${host_os}" in
> gnu*)
>   # Needed for GNU/Hurd.
>   AC_CHECK_TOOL(MIG, mig)
>   if test "$MIG" = "" ; then
> AC_MSG_ERROR([no mig for use])
>   fi
> ;;
>   esac
>
> that is, look for mig as mandatory only on Hurd, using a less-ambiguous
> variable as $host_os.

I almost agree with you, the $host_os is much better than $host.
in hurd it just says gnu0.3.  we needn't to check for linux which says linux-gnu




-- 
Yue Lu (陆岳)