public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Unbreak build on hurd
@ 2014-02-07  8:01 Yao Qi
  2014-02-07  8:01 ` [PATCH 3/3] Find and link with -lmachuser -lhurduser Yao Qi
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Yao Qi @ 2014-02-07  8:01 UTC (permalink / raw)
  To: gdb-patches

When I rebuild GDB with my target_xfer_status patch series on hurd,
I find there are some existing build errors.  This patch series is
to fix them.

*** BLURB HERE ***

Yao Qi (3):
  Fix -Wformat warnings in gnu-nat.c
  Fix -Werror=pointer-sign warnings
  Find and link with -lmachuser -lhurduser

 gdb/configure    |  114 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 gdb/configure.ac |    4 ++
 gdb/gnu-nat.c    |   34 ++++++++--------
 3 files changed, 135 insertions(+), 17 deletions(-)

-- 
1.7.7.6

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

* [PATCH 3/3] Find and link with -lmachuser -lhurduser
  2014-02-07  8:01 [PATCH 0/3] Unbreak build on hurd Yao Qi
@ 2014-02-07  8:01 ` Yao Qi
  2014-02-16  7:49   ` Thomas Schwinge
  2014-02-07  8:01 ` [PATCH 2/3] Fix -Werror=pointer-sign warnings Yao Qi
  2014-02-07  8:01 ` [PATCH 1/3 OBV] Fix -Wformat warnings in gnu-nat.c Yao Qi
  2 siblings, 1 reply; 12+ messages in thread
From: Yao Qi @ 2014-02-07  8:01 UTC (permalink / raw)
  To: gdb-patches

I see this link error when build native gdb for hurd.

/home/yao/Software/hurd-toolchain/bin/../lib/gcc/i686-pc-gnu/4.8.0/../../../../i686-pc-gnu/bin/ld: gnu-nat.o: undefined reference to symbol 'mach_port_destroy'
/home/yao/Software/hurd-toolchain/bin/../lib/gcc/i686-pc-gnu/4.8.0/../../../../i686-pc-gnu/bin/ld: note: 'mach_port_destroy' is defined in DSO
/home/yao/Software/hurd-toolchain/bin/../i686-pc-gnu/libc/lib/libmachuser.so.1 so try adding it to the linker command line
/home/yao/Software/hurd-toolchain/bin/../i686-pc-gnu/libc/lib/libmachuser.so.1:
could not read symbols: Invalid operation

This patch is to find and link GDB with -lmachuser and -lhurduser.

I find my patch is quite similar to another patch posted here
https://lists.debian.org/debian-hurd/2011/03/msg00198.html
in which, it mentioned that this change "will not be needed in next
version of libc0.3".  However, I don't know much about hurd, and post
the patch for review, because it fixes the build failure after all.

gdb:

2014-02-07  Yao Qi  <yao@codesourcery.com>

	* configure.ac: Invoke AC_SEARCH_LIBS to search libmachuser and
	libhurduser.
	* configure: Regenerated.
---
 gdb/configure    |  114 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 gdb/configure.ac |    4 ++
 2 files changed, 118 insertions(+), 0 deletions(-)

diff --git a/gdb/configure b/gdb/configure
index 8ae2e09..c4340b7 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -6711,6 +6711,120 @@ if test "$ac_res" != no; then :
 fi
 
 
+# On GNU/Hurd we may need libmachuser and libhurduser (used by gnu-nat.c).
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing mach_port_destroy" >&5
+$as_echo_n "checking for library containing mach_port_destroy... " >&6; }
+if test "${ac_cv_search_mach_port_destroy+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char mach_port_destroy ();
+int
+main ()
+{
+return mach_port_destroy ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' machuser; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_mach_port_destroy=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if test "${ac_cv_search_mach_port_destroy+set}" = set; then :
+  break
+fi
+done
+if test "${ac_cv_search_mach_port_destroy+set}" = set; then :
+
+else
+  ac_cv_search_mach_port_destroy=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_mach_port_destroy" >&5
+$as_echo "$ac_cv_search_mach_port_destroy" >&6; }
+ac_res=$ac_cv_search_mach_port_destroy
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing proc_getmsgport" >&5
+$as_echo_n "checking for library containing proc_getmsgport... " >&6; }
+if test "${ac_cv_search_proc_getmsgport+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char proc_getmsgport ();
+int
+main ()
+{
+return proc_getmsgport ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' hurduser; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_proc_getmsgport=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if test "${ac_cv_search_proc_getmsgport+set}" = set; then :
+  break
+fi
+done
+if test "${ac_cv_search_proc_getmsgport+set}" = set; then :
+
+else
+  ac_cv_search_proc_getmsgport=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_proc_getmsgport" >&5
+$as_echo "$ac_cv_search_proc_getmsgport" >&6; }
+ac_res=$ac_cv_search_proc_getmsgport
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+fi
+
+
 
 
 
diff --git a/gdb/configure.ac b/gdb/configure.ac
index feb28f3..52aebf5 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -521,6 +521,10 @@ AM_ZLIB
 # On HP/UX we may need libxpdl for dlgetmodinfo (used by solib-pa64.c).
 AC_SEARCH_LIBS(dlgetmodinfo, [dl xpdl])
 
+# On GNU/Hurd we may need libmachuser and libhurduser (used by gnu-nat.c).
+AC_SEARCH_LIBS(mach_port_destroy, machuser)
+AC_SEARCH_LIBS(proc_getmsgport, hurduser)
+
 AM_ICONV
 
 # GDB may fork/exec the iconv program to get the list of supported character
-- 
1.7.7.6

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

* [PATCH 2/3] Fix -Werror=pointer-sign warnings
  2014-02-07  8:01 [PATCH 0/3] Unbreak build on hurd Yao Qi
  2014-02-07  8:01 ` [PATCH 3/3] Find and link with -lmachuser -lhurduser Yao Qi
