From patchwork Mon Jun 11 04:25:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Hope X-Patchwork-Id: 9181 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id AB3F023E5A for ; Mon, 11 Jun 2012 04:25:29 +0000 (UTC) Received: from mail-ob0-f180.google.com (mail-ob0-f180.google.com [209.85.214.180]) by fiordland.canonical.com (Postfix) with ESMTP id 62655A18649 for ; Mon, 11 Jun 2012 04:25:29 +0000 (UTC) Received: by obbun3 with SMTP id un3so7064826obb.11 for ; Sun, 10 Jun 2012 21:25:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:message-id :date:from:user-agent:mime-version:to:cc:subject:content-type :content-transfer-encoding:x-gm-message-state; bh=+GaMISd2JYWbCAf24wLIXDOjo35RWAjBxMOuoVjib5U=; b=MN2aeSXTf7OXcz5QfNE8dbkEQGuEIUHeVIf5c7mrYJXbPtqVw3dZe0lyECBKmXIlN3 O1Av83X4aZjXwWvFR8h/frGpv+mOP15OaBlT3a0CpQgJ/nOCihkAORgxgznhXWEM1qxl uD0XVtKCGu7W4j1gJlWZlSXGy+i2OZqG0pvb1hxUar0eJ5YsY0riQChUo04x7/nEbqTd Pf7nMGKtJ0I8j5m0GrqGIMneVWRLH8uS9AX15tnNAF+k8ClI/MVybMxSmYvkibxRFHVb DVjWK+DPSa2oyj9UwkaXfZjF5tncWkPod0Lt6UShuEAmlLsPUOt9VmuVXgddLeaLy3Ry QhHw== Received: by 10.50.87.227 with SMTP id bb3mr5520072igb.57.1339388728585; Sun, 10 Jun 2012 21:25:28 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.24.148 with SMTP id v20csp74693ibb; Sun, 10 Jun 2012 21:25:27 -0700 (PDT) Received: by 10.68.212.65 with SMTP id ni1mr6311580pbc.79.1339388727513; Sun, 10 Jun 2012 21:25:27 -0700 (PDT) Received: from mail-pz0-f50.google.com (mail-pz0-f50.google.com [209.85.210.50]) by mx.google.com with ESMTPS id jy9si20814563pbc.220.2012.06.10.21.25.27 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 10 Jun 2012 21:25:27 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.210.50 is neither permitted nor denied by best guess record for domain of michael.hope@linaro.org) client-ip=209.85.210.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.50 is neither permitted nor denied by best guess record for domain of michael.hope@linaro.org) smtp.mail=michael.hope@linaro.org Received: by danh15 with SMTP id h15so5776739dan.37 for ; Sun, 10 Jun 2012 21:25:27 -0700 (PDT) Received: by 10.68.136.68 with SMTP id py4mr13323780pbb.151.1339388727021; Sun, 10 Jun 2012 21:25:27 -0700 (PDT) Received: from [192.168.1.31] (204.47.255.123.static.snap.net.nz. [123.255.47.204]) by mx.google.com with ESMTPS id oq8sm17055717pbb.23.2012.06.10.21.25.24 (version=SSLv3 cipher=OTHER); Sun, 10 Jun 2012 21:25:26 -0700 (PDT) Message-ID: <4FD57332.6020309@linaro.org> Date: Mon, 11 Jun 2012 16:25:22 +1200 From: Michael Hope User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: gdb-patches@sourceware.org CC: patches@linaro.org Subject: [PATCH] Check for POSIX_MADV_WILLNEED to support building against the LSB X-Gm-Message-State: ALoCoQkdvPR8KO2vgNWDLyphZLk8ibyryO7vpvMwyZXzCs9e4S87G7zX0P1sRl0TdUAfzmOt0GRn The Linux Standard Base APIs include posix_madvise() but don't define values for the 'advice' argument. Check to see if POSIX_MADV_WILLNEED is defined before using. OK for trunk? -- Michael 2012-06-11 Michael Hope * dwarf2read.c (dwarf2_read_section): Check for POSIX_MADV_WILLNEED. diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 589361e..91fab5a 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -1773,7 +1773,7 @@ dwarf2_read_section (struct objfile *objfile, struct dwarf2_section_info *info) if ((caddr_t)info->buffer != MAP_FAILED) { -#if HAVE_POSIX_MADVISE +#if HAVE_POSIX_MADVISE && defined(POSIX_MADV_WILLNEED) posix_madvise (info->map_addr, info->map_len, POSIX_MADV_WILLNEED); #endif return;