From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11830 invoked by alias); 11 Jun 2012 06:17:27 -0000 Received: (qmail 11821 invoked by uid 22791); 11 Jun 2012 06:17:26 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,TW_BJ X-Spam-Check-By: sourceware.org Received: from mail-wi0-f171.google.com (HELO mail-wi0-f171.google.com) (209.85.212.171) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 11 Jun 2012 06:17:13 +0000 Received: by wibhm14 with SMTP id hm14so1855863wib.12 for ; Sun, 10 Jun 2012 23:17:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding:x-gm-message-state; bh=IY8U6H6FCHBv1no6ofouqF07BVxpXWNY7H4z5dI3E4E=; b=caKqfShjyfFl5TS5YV1RIUTuci7LwgBSodCMMPLWPXMolVgidRY7CebPSSJxUELoUP FfdO7O8pbTQIIPuXJm7PE/KoCdmOoW5RqvwExODw9chVnCEcq/FuZmIqZsCvJbwx3N/N uUCzK1rqxcqIkjEjjTyXcJGAb23XkPq/xtli65njgA2ciyEdUcDxNegjEyO+ZeZ9k4sn vHOmEn5alNPl90YYcTJfD9WdObyMSPPDyD75GKcgCBmlxEGzaMHC7FFMaiZZy0K0PF6F jiOHysa4y1mKUIGvFN1qmysca/gDibqZALwwmc47/kUKRvpJhdT9CuUOZpVTvn6n1vPG qCdQ== Received: by 10.216.142.167 with SMTP id i39mr5468179wej.94.1339395432303; Sun, 10 Jun 2012 23:17:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.180.87.225 with HTTP; Sun, 10 Jun 2012 23:16:51 -0700 (PDT) In-Reply-To: <201206110559.q5B5xMmB012288@glazunov.sibelius.xs4all.nl> References: <4FD57332.6020309@linaro.org> <201206110559.q5B5xMmB012288@glazunov.sibelius.xs4all.nl> From: Michael Hope Date: Mon, 11 Jun 2012 06:17:00 -0000 Message-ID: Subject: Re: [PATCH] Check for POSIX_MADV_WILLNEED to support building against the LSB To: Mark Kettenis Cc: gdb-patches@sourceware.org, patches@linaro.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQkow/t5Mm5hAQxF0+gh+gFiy8buOS1gEv/zlNZqIlB7DD/1sHs7F7+yRaTeWKic+es+vHiM 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/msg00269.txt.bz2 On 11 June 2012 17:59, Mark Kettenis wrote: >> Date: Mon, 11 Jun 2012 16:25:22 +1200 >> From: Michael Hope >> >> The Linux Standard Base APIs include posix_madvise() but don't define >> values for the 'advice' argument. =A0Check to see if POSIX_MADV_WILLNEED >> is defined before using. > > What real-world problem does this fix? Being able to build GDB using the LSB tools so that you can make a binary release that works on any Linux distro from RHEL4 and above. We use it for the linaro-toolchain-binaries. > It makes no sense to have > posix_madvise() but not define any values for the 'advice' argument. > I'd say this is a "bug" in LSB. =A0Either they should drop > posix_madvise() from the standard, or include at least the 'advice' > values required by POSIX. The LSB has a policy of not dropping functions. I can suggest that they add the advise values for a later version but that will take some time and won't cover existing LSB releases. I could change this to a configure test similar to HAS_MADVISE but it's bad practice to separate the check from the use. -- Michael >> 2012-06-11 =A0Michael Hope =A0 >> >> =A0 =A0 =A0 * dwarf2read.c (dwarf2_read_section): Check for >> =A0 =A0 =A0 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, stru= ct dwarf2_section_info *info) >> >> =A0 =A0 =A0 =A0 if ((caddr_t)info->buffer !=3D MAP_FAILED) >> =A0 =A0 =A0 =A0 =A0{ >> -#if HAVE_POSIX_MADVISE >> +#if HAVE_POSIX_MADVISE && defined(POSIX_MADV_WILLNEED) >> =A0 =A0 =A0 =A0 =A0 =A0posix_madvise (info->map_addr, info->map_len, POS= IX_MADV_WILLNEED); >> =A0 #endif >> =A0 =A0 =A0 =A0 =A0 =A0return; >>