Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Small patch to enable build of gdb-7.6 for GNU/Hurd
@ 2013-05-23 16:36 Svante Signell
  2013-05-23 17:08 ` Tom Tromey
  2013-05-24  2:59 ` Sergio Durigan Junior
  0 siblings, 2 replies; 24+ messages in thread
From: Svante Signell @ 2013-05-23 16:36 UTC (permalink / raw)
  To: gdb-patches

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

Hello,

Since gdb 7.4.1 a PATH_MAX usage was introduced in the file
gdb/nto-tdep.c:nto_init_solib_absolute_prefix(). This function is only
called in gdb/nto-procfs.c. This file is QNX Neutrino specific and is
not compiled for Hurd (while nto-tdep.c, also QNX-specific is).

The attached patch solve_PATH_MAX_issue.patch fixes the FTBFS for
GNU/Hurd. Alternately the build should be changed to exclude compilation
of nto-tdep.c for non-QNX architectures. The compilation of various
targets specific code is enabled by --enable-targets=all in
the .../gdb/Makefile ALL_TARGET_OBS variable. This seems to be common of
builds for all architectures in Debian.

In case you need feedback from me use Cc: since I'm not subscribed to
gdb-patches.

Thanks,
Svante Signell


[-- Attachment #2: solve_PATH_MAX_issue.patch --]
[-- Type: text/x-patch, Size: 1128 bytes --]

--- a/gdb/nto-tdep.c	2013-05-23 14:28:24.000000000 +0000
+++ b/gdb/nto-tdep.c	2013-05-23 15:01:24.000000000 +0000
@@ -147,9 +147,11 @@ nto_find_and_open_solib (char *solib, un
 void
 nto_init_solib_absolute_prefix (void)
 {
-  char buf[PATH_MAX * 2], arch_path[PATH_MAX];
+  char *buf, *arch_path;
   char *nto_root, *endian;
   const char *arch;
+  int arch_len, len;
+#define FMT "set solib-absolute-prefix %s"
 
   nto_root = nto_target ();
   if (strcmp (gdbarch_bfd_arch_info (target_gdbarch ())->arch_name, "i386") == 0)
@@ -172,9 +174,13 @@ nto_init_solib_absolute_prefix (void)
 	       == BFD_ENDIAN_BIG ? "be" : "le";
     }
 
-  xsnprintf (arch_path, sizeof (arch_path), "%s/%s%s", nto_root, arch, endian);
+  arch_len = strlen (nto_root) + 1 + strlen (arch) + strlen (endian) + 1;
+  arch_path = alloca (arch_len);
+  xsnprintf (arch_path, arch_len, "%s/%s%s", nto_root, arch, endian);
 
-  xsnprintf (buf, sizeof (buf), "set solib-absolute-prefix %s", arch_path);
+  len = strlen (FMT) - 2 + strlen (arch_path) + 1;
+  buf =  alloca (len);
+  xsnprintf (buf, len, FMT, arch_path);
   execute_command (buf, 0);
 }
 

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

end of thread, other threads:[~2013-05-29 12:49 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-23 16:36 Small patch to enable build of gdb-7.6 for GNU/Hurd Svante Signell
2013-05-23 17:08 ` Tom Tromey
2013-05-23 17:21   ` Svante Signell
2013-05-23 17:27     ` Tom Tromey
2013-05-23 17:54       ` Svante Signell
2013-05-24  3:01         ` Sergio Durigan Junior
2013-05-24  2:59 ` Sergio Durigan Junior
2013-05-24  4:27   ` Joel Brobecker
2013-05-24  8:53     ` Pedro Alves
2013-05-24  9:07       ` Svante Signell
2013-05-24  9:13         ` Sergio Durigan Junior
2013-05-27 11:41           ` Svante Signell
2013-05-27 12:10             ` Joel Brobecker
2013-05-27 12:21               ` Svante Signell
2013-05-27 13:48                 ` Svante Signell
2013-05-27 13:57                   ` Svante Signell
2013-05-27 14:31                     ` Joel Brobecker
2013-05-27 15:59                       ` Svante Signell
2013-05-29  9:26                         ` Joel Brobecker
2013-05-29 12:18                           ` Svante Signell
2013-05-27 16:03                       ` New patch: " Svante Signell
2013-05-29  9:42                         ` Joel Brobecker
2013-05-29 12:49                           ` Svante Signell
2013-05-27 14:55                   ` Thomas Schwinge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox