From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 58708 invoked by alias); 10 Sep 2018 17:12:15 -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 58617 invoked by uid 89); 10 Sep 2018 17:12:14 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.4 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=2099, worst, our X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 10 Sep 2018 17:12:13 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9734244B51 for ; Mon, 10 Sep 2018 17:12:11 +0000 (UTC) Received: from psique.yyz.redhat.com (unused-10-15-17-196.yyz.redhat.com [10.15.17.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id 65CAF63F2C; Mon, 10 Sep 2018 17:12:11 +0000 (UTC) From: Sergio Durigan Junior To: GDB Patches Cc: Sergio Durigan Junior Subject: [PATCH 2/2] Fix PR gdb/23558: Use system's 'getcwd' when cross-compiling GDB Date: Mon, 10 Sep 2018 17:12:00 -0000 Message-Id: <20180910171205.18594-3-sergiodj@redhat.com> In-Reply-To: <20180910171205.18594-1-sergiodj@redhat.com> References: <20180910171205.18594-1-sergiodj@redhat.com> X-IsSubscribed: yes X-SW-Source: 2018-09/txt/msg00280.txt.bz2 This is a backport of a gnulib fix for the following bug: https://sourceware.org/bugzilla/show_bug.cgi?id=23558 The problem reported there is about the replacement of 'getcwd' when cross-compiling GDB. With our current gnulib copy, the mechanism for deciding whether to use the system's 'getcwd' or gnulib's version is too simplistic and pessimistic, so when cross-compiling we always end up using gnulib's version, which has a limitation: it cannot handle the situation when the parent directory doesn't have read permissions. The solution is to backport the following gnulib commit: commit a96d2e67052c879b1bcc5bc461722beac75fc372 Author: Bruno Haible Date: Thu Aug 23 21:13:19 2018 +0200 getcwd: Add cross-compilation guesses. gdb/ChangeLog: 2018-09-03 Sergio Durigan Junior PR gdb/23555 PR gdb/23558 * gnulib/import/m4/getcwd-path-max.m4: Add cross-compilation guesses. --- gdb/ChangeLog | 7 +++++++ gdb/gnulib/import/m4/getcwd-path-max.m4 | 20 ++++++++++++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index fdeaf8a302..aaa4590ae6 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2018-09-10 Sergio Durigan Junior + + PR gdb/23555 + PR gdb/23558 + * gnulib/import/m4/getcwd-path-max.m4: Add cross-compilation + guesses. + 2018-09-10 Sergio Durigan Junior Revert: diff --git a/gdb/gnulib/import/m4/getcwd-path-max.m4 b/gdb/gnulib/import/m4/getcwd-path-max.m4 index 2531ccff65..90bbc77dea 100644 --- a/gdb/gnulib/import/m4/getcwd-path-max.m4 +++ b/gdb/gnulib/import/m4/getcwd-path-max.m4 @@ -209,9 +209,21 @@ main () 32) gl_cv_func_getcwd_path_max='yes, but with shorter paths';; *) gl_cv_func_getcwd_path_max=no;; esac], - [case "$host_os" in - aix*) gl_cv_func_getcwd_path_max='no, it has the AIX bug';; - *) gl_cv_func_getcwd_path_max=no;; - esac]) + [# Cross-compilation guesses: + case "$host_os" in + aix*) # On AIX, it has the AIX bug. + gl_cv_func_getcwd_path_max='no, it has the AIX bug' ;; + gnu*) # On Hurd, it is 'yes'. + gl_cv_func_getcwd_path_max=yes ;; + linux* | kfreebsd*) + # On older Linux+glibc it's 'no, but it is partly working', + # on newer Linux+glibc it's 'yes'. + # On Linux+musl libc, it's 'no, but it is partly working'. + # On kFreeBSD+glibc, it's 'no, but it is partly working'. + gl_cv_func_getcwd_path_max='no, but it is partly working' ;; + *) # If we don't know, assume the worst. + gl_cv_func_getcwd_path_max=no ;; + esac + ]) ]) ]) -- 2.17.1