@ 2014-02-07  8:01 ` Yao Qi
  2014-02-07 11:42   ` Joel Brobecker
  2014-02-16  7:39   ` Thomas Schwinge
  2014-02-07  8:01 ` [PATCH 1/3 OBV] Fix -Wformat warnings in gnu-nat.c Yao Qi
  2 siblings, 2 replies; 12+ messages in thread
From: Yao Qi @ 2014-02-07  8:01 UTC (permalink / raw)
  To: gdb-patches

../../../git/gdb/gnu-nat.c: In function 'gnu_read_inferior':
../../../git/gdb/gnu-nat.c:2282:3: error: pointer targets in passing argument 5 of 'vm_read' differ in signedness [-Werror=pointer-sign]
In file included from /home/yao/Software/hurd-toolchain/bin/../i686-pc-gnu/libc/usr/include/mach.h:38:0,
                 from ./nm.h:23,
                 from ../../../git/gdb/defs.h:500,
                 from ../../../git/gdb/gnu-nat.c:23:
/home/yao/Software/hurd-toolchain/bin/../i686-pc-gnu/libc/usr/include/mach/mach_interface.h:843:15: note: expected 'mach_msg_type_number_t *' but argument is of type 'int *'
../../../git/gdb/gnu-nat.c: In function 'gnu_write_inferior':
../../../git/gdb/gnu-nat.c:2339:4: error: pointer targets in passing argument 5 of 'vm_read' differ in signedness [-Werror=pointer-sign]
In file included from /home/yao/Software/hurd-toolchain/bin/../i686-pc-gnu/libc/usr/include/mach.h:38:0,
                 from ./nm.h:23,
                 from ../../../git/gdb/defs.h:500,
                 from ../../../git/gdb/gnu-nat.c:23:
/home/yao/Software/hurd-toolchain/bin/../i686-pc-gnu/libc/usr/include/mach/mach_interface.h:843:15: note: expected 'mach_msg_type_number_t *' but argument is of type 'int *'

This patch fixes these warnings.

gdb:

2014-02-07  Yao Qi  <yao@codesourcery.com>

	* gnu-nat.c (gnu_read_inferior): Change 'copy_count' type to
	mach_msg_type_number_t.
	(gnu_write_inferior): Likewise.
---
 gdb/gnu-nat.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
