From patchwork Tue Oct 14 14:12:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Brobecker X-Patchwork-Id: 399471 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 56F211400A0 for ; Wed, 15 Oct 2014 01:12:56 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; q=dns; s=default; b=QwQ9FOvHOLtmAxUCc fgy3+VZiCTIcmbwYbRfbDm+6D1NozXL0PtLViwNrVJS/0zhlW5kTXAusnJIJ6AEP u/sN6BwOd/JO+1jKT+pADk/be3SiQj4qmvAIn12zC3q5hkCgl/5uxg1VsVSqcE66 l5UfyhzVyDPpuKHGdkakZWOVQk= 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:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=default; bh=QazDb/brSyFJ4e17wC0QLAj H7Yw=; b=fzp1zDlVDK9Auub2tSEtlVrMEJ1MnfX9MIV4a8MkBBOSk2UdICTBccq omnj7CJE60qM79B6DjRFde4AERtdzavMvDZup+yJYA5uOhVns0+Ds+MsjjWe3mGz hcwxmSLRmb9cQ1slWt7v0oHoiJrnk9aiSYr67pysoKLo9Wj/oLm0= Received: (qmail 24167 invoked by alias); 14 Oct 2014 14:12:48 -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 24155 invoked by uid 89); 14 Oct 2014 14:12:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 14 Oct 2014 14:12:46 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 41E62116285; Tue, 14 Oct 2014 10:12:44 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id BoDImbsJtiXw; Tue, 14 Oct 2014 10:12:44 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 0B2201161FC; Tue, 14 Oct 2014 10:12:44 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 1F20540E17; Tue, 14 Oct 2014 07:12:44 -0700 (PDT) Date: Tue, 14 Oct 2014 07:12:44 -0700 From: Joel Brobecker To: Iain Buclaw Cc: Ian Lance Taylor , gcc-patches Subject: Re: [PATCH] Add D demangling support to libiberty Message-ID: <20141014141244.GA17173@adacore.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Hello Ian, > libiberty/ChangeLog > 2014-08-05 Iain Buclaw > > * Makefile.in (CFILES): Add d-demangle.c. > (REQUIRED_OFILES): Add d-demangle.o. > * cplus-dem.c (libiberty_demanglers): Add dlang_demangling case. > (cplus_demangle): Likewise. > * d-demangle.c: New file. > * testsuite/Makefile.in (really-check): Add check-d-demangle. > * testsuite/d-demangle-expected: New file. As hinted on gdb-patches, this patch causes a GDB build failure on Solaris 2.9, because it uses strtold which is not available. According to gnulib's documentation, it should also break on the following systems: NetBSD 3.0, OpenBSD 3.8, Minix 3.1.8, IRIX 6.5, OSF/1 4.0, Solaris 9, Cygwin, MSVC 9, Interix 3.5, BeOS. This patch attempts to fix the issue by adding a configure check for strtold and adjusts the code to use strtod if strtold does not exist. Does this look OK to you? If yes, can one of the GCC maintainers please review? libiberty/ChangeLog: * configure.ac: Add check for strtold's availability. * configure, config.in: Regenerate. * d-demangle.c [!HAVE_STRTOLD]: #define strtold to strtod. Thank you! From 9e4d74607075ef857dfa4e118f43641494aaff90 Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Tue, 14 Oct 2014 09:54:05 -0400 Subject: [PATCH] libiberty: fallback on strtod if strtold is not available. This patch fixes a build failurer on Solaris 2.9, and all other systems that do not provide strtold. libiberty/ChangeLog: * configure.ac: Add check for strtold's availability. * configure, config.in: Regenerate. * d-demangle.c [!HAVE_STRTOLD]: #define strtold to strtod. --- libiberty/config.in | 3 +++ libiberty/configure | 2 +- libiberty/configure.ac | 2 +- libiberty/d-demangle.c | 3 +++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/libiberty/configure.ac b/libiberty/configure.ac index 3380819..da20a5f 100644 --- a/libiberty/configure.ac +++ b/libiberty/configure.ac @@ -401,7 +401,7 @@ if test "x" = "y"; then sbrk setenv setproctitle setrlimit sigsetmask snprintf spawnve spawnvpe \ stpcpy stpncpy strcasecmp strchr strdup \ strerror strncasecmp strndup strnlen strrchr strsignal strstr strtod \ - strtol strtoul strverscmp sysconf sysctl sysmp \ + strtol strtold strtoul strverscmp sysconf sysctl sysmp \ table times tmpnam \ vasprintf vfprintf vprintf vsprintf \ wait3 wait4 waitpid) diff --git a/libiberty/d-demangle.c b/libiberty/d-demangle.c index d31bf94..59de083 100644 --- a/libiberty/d-demangle.c +++ b/libiberty/d-demangle.c @@ -46,6 +46,9 @@ If not, see . */ extern long strtol (const char *nptr, char **endptr, int base); extern long double strtold (const char *nptr, char **endptr); #endif +#if !defined(HAVE_STRTOLD) +#define strtold strtod +#endif #include #include "libiberty.h" diff --git a/libiberty/config.in b/libiberty/config.in index 1cf9c11..8c5f0b6 100644 --- a/libiberty/config.in +++ b/libiberty/config.in @@ -280,6 +280,9 @@ /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL +/* Define to 1 if you have the `strtold' function. */ +#undef HAVE_STRTOLD + /* Define to 1 if you have the `strtoul' function. */ #undef HAVE_STRTOUL diff --git a/libiberty/configure b/libiberty/configure index 96feaed..072b03b 100755 --- a/libiberty/configure +++ b/libiberty/configure @@ -5423,7 +5423,7 @@ if test "x" = "y"; then sbrk setenv setproctitle setrlimit sigsetmask snprintf spawnve spawnvpe \ stpcpy stpncpy strcasecmp strchr strdup \ strerror strncasecmp strndup strnlen strrchr strsignal strstr strtod \ - strtol strtoul strverscmp sysconf sysctl sysmp \ + strtol strtold strtoul strverscmp sysconf sysctl sysmp \ table times tmpnam \ vasprintf vfprintf vprintf vsprintf \ wait3 wait4 waitpid -- 1.9.1