From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27514 invoked by alias); 23 May 2013 16:36:19 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 27499 invoked by uid 89); 23 May 2013 16:36:17 -0000 X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,SPF_PASS,TW_XS autolearn=ham version=3.3.1 Received: from mail-la0-f54.google.com (HELO mail-la0-f54.google.com) (209.85.215.54) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 23 May 2013 16:36:11 +0000 Received: by mail-la0-f54.google.com with SMTP id eg20so3412910lab.41 for ; Thu, 23 May 2013 09:36:09 -0700 (PDT) X-Received: by 10.112.138.42 with SMTP id qn10mr6815204lbb.70.1369326969229; Thu, 23 May 2013 09:36:09 -0700 (PDT) Received: from [130.237.20.66] (s1499.it.kth.se. [130.237.20.66]) by mx.google.com with ESMTPSA id e3sm5033722lbf.17.2013.05.23.09.36.07 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Thu, 23 May 2013 09:36:08 -0700 (PDT) Message-ID: <1369326967.8127.33.camel@s1499.it.kth.se> Subject: Small patch to enable build of gdb-7.6 for GNU/Hurd From: Svante Signell To: gdb-patches@sourceware.org Date: Thu, 23 May 2013 16:36:00 -0000 Content-Type: multipart/mixed; boundary="=-5uR8KxSPKOEn+e53VmZc" Mime-Version: 1.0 X-Virus-Found: No X-SW-Source: 2013-05/txt/msg00878.txt.bz2 --=-5uR8KxSPKOEn+e53VmZc Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Content-length: 763 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 --=-5uR8KxSPKOEn+e53VmZc Content-Disposition: attachment; filename="solve_PATH_MAX_issue.patch" Content-Type: text/x-patch; name="solve_PATH_MAX_issue.patch"; charset="UTF-8" Content-Transfer-Encoding: 7bit Content-length: 1128 --- 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); } --=-5uR8KxSPKOEn+e53VmZc--