From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32241 invoked by alias); 11 Jun 2012 21:40:26 -0000 Received: (qmail 32225 invoked by uid 22791); 11 Jun 2012 21:40:25 -0000 X-SWARE-Spam-Status: No, hits=-3.1 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-wg0-f43.google.com (HELO mail-wg0-f43.google.com) (74.125.82.43) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 11 Jun 2012 21:40:13 +0000 Received: by wgbdr1 with SMTP id dr1so2923218wgb.12 for ; Mon, 11 Jun 2012 14:40:11 -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=YaGPAKSNlMWramHHxFGsTZsXgWtW+xGYtjeH/hBFR6c=; b=OTMaKi0FiM9KllxVkxPHIQn1k7xEvgwrmakUeEXPgLV8rPejwwMqBPkjHCTRK7ilJT sGuD89j9xz6JE0u+hHQMNanHmH08/sV0UbmLHGgkM1+o80ypWYSw3dJITcDQ7qCYLDrj ahX8VvJuWlgFQFLpiBDpEbowRPofPyGRGnpI77zKKTecUg1Q3d3Uwx6KRNiTVd6tOiAi id/ZZQxA8ffcvDDNrkCcmty3aKcLHWwXLcGFpF/AkxaBoeTz/vGcMAUGrHu8Z0+qafB8 Eob1hC7s6oZFqnnLzp+n9IYPEN26cN5AQR/7n7iSbjzop7ckHBpofJaLdf+We7yh+05H L1tA== Received: by 10.216.213.226 with SMTP id a76mr7291345wep.142.1339450811495; Mon, 11 Jun 2012 14:40:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.180.87.225 with HTTP; Mon, 11 Jun 2012 14:39:51 -0700 (PDT) In-Reply-To: <201206110818.q5B8ImK9025818@glazunov.sibelius.xs4all.nl> References: <4FD57332.6020309@linaro.org> <201206110559.q5B5xMmB012288@glazunov.sibelius.xs4all.nl> <201206110818.q5B8ImK9025818@glazunov.sibelius.xs4all.nl> From: Michael Hope Date: Mon, 11 Jun 2012 21:40: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: ALoCoQn6UVArRfkxdTsIlH3Vrj9qTSOKeAdJzBKvNrwFL3qK+mbgLdomDtr8I7qioDcHddVINfWJ 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/msg00320.txt.bz2 On 11 June 2012 20:18, Mark Kettenis wrote: >> From: Michael Hope >> Date: Mon, 11 Jun 2012 18:16:51 +1200 >> >> 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_WILLN= EED >> >> 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. > > I fear you're using a broken toolchain, because... > >> > 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. =A0I 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. > > Both posix_madvise(): > > http://www.linuxbase.org/navigator/browse/int_single.php?cmd=3Dlist-by-na= me&Iname=3Dposix_madvise&Ilibrary=3Dlibc > > and POSIX_MADV_WILLNEED: > > http://www.linuxbase.org/navigator/browse/headgroup.php?cmd=3Dlist-byhead= group&HGid=3D56 > > were added in LSB 3.2. I've dug a bit deeper and there seems to be a bug in the LSB 3.2 release. posix_madvise() was defined but the advice constants weren't added to the header files. See sys/mman.h in: http://ftp.linuxbase.org/pub/lsb/lsbdev/released-3.2.0/binary/amd64/lsb-bu= ild-base-3.2.2-1.x86_64.rpm Ubuntu ships with this version. I'll change our build system to use 4.1.3 in the 3.2 compatibility mode instead. Ta, -- Michael