From patchwork Mon Aug 24 12:55:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulrich Weigand X-Patchwork-Id: 510024 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id B48271402A0 for ; Mon, 24 Aug 2015 22:56:05 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=iLH7l1gO; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:date:from:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:message-id; q=dns; s=default; b=xgxku RagIZuOM0mAGXvt0YgyvaJhOBsOAVQqnqEu957M4lyjpit7jLubmAgN2rmdO16zd E7FjoLOEdCb3bUPVKopNu6kS2qXh/8gkiSELg68w4s9t7H0MLJDWYvdS9JcrWIO4 PntXK5HRZDPksvLI/5CX2ETefy9BAwcXaNMyEY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:to:date:from:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:message-id; s=default; bh=sktpIMpd1Wb 7gTuPqmPaul+FbZU=; b=iLH7l1gOthpV386p3rexWIOkEhFKq3HyfWU05buVh7S 44faWoslMcrGQHzr8uD+04IC1Y1GCDop49lMWnfXbxDbrfN+IuqiE5+5sxJwWpLn u7ooCqqgrqAGHvT3xqdxMhbMXp3Gazkh/ayNpoAr69sY4LbHtv+a8XYyZaMHzV8E = Received: (qmail 81886 invoked by alias); 24 Aug 2015 12:55:58 -0000 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 Received: (qmail 81876 invoked by uid 89); 24 Aug 2015 12:55:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_PASS, URIBL_BLACK autolearn=no version=3.3.2 X-HELO: e06smtp16.uk.ibm.com Received: from e06smtp16.uk.ibm.com (HELO e06smtp16.uk.ibm.com) (195.75.94.112) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Mon, 24 Aug 2015 12:55:55 +0000 Received: from /spool/local by e06smtp16.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 24 Aug 2015 13:55:47 +0100 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp16.uk.ibm.com (192.168.101.146) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 24 Aug 2015 13:55:45 +0100 X-MailFrom: uweigand@de.ibm.com X-RcptTo: gcc-patches@gcc.gnu.org Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id D9C0317D8063; Mon, 24 Aug 2015 13:57:22 +0100 (BST) Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t7OCtikg27984030; Mon, 24 Aug 2015 12:55:44 GMT Received: from d06av05.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t7OCtiWo025819; Mon, 24 Aug 2015 06:55:44 -0600 Received: from oc7340732750.ibm.com (dyn-9-152-213-24.boeblingen.de.ibm.com [9.152.213.24]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t7OCti1u025813; Mon, 24 Aug 2015 06:55:44 -0600 Received: by oc7340732750.ibm.com (Postfix, from userid 500) id 56C5E1249E; Mon, 24 Aug 2015 14:55:44 +0200 (CEST) Subject: Re: Build break on SPU (and other non-mmap systems?) (Re: [patch, libgfortran, toplevel] Use libbacktrace in libgfortran) To: fxcoudert@gmail.com (FX) Date: Mon, 24 Aug 2015 14:55:44 +0200 (CEST) From: "Ulrich Weigand" Cc: iant@google.com, fortran@gcc.gnu.org (gfortran), gcc-patches@gcc.gnu.org (gcc-patches) In-Reply-To: <5E9275E2-1488-45B2-8074-3D92A5320DF3@gmail.com> from "FX" at Aug 24, 2015 02:37:58 PM MIME-Version: 1.0 Message-Id: <20150824125544.56C5E1249E@oc7340732750.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15082412-0025-0000-0000-0000069277D4 FX Coudert wrote: > The idea is that libbacktrace should be able to build on all targets, at > least in a minimally-functional form: > https://gcc.gnu.org/ml/gcc/2015-08/msg00038.html > libgfortran should continue to build on all targets, even those that > don't have an mmap(). > > I see that there is a test in libbacktrace/configure.ac for mmap(), but > apparently it fails on your system: Ah, I see. On the SPU, we do have an sys/mman.h header file, which provides a "mmap_eaddr" routine used to map files into the DMA address space, and associated mmap flags. That's why the test gets confused. > So this should be the place to patch things up. Relying on the presence of > is apparently not restrictive enough. Maybe we could use a > AC_EGREP_HEADER test, as is currently done for dl_interate_phdr()? Hmm, that seems tricky, since the SPU sys/mman.h file contains the prototype for mmap_eaddr, and the string "mmap" in various comments ... I guess we can always just hard-code that SPU does not have mmap, similar to how Solaris is hard-coded to not have dl_iterate_phdr. Would something like the below be OK (if it passes testing)? Thanks, Ulrich Index: libbacktrace/configure.ac =================================================================== --- libbacktrace/configure.ac (revision 227056) +++ libbacktrace/configure.ac (working copy) @@ -273,6 +273,12 @@ else # When built as a GCC target library, we can't do a link test. We # simply assume that if we have mman.h, we have mmap. have_mmap=yes + case "${host}" in + spu-*-*) + # The SPU does not have mmap, but it has a sys/mman.h header file + # containing "mmap_eaddr" and the mmap flags, confusing the test. + have_mmap=no ;; + esac else AC_CHECK_FUNC(mmap, [have_mmap=yes], [have_mmap=no]) fi