From patchwork Sun Aug 30 10:46:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Knight X-Patchwork-Id: 513792 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id E003814029C for ; Thu, 3 Sep 2015 14:01:42 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 0B9D9924A8; Thu, 3 Sep 2015 04:01:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id czKLE1SUPt0O; Thu, 3 Sep 2015 04:01:38 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id EBAED92435; Thu, 3 Sep 2015 04:01:37 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id D15F71C2076 for ; Thu, 3 Sep 2015 04:01:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id CB41194F1A for ; Thu, 3 Sep 2015 04:01:36 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0El13S-wm2iK for ; Thu, 3 Sep 2015 04:01:36 +0000 (UTC) X-Greylist: delayed 00:05:15 by SQLgrey-1.7.6 Received: from BLU004-OMC2S11.hotmail.com (blu004-omc2s11.hotmail.com [65.55.111.86]) by hemlock.osuosl.org (Postfix) with ESMTPS id D980994F13 for ; Thu, 3 Sep 2015 04:01:35 +0000 (UTC) Received: from BLU436-SMTP96 ([65.55.111.72]) by BLU004-OMC2S11.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Wed, 2 Sep 2015 20:56:19 -0700 X-TMN: [RTbphcr+0GB66jBYMxQVymRLbxJDiElB] X-Originating-Email: [james.d.knight@live.com] Message-ID: From: James Knight To: buildroot@buildroot.org Date: Sun, 30 Aug 2015 06:46:21 -0400 X-Mailer: git-send-email 2.4.3 X-OriginalArrivalTime: 03 Sep 2015 03:56:18.0836 (UTC) FILETIME=[7D2CED40:01D0E5FC] MIME-Version: 1.0 Cc: James Knight Subject: [Buildroot] [PATCH 1/1] package/bash: indicate getcwd is malloc-supported X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" When Bash attempts to find the current working directory, it uses a C library call `getcwd` to resolve it. When cross-compiling, the configuration process cannot determine if the target system's C library can support an "unfixed" path length. Therefore, Bash will fallback to a size of `PATH_MAX` for determining the current working directory. When using OverlayFS (and possible other file systems), this becomes an issue since file paths can commonly exceed standard `PATH_MAX` length. This typically results in the following error appearing: error retrieving current directory: [...] Common C library `getcwd` calls can default to a higher limit (usually the system's page size). The current configurable C libraries (as of at least 2015.08) support a zero (0) size buffer length. Most use the system's page size; musl, being an exception, which defaults to `PATH_MAX` (as Bash was doing). Since these C libraries support allocating buffer space with a zero (0) provided size, the following configuration change allows Bash to support getting a larger-length'ed working directory on target's that support it. Signed-off-by: James Knight --- package/bash/bash.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/package/bash/bash.mk b/package/bash/bash.mk index 9865e19..97d7182 100644 --- a/package/bash/bash.mk +++ b/package/bash/bash.mk @@ -16,6 +16,7 @@ BASH_LICENSE_FILES = COPYING BASH_CONF_ENV += \ ac_cv_rl_prefix="$(STAGING_DIR)" \ ac_cv_rl_version="$(READLINE_VERSION)" \ + bash_cv_getcwd_malloc=yes \ bash_cv_job_control_missing=present \ bash_cv_sys_named_pipes=present \ bash_cv_func_sigsetjmp=present \