From patchwork Tue Sep 18 16:07:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 184757 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 E9EED2C008A for ; Wed, 19 Sep 2012 02:07:43 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1348589264; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:From:To:Subject:Date:Message-ID:User-Agent: MIME-Version:Content-Type:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=jBFrXOtilFIFRWI4XtaF8jgKB4c=; b=ZfY7OqL1FowccWq er5SO1qDzFgu4NHtB0OyMsWltVwg1jIG0C1mG8gabuYHcQHPoraLvXcNE52vUAnB biN3vyz/PvA0llFED3z5nxLhpZco0LZ57w7+Zvb1N8tNAD/HAzGPzgE1kIUqUri9 MSj2GH/J7LxE0w9WlHE5+SDFLZvo= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-Google-DKIM-Signature:Received:Received:Received:From:To:Subject:Date:Message-ID:User-Agent:MIME-Version:Content-Type:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=k/MOCg7cJHfgWRwLn6x6Yt3/nCXnnsC0+oqdTmKWzxM90zDaqwOmY3r1tp5eGG gar/Zl12iEJ6mSOx1AS5R7IAr0PvZsv1kQLjtJo+kp+Wbd91G4cA6P+BqBnlopaE ngbcZ5Qw4f+hFNmpuryGuELwWT4yr0AnWqgEhXMr61gUU=; Received: (qmail 3406 invoked by alias); 18 Sep 2012 16:07:36 -0000 Received: (qmail 3393 invoked by uid 22791); 18 Sep 2012 16:07:34 -0000 X-SWARE-Spam-Status: No, hits=-5.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from mail-pb0-f47.google.com (HELO mail-pb0-f47.google.com) (209.85.160.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 18 Sep 2012 16:07:20 +0000 Received: by pbcwy7 with SMTP id wy7so312266pbc.20 for ; Tue, 18 Sep 2012 09:07:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:subject:date:message-id:user-agent:mime-version :content-type:x-gm-message-state; bh=Hhk/XiPDBw+zW3DfF/dR56SPVUL5V0D9DM3gHYUXrx0=; b=La+Gd/UdDJbEQJbT0vlCYtnbPb3ECMt3MlI/WtB+1wVhBL3KU2hpQlAXUhvDDiVKUF oiavZliwrYF9+N6eyA5hDZzQ8lUkZgpMb1fXo+CaVytauLDsDYDU3SKU0gdU0JElX6xo U/qQlb0qM5KAHS1c+GtRFM6eXV20ZQjKbnyxuNreixNPKpA62m0lva1C8N72RWkpvYGe D2y0Y6sy9PtMVoPexs6M9aMZ40I5GRVhGD9KFU3E4tzEYkVQJEQZCiPPjvooob6QVX+H JkdxZ66vpvdA3lk0xAI4svJE3xcMUj7jSFodfNyfB4GkuqPL243iFy70J2yWHo4hA1dE zLuQ== Received: by 10.66.88.40 with SMTP id bd8mr397341pab.36.1347984439875; Tue, 18 Sep 2012 09:07:19 -0700 (PDT) Received: by 10.66.88.40 with SMTP id bd8mr397330pab.36.1347984439719; Tue, 18 Sep 2012 09:07:19 -0700 (PDT) Received: from coign.google.com ([2620:0:1000:2301:f2de:f1ff:fe40:72a8]) by mx.google.com with ESMTPS id j10sm242482pax.4.2012.09.18.09.07.11 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 18 Sep 2012 09:07:12 -0700 (PDT) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org Subject: libbacktrace patch committed: Declare strnlen if not declared Date: Tue, 18 Sep 2012 09:07:10 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 X-Gm-Message-State: ALoCoQmObxrXD1FrbCD+gXSRhNCq0glDOs0RrXI0DqJDpx7zdE3M/FgNBpqYNihmRXWp7bZCr23Ld28jdMbTdVMSmg7q7Gh3PF/TTtGTmB9hZX3FyvIl7ITupfTMLYnsZghpQ/ynDUWBPRgfTYPYgDP1yZW240odfGyls0r5KsPGv/tUExNrUsPpLD8OC32Vxpj2R1Jtr8nDrN8VvAcWsWTn8pKuaegT0w== X-IsSubscribed: yes 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 This patch to libbacktrace declares strnlen if it is not declared in a standard header file. If necessary, the actual definition will come from libiberty. Bootstrapped on x86_64-unknown-linux-gnu. Committed to mainline. Ian 2012-09-18 Ian Lance Taylor * configure.ac: Check whether strnlen is declared. * dwarf.c: Declare strnlen if not declared. Index: dwarf.c =================================================================== --- dwarf.c (revision 191432) +++ dwarf.c (working copy) @@ -44,6 +44,11 @@ POSSIBILITY OF SUCH DAMAGE. */ #include "backtrace.h" #include "internal.h" +#ifndef HAVE_DECL_STRNLEN +/* The function is defined in libiberty if needed. */ +extern size_t strnlen (const char *, size_t); +#endif + /* A buffer to read DWARF info. */ struct dwarf_buf Index: configure.ac =================================================================== --- configure.ac (revision 191432) +++ configure.ac (working copy) @@ -199,6 +199,8 @@ if test "$ALLOC_FILE" = "alloc.lo"; then fi AC_SUBST(BACKTRACE_USES_MALLOC) +AC_CHECK_DECLS(strnlen) + AC_CACHE_CHECK([whether tests can run], [libbacktrace_cv_sys_native], [AC_RUN_IFELSE([AC_LANG_PROGRAM([], [return 0;])],