bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gdb: FTBFS on hurd-i386 (for review)


From: Svante Signell
Subject: Re: gdb: FTBFS on hurd-i386 (for review)
Date: Sat, 11 May 2013 12:03:24 +0200

Samuel,

as written in 
http://lists.debian.org/debian-hurd/2012/09/msg00018.html
replied to here gdb has a PATH_MAX issue in addition to the MACH issue.
See the second part of the patch below. This fix was not submitted as a
Debian bug, due to the freeze and lack of feedback. The MACH stuff is
already fixed upstream I assume.

Svante

On Wed, 2012-09-26 at 16:02 +0200, Svante Signell wrote:
> Source: gdb
> Version: 7.4.1-1.1
> Severity: important
> Tags: patch
> Usertags: hurd
> User: debian-hurd@lists.debian.org
> 
> Hello,
> 
> gdb does not build from source any longer since gdb-multiarch packages
> was enabled in 7.4.1-1. The build problems are due to two reasons:
> 
> First the reserved keyword MACH is defined in include/objcode/h8300.h
> causing problems since gcc defines it for GNU/Hurd. 
> 
> Secondly, there is a PATH_MAX issue in gdb/nto-tdep.c. alloca is used
> for the patch in function nto_init_solib_absolute_prefix(), as is
> already used in the previous function, nto_find_and_open_solib(), in the
> same source file. The patches are inlined below:
> 
> avoid_MACH_defined_by_gcc.patch:
> --- a/include/opcode/h8300.h    2010-04-15 12:26:09.000000000 +0200
> +++ b/include/opcode/h8300.h    2012-09-26 13:13:57.000000000 +0200
> @@ -25,6 +25,11 @@
>     If the nibble has value 15 or less than the representation is
> complete.
>     Otherwise, we record what it contains with several flags.  */
>  
> +/* Avoid problems under GNU/Hurd */
> +#ifdef MACH
> +#undef MACH
> +#endif
> +
>  typedef int op_type;
>  
>  enum h8_flags
> 
> solve_PATH_MAX_issue.patch:
> --- a/gdb/nto-tdep.c    2012-01-06 05:43:21.000000000 +0100
> +++ b/gdb/nto-tdep.c    2012-09-26 13:58:00.000000000 +0200
> @@ -147,9 +147,9 @@
>  void
>  nto_init_solib_absolute_prefix (void)
>  {
> -  char buf[PATH_MAX * 2], arch_path[PATH_MAX];
> -  char *nto_root, *endian;
> +  char *buf, *arch_path, *nto_root, *endian;
>    const char *arch;
> +#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 +172,11 @@
>                == BFD_ENDIAN_BIG ? "be" : "le";
>      }
>  
> +  arch_path = alloca (strlen(nto_root) + 1 + strlen(arch) +
> strlen(endian) + 1);
>    sprintf (arch_path, "%s/%s%s", nto_root, arch, endian);
>  
> -  sprintf (buf, "set solib-absolute-prefix %s", arch_path);
> +  buf =  alloca (strlen(FMT) + strlen(arch_path) + 1);
> +  sprintf (buf, FMT, arch_path);
>    execute_command (buf, 0);
>  }
> 
> 
> 
> 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]