index 6e65446..d5ce416 100644
--- a/gdb/gnu-nat.c
+++ b/gdb/gnu-nat.c
@@ -2276,7 +2276,7 @@ gnu_read_inferior (task_t task, CORE_ADDR addr, gdb_byte *myaddr, int length)
   vm_size_t aligned_length =
   (vm_size_t) round_page (addr + length) - low_address;
   pointer_t copied;
-  int copy_count;
+  mach_msg_type_number_t copy_count;
 
   /* Get memory from inferior with page aligned addresses.  */
   err = vm_read (task, low_address, aligned_length, &copied, &copy_count);
@@ -2323,7 +2323,7 @@ gnu_write_inferior (task_t task, CORE_ADDR addr,
   vm_size_t aligned_length =
   (vm_size_t) round_page (addr + length) - low_address;
   pointer_t copied;
-  int copy_count;
+  mach_msg_type_number_t copy_count;
   int deallocate = 0;
 
   char *errstr = "Bug in gnu_write_inferior";
-- 
1.7.7.6

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

* [PATCH 1/3 OBV] Fix -Wformat warnings in gnu-nat.c
  2014-02-07  8:01 [PATCH 0/3] Unbreak build on hurd Yao Qi
  2014-02-07  8:01 ` [PATCH 3/3] Find and link with -lmachuser -lhurduser Yao Qi
  2014-02-07  8:01 ` [PATCH 2/3] Fix -Werror=pointer-sign warnings Yao Qi
@ 2014-02-07  8:01 ` Yao Qi
  2014-02-16  7:38   ` Thomas Schwinge
  2 siblings, 1 reply; 12+ messages in thread
From: Yao Qi @ 2014-02-07  8:01 UTC (permalink / raw)
  To: gdb-patches

I've seen some -Wformat warnings when build native gdb for hurd.

../../../git/gdb/gnu-nat.c:2384:8: error: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'vm_address_t' [-Werror=format]
../../../git/gdb/gnu-nat.c:2394:8: error: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'vm_address_t' [-Werror=format]
../../../git/gdb/gnu-nat.c: In function 'steal_exc_port':
../../../git/gdb/gnu-nat.c:2898:5: error: format '%d' expects argument of type 'int', but argument 2 has type 'mach_port_t' [-Werror=format]

in usr/include/mach/port.h, we have:

typedef vm_offset_t mach_port_t;

and in usr/include/mach/machine/vm_types.h, we have:

typedef       unsigned long   vm_offset_t;

so this patch changes '%d' to '%lu' in format string for mach_port_t
variables.

Similarly, in usr/include/mach/std_types.h, we have,

typedef      vm_offset_t     vm_address_t;

this patch also changes '%x' to '%lx' in gnu_write_inferior.

Note that the doc mentions that mach_port_t is an unsigned int
http://www.gnu.org/software/hurd/gnumach-doc/Message-Format.html
but I get the patch aligned with the header files instead of the
doc.

gdb:

2014-02-07  Yao Qi  <yao@codesourcery.com>

	* gnu-nat.c (proc_get_exception_port): Use 'lu' insetad of 'd'
	in format string.
	(proc_steal_exc_port, make_proc, inf_set_pid): Likewise.
	(inf_validate_procs, inf_signal): Likewise.
	(S_exception_raise_request): Likewise.
	(do_mach_notify_dead_name): Likewise.
	(steal_exc_port): Likewise.
	(gnu_read_inferior): Change 'copy_count''s type to
	mach_msg_type_number_t.
	(gnu_write_inferior): Likewise.  Use 'lx' instead of 'x' in
	format string.
---
 gdb/gnu-nat.c |   30 +++++++++++++++---------------
 1 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
index efafc35..6e65446 100644
--- a/gdb/gnu-nat.c
+++ b/gdb/gnu-nat.c
@@ -404,7 +404,7 @@ proc_get_exception_port (struct proc * proc, mach_port_t * port)
 error_t
 proc_set_exception_port (struct proc * proc, mach_port_t port)
 {
-  proc_debug (proc, "setting exception port: %d", port);
+  proc_debug (proc, "setting exception port: %lu", port);
   if (proc_is_task (proc))
     return task_set_exception_port (proc->port, port);
   else
@@ -444,7 +444,7 @@ proc_steal_exc_port (struct proc *proc, mach_port_t exc_port)
     {
       error_t err = 0;
 
-      proc_debug (proc, "inserting exception port: %d", exc_port);
+      proc_debug (proc, "inserting exception port: %lu", exc_port);
 
       if (cur_exc_port != exc_port)
 	/* Put in our exception port.  */
@@ -465,7 +465,7 @@ proc_steal_exc_port (struct proc *proc, mach_port_t exc_port)
 	  proc->saved_exc_port = cur_exc_port;
 	}
 
-      proc_debug (proc, "saved exception port: %d", proc->saved_exc_port);
+      proc_debug (proc, "saved exception port: %lu", proc->saved_exc_port);
 
       if (!err)
 	proc->exc_port = exc_port;
@@ -577,11 +577,11 @@ make_proc (struct inf *inf, mach_port_t port, int tid)
 				    MACH_MSG_TYPE_MAKE_SEND_ONCE,
 				    &prev_port);
   if (err)
-    warning (_("Couldn't request notification for port %d: %s"),
+    warning (_("Couldn't request notification for port %lu: %s"),
 	     port, safe_strerror (err));
   else
     {
-      proc_debug (proc, "notifications to: %d", inf->event_port);
+      proc_debug (proc, "notifications to: %lu", inf->event_port);
       if (prev_port != MACH_PORT_NULL)
 	mach_port_deallocate (mach_task_self (), prev_port);
     }
@@ -756,7 +756,7 @@ inf_set_pid (struct inf *inf, pid_t pid)
 	       pid, safe_strerror (err));
     }
 
