From patchwork Thu Feb 26 14:49:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kai Tietz X-Patchwork-Id: 443947 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 92DB11400D5 for ; Fri, 27 Feb 2015 01:49:28 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass reason="1024-bit key; unprotected key" header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=l5iEYepl; dkim-adsp=none (unprotected policy); 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 :mime-version:date:message-id:subject:from:to:cc:content-type; q=dns; s=default; b=fOYcLXE5ZrN6NY/NKzi09Fij+7OUBYU0fvO0R+t1yh7 uOO+5Q+LlH1hGc+RW4zbvrw1+pRA8sWDplWNxedipSjKoEU0siKW742IjPdStk2z UJYtWEBTVjDAFbD44M65HgjW4lRdxVQ0ZFD/XDRqxTGC9Aur78ZQxfjPMydk6a0Q = 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 :mime-version:date:message-id:subject:from:to:cc:content-type; s=default; bh=lmvK43lPYw/mVTWAw8ooP63imUM=; b=l5iEYeplMIK41HCGr 77mpSFt/emsTEasJVUd6PzrLkrviwtq6qKvIaNZtsC2xK51b6doDo7aCVZzS1Yvl EdbGySJgIz10fNey//1U8yP0GWnKqEhMwbY686VQnjnl+ima1V9shZnEgCMfMGTP YSiHWtpAtC7F4lTDWb3LbQHbeM= Received: (qmail 91475 invoked by alias); 26 Feb 2015 14:49:19 -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 91462 invoked by uid 89); 26 Feb 2015 14:49:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-we0-f178.google.com Received: from mail-we0-f178.google.com (HELO mail-we0-f178.google.com) (74.125.82.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 26 Feb 2015 14:49:16 +0000 Received: by wesw62 with SMTP id w62so11431303wes.9 for ; Thu, 26 Feb 2015 06:49:13 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.194.184.83 with SMTP id es19mr17105344wjc.93.1424962153082; Thu, 26 Feb 2015 06:49:13 -0800 (PST) Received: by 10.27.172.143 with HTTP; Thu, 26 Feb 2015 06:49:13 -0800 (PST) Date: Thu, 26 Feb 2015 15:49:13 +0100 Message-ID: Subject: [patch]: Fix Bug 65038 - [regression 5] Unable to find ftw.h for libgcov-util.c From: Kai Tietz To: GCC Patches Cc: terry.gua@arm.com X-IsSubscribed: yes Hi, This is the remaining fix for re-enabling native boostrap for Windows-variant of gcc without disabling -Werror for libgcc. ChangeLog 2015-02-26 Kai Tietz PR target/65038 * config.in: Regenerated. * configure: Likewise. * configure.ac (AC_HEADER_STDC): Add explicit. (AC_CHECK_HEADERS): Check for default headers plus for ftw.h one. * libgcov-util.c (gcov_read_profile_dir): Disable use of ftw-function, if header not found. (ftw_read_file): Don't translate if ftw header isn't present. Regression-tested for x86_64-unknown-linux-gnu. Bootstrapped for i686-pc-mingw32. I will apply soon, if there are no objections. Regards. Kai Index: configure.ac =================================================================== --- configure.ac (Revision 220969) +++ configure.ac (Arbeitskopie) @@ -47,6 +47,12 @@ AC_SUBST(libgcc_topdir) AC_CONFIG_AUX_DIR($libgcc_topdir) AC_CONFIG_HEADER(auto-target.h:config.in) +AC_CHECK_HEADERS(inttypes.h \ + stdint.h stdlib.h \ + ftw.h unistd.h sys/stat.h sys/types.h \ + string.h strings.h memory.h) +AC_HEADER_STDC + AC_ARG_ENABLE(shared, [ --disable-shared don't provide a shared libgcc], [ Index: libgcov-util.c =================================================================== --- libgcov-util.c (Revision 220969) +++ libgcov-util.c (Arbeitskopie) @@ -52,7 +52,9 @@ void gcov_set_verbose (void) #include "obstack.h" #include +#ifdef HAVE_FTW_H #include +#endif static void tag_function (unsigned, unsigned); static void tag_blocks (unsigned, unsigned); @@ -380,6 +382,7 @@ read_gcda_file (const char *filename) return obj_info; } +#ifdef HAVE_FTW_H /* This will be called by ftw(). It opens and read a gcda file FILENAME. Return a non-zero value to stop the tree walk. */ @@ -417,6 +420,7 @@ ftw_read_file (const char *filename, return 0; } +#endif /* Initializer for reading a profile dir. */ @@ -451,7 +455,9 @@ gcov_read_profile_dir (const char* dir_name, int r fnotice (stderr, "%s is not a directory\n", dir_name); return NULL; } +#ifdef HAVE_FTW_H ftw (".", ftw_read_file, 50); +#endif ret = chdir (pwd); free (pwd);