From patchwork Mon Oct 17 17:29:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Kleen X-Patchwork-Id: 120272 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 8B8C5B70BC for ; Tue, 18 Oct 2011 04:30:18 +1100 (EST) Received: (qmail 17046 invoked by alias); 17 Oct 2011 17:30:17 -0000 Received: (qmail 17034 invoked by uid 22791); 17 Oct 2011 17:30:15 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from one.firstfloor.org (HELO one.firstfloor.org) (213.235.205.2) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 17 Oct 2011 17:29:59 +0000 Received: by one.firstfloor.org (Postfix, from userid 503) id 80F521A9808B; Mon, 17 Oct 2011 19:29:57 +0200 (CEST) Date: Mon, 17 Oct 2011 19:29:57 +0200 From: Andi Kleen To: gcc-patches@gcc.gnu.org Cc: ktietz@redhat.com Subject: [PATCH] Handle USING_MADVISE without USING_MMAP Message-ID: <20111017172957.GD15908@one.firstfloor.org> Mime-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.4.2.2i Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org I plan to check in the following patch as obvious after it passed testing. cygwin has a MADV_DONTNEED, but does not use mmap. The ifdefs for madvise assumed this wouldn't happen and it broke the cygwin build. Just don't set USING_MADVISE when USING_MMAP is not set. Thanks to Kai Titz for testing. -Andi 2011-10-17 Andi Kleen * ggc-page.c (USING_MADVISE): Adjust ifdef to check for USING_MMAP. diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c index 9b35291..2da99db 100644 --- a/gcc/ggc-page.c +++ b/gcc/ggc-page.c @@ -50,7 +50,7 @@ along with GCC; see the file COPYING3. If not see #define USING_MALLOC_PAGE_GROUPS #endif -#if defined(HAVE_MADVISE) && defined(MADV_DONTNEED) +#if defined(HAVE_MADVISE) && defined(MADV_DONTNEED) && defined(USING_MMAP) # define USING_MADVISE #endif