From patchwork Mon Aug 20 11:28:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 178749 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 DD71D2C007E for ; Mon, 20 Aug 2012 21:28:48 +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=1346066929; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Date:From:To:Subject:Message-ID:MIME-Version: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=7K/TrX3 G05SQx+0DJCpgoqLJirA=; b=pV18a8/C7OAr+IkxkXMlFw/Q10mOFXQnqojNJAI UEyFNxrQ6RicEOaoyw2TuSm95s4jyGABOfoe+NsVc80AkIr1gM/MivZQDzQargW3 XO/mt3r9ZMHXa/GF5zzCWCH0UHbYc5VMdjkteEb5rcGLhspcekSnvKpL5460EMMN ht5o= 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:Received:Received:Received:Date:From:To:Subject:Message-ID:MIME-Version:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=LSvDVT/aA15ukRrgsZ+rRDvnIrV7uBH5HHwlUYDPwn4ijE+pPsLAa1eh25KiLB tUuCkn5QRIijd0MKBsjCvrexI1cGpBCJ6bOIaRPKwKuQz3fDTPwLHSC+JRvy2pPy R7ivQbPhKpATl6wq+o1oyLhVfLIr3QLOHZiRqAhpS1Yok=; Received: (qmail 14681 invoked by alias); 20 Aug 2012 11:28:40 -0000 Received: (qmail 14670 invoked by uid 22791); 20 Aug 2012 11:28:39 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_HOSTKARMA_W, RCVD_IN_HOSTKARMA_WL, TW_CP, TW_TR, TW_TW, URIBL_BLACK X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 20 Aug 2012 11:28:25 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1T3Q9f-0005ET-Px from joseph_myers@mentor.com for gcc-patches@gcc.gnu.org; Mon, 20 Aug 2012 04:28:23 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Mon, 20 Aug 2012 04:28:23 -0700 Received: from digraph.polyomino.org.uk (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.1.289.1; Mon, 20 Aug 2012 12:28:21 +0100 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.76) (envelope-from ) id 1T3Q9d-0002Jl-48 for gcc-patches@gcc.gnu.org; Mon, 20 Aug 2012 11:28:21 +0000 Date: Mon, 20 Aug 2012 11:28:21 +0000 From: "Joseph S. Myers" To: Subject: Check for ffs declaration in gcc/configure.ac Message-ID: MIME-Version: 1.0 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 Building a cross compiler from i686-mingw32 to arm-none-eabi fails after the move to build as C++ because config/arm/neon.md uses ffs but no MinGW header declares ffs (and unlike in C, an implicit declaration of this built-in function can't be used). This patch fixes this issue by making the gcc directory configure check for a declaration, so causing libiberty.h to provide one if needed. Tested building a cross compiler as described above (fails before the patch, passes afterwards). OK to commit? 2012-08-20 Joseph Myers * configure.ac (ffs): Check for declaration. * configure, config.in: Regenerate. Index: configure =================================================================== --- configure (revision 190529) +++ configure (working copy) @@ -10288,7 +10288,7 @@ for ac_func in getenv atol asprintf sbrk abort atof getcwd getwd \ strsignal strstr stpcpy strverscmp \ errno snprintf vsnprintf vasprintf malloc realloc calloc \ - free basename getopt clock getpagesize clearerr_unlocked feof_unlocked ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked putchar_unlocked putc_unlocked + free basename getopt clock getpagesize ffs clearerr_unlocked feof_unlocked ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked putchar_unlocked putc_unlocked do ac_tr_decl=`$as_echo "HAVE_DECL_$ac_func" | $as_tr_cpp` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $ac_func is declared" >&5 Index: config.in =================================================================== --- config.in (revision 190529) +++ config.in (working copy) @@ -621,6 +621,12 @@ #endif +/* Define to 1 if we found a declaration for 'ffs', otherwise define to 0. */ +#ifndef USED_FOR_TARGET +#undef HAVE_DECL_FFS +#endif + + /* Define to 1 if we found a declaration for 'fgetc_unlocked', otherwise define to 0. */ #ifndef USED_FOR_TARGET Index: configure.ac =================================================================== --- configure.ac (revision 190529) +++ configure.ac (working copy) @@ -1075,7 +1075,7 @@ gcc_AC_CHECK_DECLS(getenv atol asprintf sbrk abort atof getcwd getwd \ strsignal strstr stpcpy strverscmp \ errno snprintf vsnprintf vasprintf malloc realloc calloc \ - free basename getopt clock getpagesize gcc_UNLOCKED_FUNCS, , ,[ + free basename getopt clock getpagesize ffs gcc_UNLOCKED_FUNCS, , ,[ #include "ansidecl.h" #include "system.h"])