* Check for ffs declaration in gcc/configure.ac
@ 2012-08-20 11:28 Joseph S. Myers
2012-08-20 11:33 ` Richard Guenther
0 siblings, 1 reply; 2+ messages in thread
From: Joseph S. Myers @ 2012-08-20 11:28 UTC (permalink / raw)
To: gcc-patches
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 <joseph@codesourcery.com>
* 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"])
--
Joseph S. Myers
joseph@codesourcery.com
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Check for ffs declaration in gcc/configure.ac
2012-08-20 11:28 Check for ffs declaration in gcc/configure.ac Joseph S. Myers
@ 2012-08-20 11:33 ` Richard Guenther
0 siblings, 0 replies; 2+ messages in thread
From: Richard Guenther @ 2012-08-20 11:33 UTC (permalink / raw)
To: Joseph S. Myers; +Cc: gcc-patches
On Mon, Aug 20, 2012 at 1:28 PM, Joseph S. Myers
<joseph@codesourcery.com> wrote:
> 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?
Ok.
Thanks,
Richard.
> 2012-08-20 Joseph Myers <joseph@codesourcery.com>
>
> * 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"])
>
>
> --
> Joseph S. Myers
> joseph@codesourcery.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-08-20 11:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-20 11:28 Check for ffs declaration in gcc/configure.ac Joseph S. Myers
2012-08-20 11:33 ` Richard Guenther
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).