-  inf_debug (inf, "setting task: %d", task_port);
+  inf_debug (inf, "setting task: %lu", task_port);
 
   if (inf->pause_sc)
     task_suspend (task_port);
@@ -1080,7 +1080,7 @@ inf_validate_procs (struct inf *inf)
 	    else
 	      inf->threads = thread;
 	    last = thread;
-	    proc_debug (thread, "new thread: %d", threads[i]);
+	    proc_debug (thread, "new thread: %lu", threads[i]);
 
 	    ptid = ptid_build (inf->pid, thread->tid, 0);
 
@@ -1345,7 +1345,7 @@ inf_signal (struct inf *inf, enum gdb_signal sig)
 	  struct exc_state *e = &w->exc;
 
 	  inf_debug (inf, "passing through exception:"
-		     " task = %d, thread = %d, exc = %d"
+		     " task = %lu, thread = %lu, exc = %d"
 		     ", code = %d, subcode = %d",
 		     w->thread->port, inf->task->port,
 		     e->exception, e->code, e->subcode);
@@ -1664,7 +1664,7 @@ S_exception_raise_request (mach_port_t port, mach_port_t reply_port,
   struct proc *thread = inf_port_to_thread (inf, thread_port);
 
   inf_debug (waiting_inf,
-	     "thread = %d, task = %d, exc = %d, code = %d, subcode = %d",
+	     "thread = %lu, task = %lu, exc = %d, code = %d, subcode = %d",
 	     thread_port, task_port, exception, code, subcode);
 
   if (!thread)
@@ -1700,13 +1700,13 @@ S_exception_raise_request (mach_port_t port, mach_port_t reply_port,
 	{
 	  if (thread->exc_port == port)
 	    {
-	      inf_debug (waiting_inf, "Handler is thread exception port <%d>",
+	      inf_debug (waiting_inf, "Handler is thread exception port <%lu>",
 			 thread->saved_exc_port);
 	      inf->wait.exc.handler = thread->saved_exc_port;
 	    }
 	  else
 	    {
-	      inf_debug (waiting_inf, "Handler is task exception port <%d>",
+	      inf_debug (waiting_inf, "Handler is task exception port <%lu>",
 			 inf->task->saved_exc_port);
 	      inf->wait.exc.handler = inf->task->saved_exc_port;
 	      gdb_assert (inf->task->exc_port == port);
@@ -1757,7 +1757,7 @@ do_mach_notify_dead_name (mach_port_t notify, mach_port_t dead_port)
 {
   struct inf *inf = waiting_inf;
 
-  inf_debug (waiting_inf, "port = %d", dead_port);
+  inf_debug (waiting_inf, "port = %lu", dead_port);
 
   if (inf->task && inf->task->port == dead_port)
     {
@@ -2380,7 +2380,7 @@ gnu_write_inferior (task_t task, CORE_ADDR addr,
 	/* Check for holes in memory.  */
 	if (old_address != region_address)
 	  {
-	    warning (_("No memory at 0x%x. Nothing written"),
+	    warning (_("No memory at 0x%lx. Nothing written"),
 		     old_address);
 	    err = KERN_SUCCESS;
 	    length = 0;
@@ -2389,7 +2389,7 @@ gnu_write_inferior (task_t task, CORE_ADDR addr,
 
 	if (!(max_protection & VM_PROT_WRITE))
 	  {
-	    warning (_("Memory at address 0x%x is unwritable. "
+	    warning (_("Memory at address 0x%lx is unwritable. "
 		       "Nothing written"),
 		     old_address);
 	    err = KERN_SUCCESS;
@@ -2894,7 +2894,7 @@ steal_exc_port (struct proc *proc, mach_port_t name)
 				 name, MACH_MSG_TYPE_COPY_SEND,
 				 &port, &port_type);
   if (err)
-    error (_("Couldn't extract send right %d from inferior: %s"),
+    error (_("Couldn't extract send right %lu from inferior: %s"),
 	   name, safe_strerror (err));
 
   if (proc->saved_exc_port)
-- 
1.7.7.6

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

* Re: [PATCH 2/3] Fix -Werror=pointer-sign warnings
  2014-02-07  8:01 ` [PATCH 2/3] Fix -Werror=pointer-sign warnings Yao Qi
@ 2014-02-07 11:42   ` Joel Brobecker
  2014-02-16  7:39   ` Thomas Schwinge
  1 sibling, 0 replies; 12+ messages in thread
From: Joel Brobecker @ 2014-02-07 11:42 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

> 2014-02-07  Yao Qi  <yao@codesourcery.com>
> 
> 	* gnu-nat.c (gnu_read_inferior): Change 'copy_count' type to
> 	mach_msg_type_number_t.
> 	(gnu_write_inferior): Likewise.

You did not say obvious on this one, but it looks that way to me.
Anyways, looks good.

-- 
Joel

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

* Re: [PATCH 1/3 OBV] Fix -Wformat warnings in gnu-nat.c
  2014-02-07  8:01 ` [PATCH 1/3 OBV] Fix -Wformat warnings in gnu-nat.c Yao Qi
@ 2014-02-16  7:38   ` Thomas Schwinge
  2014-02-17  3:32     ` Yao Qi
  0 siblings, 1 reply; 12+ messages in thread
From: Thomas Schwinge @ 2014-02-16  7:38 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 758 bytes --]

Hi!

Thanks for the patch!

On Fri, 7 Feb 2014 15:59:16 +0800, Yao Qi <yao@codesourcery.com> wrote:
> 	* gnu-nat.c (proc_get_exception_port): Use 'lu' insetad of 'd'
> 	in format string.
> 	(proc_steal_exc_port, make_proc, inf_set_pid): Likewise.
> 	(inf_validate_procs, inf_signal): Likewise.
> 	(S_exception_raise_request): Likewise.
> 	(do_mach_notify_dead_name): Likewise.
> 	(steal_exc_port): Likewise.
> 	(gnu_read_inferior): Change 'copy_count''s type to
> 	mach_msg_type_number_t.
> 	(gnu_write_inferior): Likewise.  Use 'lx' instead of 'x' in
> 	format string.

The gnu_read_inferior and gnu_write_inferior copy_count type change notes
belong to your other patch; with that changed, please push this patch.


Grüße,
 Thomas

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

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

* Re: [PATCH 2/3] Fix -Werror=pointer-sign warnings
  2014-02-07  8:01 ` [PATCH 2/3] Fix -Werror=pointer-sign warnings Yao Qi
  2014-02-07 11:42   ` Joel Brobecker
@ 2014-02-16  7:39   ` Thomas Schwinge
  2014-02-17  3:32     ` Yao Qi
  1 sibling, 1 reply; 12+ messages in thread
From: Thomas Schwinge @ 2014-02-16  7:39 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 284 bytes --]

Hi!

Thanks for the patch!

On Fri, 7 Feb 2014 15:59:17 +0800, Yao Qi <yao@codesourcery.com> wrote:
> 	* gnu-nat.c (gnu_read_inferior): Change 'copy_count' type to
> 	mach_msg_type_number_t.
> 	(gnu_write_inferior): Likewise.

Please push this patch.


Grüße,
 Thomas

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

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

* Re: [PATCH 3/3] Find and link with -lmachuser -lhurduser
  2014-02-07  8:01 ` [PATCH 3/3] Find and link with -lmachuser -lhurduser Yao Qi
@ 2014-02-16  7:49   ` Thomas Schwinge
  2014-02-17  2:17     ` Yao Qi
  2014-02-25  5:10     ` Samuel Thibault
  0 siblings, 2 replies; 12+ messages in thread
From: Thomas Schwinge @ 2014-02-16  7:49 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches, bug-hurd

[-- Attachment #1: Type: text/plain, Size: 1476 bytes --]

Hi!

On Fri, 7 Feb 2014 15:59:18 +0800, Yao Qi <yao@codesourcery.com> wrote:
> I see this link error when build native gdb for hurd.
> 
> /home/yao/Software/hurd-toolchain/bin/../lib/gcc/i686-pc-gnu/4.8.0/../../../../i686-pc-gnu/bin/ld: gnu-nat.o: undefined reference to symbol 'mach_port_destroy'
> /home/yao/Software/hurd-toolchain/bin/../lib/gcc/i686-pc-gnu/4.8.0/../../../../i686-pc-gnu/bin/ld: note: 'mach_port_destroy' is defined in DSO
> /home/yao/Software/hurd-toolchain/bin/../i686-pc-gnu/libc/lib/libmachuser.so.1 so try adding it to the linker command line
> /home/yao/Software/hurd-toolchain/bin/../i686-pc-gnu/libc/lib/libmachuser.so.1:
> could not read symbols: Invalid operation
> 
> This patch is to find and link GDB with -lmachuser and -lhurduser.

> 	* configure.ac: Invoke AC_SEARCH_LIBS to search libmachuser and
> 	libhurduser.

This should (currently) not be needed, for these two libraries are
(currently) considered to be part of libc.
(<http://www.gnu.org/software/hurd/open_issues/libmachuser_libhurduser_rpc_stubs.html>
and the thread starting at
<http://news.gmane.org/find-root.php?message_id=%3C20110329220143.GB5425%40const.famille.thibault.fr%3E>
have some discussion about this.)

Can you please post your toolchain's libc.so file (that is, the text file
of a few lines, not the binary libc.so.0.3).  Am I assuming correctly
that this is a i686-pc-gnu toolchain that I once provided you with?


Grüße,
 Thomas

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

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

* Re: [PATCH 3/3] Find and link with -lmachuser -lhurduser
  2014-02-16  7:49   ` Thomas Schwinge
@ 2014-02-17  2:17     ` Yao Qi
  2014-02-25  5:10     ` Samuel Thibault
  1 sibling, 0 replies; 12+ messages in thread
From: Yao Qi @ 2014-02-17  2:17 UTC (permalink / raw)
  To: Thomas Schwinge; +Cc: gdb-patches, bug-hurd

On 02/16/2014 03:49 PM, Thomas Schwinge wrote:
> This should (currently) not be needed, for these two libraries are
> (currently) considered to be part of libc.
> (<http://www.gnu.org/software/hurd/open_issues/libmachuser_libhurduser_rpc_stubs.html>
> and the thread starting at
> <http://news.gmane.org/find-root.php?message_id=%3C20110329220143.GB5425%40const.famille.thibault.fr%3E>
> have some discussion about this.)

That is to say, this problem doesn't exist with toolchain using recent
libc.  However, this link error still exists when an old toolchain is
used and it sounds unfeasible to upgrade libc to fix the link error.
Link -lmachuser and -lhurduser explicitly, as a fallback, is no harm.

I don't have a strong opinion on this patch.

> 
> Can you please post your toolchain's libc.so file (that is, the text file
> of a few lines, not the binary libc.so.0.3).  Am I assuming correctly

/* GNU ld script
   Use the shared library, but some functions are only in
   the static library, so try that secondarily.  */
OUTPUT_FORMAT(elf32-i386)
GROUP ( /lib/libc.so.0.3 /usr/lib/libcrt_nonshared.a  AS_NEEDED (
/lib/ld.so.1 ) )

> that this is a i686-pc-gnu toolchain that I once provided you with?

Yes.

-- 
Yao (齐尧)

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

* Re: [PATCH 1/3 OBV] Fix -Wformat warnings in gnu-nat.c
  2014-02-16  7:38   ` Thomas Schwinge
@ 2014-02-17  3:32     ` Yao Qi
  0 siblings, 0 replies; 12+ messages in thread
From: Yao Qi @ 2014-02-17  3:32 UTC (permalink / raw)
  To: Thomas Schwinge; +Cc: gdb-patches

On 02/16/2014 03:38 PM, Thomas Schwinge wrote:
> The gnu_read_inferior and gnu_write_inferior copy_count type change notes
> belong to your other patch; with that changed, please push this patch.

Thomas,
patch is pushed.

-- 
Yao (齐尧)

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

* Re: [PATCH 2/3] Fix -Werror=pointer-sign warnings
  2014-02-16  7:39   ` Thomas Schwinge
@ 2014-02-17  3:32     ` Yao Qi
  0 siblings, 0 replies; 12+ messages in thread
From: Yao Qi @ 2014-02-17  3:32 UTC (permalink / raw)
  To: Thomas Schwinge; +Cc: gdb-patches

On 02/16/2014 03:39 PM, Thomas Schwinge wrote:
> Please push this patch.

Patch is pushed.

-- 
Yao (齐尧)

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

* Re: [PATCH 3/3] Find and link with -lmachuser -lhurduser
  2014-02-16  7:49   ` Thomas Schwinge
  2014-02-17  2:17     ` Yao Qi
@ 2014-02-25  5:10     ` Samuel Thibault
  1 sibling, 0 replies; 12+ messages in thread
From: Samuel Thibault @ 2014-02-25  5:10 UTC (permalink / raw)
  To: Thomas Schwinge; +Cc: Yao Qi, bug-hurd, gdb-patches

Thomas Schwinge, le Sun 16 Feb 2014 08:49:13 +0100, a écrit :
> > 	* configure.ac: Invoke AC_SEARCH_LIBS to search libmachuser and
> > 	libhurduser.
> 
> This should (currently) not be needed, for these two libraries are
> (currently) considered to be part of libc.

So, let's maybe settle down?  AIUI, only Xorg and gdb make use of it?
We can easily push adding the link flags on both, and that'd make the
link less odd?

Samuel

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

end of thread, other threads:[~2014-02-25  5:10 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-07  8:01 [PATCH 0/3] Unbreak build on hurd Yao Qi
2014-02-07  8:01 ` [PATCH 3/3] Find and link with -lmachuser -lhurduser Yao Qi
2014-02-16  7:49   ` Thomas Schwinge
2014-02-17  2:17     ` Yao Qi
2014-02-25  5:10     ` Samuel Thibault
2014-02-07  8:01 ` [PATCH 2/3] Fix -Werror=pointer-sign warnings Yao Qi
2014-02-07 11:42   ` Joel Brobecker
2014-02-16  7:39   ` Thomas Schwinge
2014-02-17  3:32     ` Yao Qi
2014-02-07  8:01 ` [PATCH 1/3 OBV] Fix -Wformat warnings in gnu-nat.c Yao Qi
2014-02-16  7:38   ` Thomas Schwinge
2014-02-17  3:32     ` 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).