From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7288 invoked by alias); 11 Jun 2012 04:25:43 -0000 Received: (qmail 7272 invoked by uid 22791); 11 Jun 2012 04:25:40 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,TW_BJ X-Spam-Check-By: sourceware.org Received: from mail-pz0-f41.google.com (HELO mail-pz0-f41.google.com) (209.85.210.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 11 Jun 2012 04:25:27 +0000 Received: by dakp5 with SMTP id p5so5301307dak.0 for ; Sun, 10 Jun 2012 21:25:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding:x-gm-message-state; bh=+GaMISd2JYWbCAf24wLIXDOjo35RWAjBxMOuoVjib5U=; b=FFeww43I7LFPHmGET0lzjlmLdx7b4X6xoR+MIehG2oXdofnbOBUeAIN8+ttEPP/nCJ DFofKl0Mwr5jLlQvoyQJyWe/ExkfbBp9rPzAGNhNmpUHoYghvDvsSorWx5+X8g59/jid Vvx7ede6AGWFT7VkwtTicJKy/osl0+49PXBnnGjo8cyxjgzRlGeCy/DaBVshKpv2Ujvv DHkzzOpq8yBXaF1JmWzV1clZ6TPK3xtpYNjIVyZnOt/VFhIEd4HP30a3gZS9NGZX2XQn HnXLLgNYx7EugFBK44lnE1z/v4E/RTxTwAMkJZ3bcOPSe9/DdEibwzL2Bi2q75Wie5h/ kwoQ== 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 04:25:00 -0000 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 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQlsQnGfQCqGP7hKT+FjRhOXpVO/gXB2xjl1kIeNp9cY1oy/kPDUdQbox3K+ORjO7slh4Nwi X-IsSubscribed: yes 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 X-SW-Source: 2012-06/txt/msg00267.txt.bz2 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;