autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: autoconf attempts to execute a stdlib that it only compiled, and did


From: Tim Van Holder
Subject: Re: autoconf attempts to execute a stdlib that it only compiled, and did not link
Date: Mon, 05 Sep 2005 08:41:18 +0200
User-agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)

address@hidden wrote:
> autoconf attempts to execute a stdlib that it only compiled, and did not
> link.  I originally found this bug in the
> ./i686-pc-linux-gnu/libiberty/configure in gcc 3.4.1,
> and gcc unfortunately fails to provide the configure.in that
> they used to generate their configure.

No they don't - it's called configure.ac and is in the libiberty
source dir.

> 
> --- ./lib/autoconf/headers.m4   Thu Sep 25 02:28:51 2003
> +++ ./lib/autoconf/headers.m4.new       Sun Sep  4 19:40:24 2005
> @@ -568,7 +568,7 @@
> 
>  AC_DEFUN([AC_HEADER_STDC],
>  [AC_CACHE_CHECK(for ANSI C header files, ac_cv_header_stdc,
> -[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
> +[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
>  #include <stdarg.h>
>  #include <string.h>
>  #include <float.h>

This is wrong for two reasons:
- It's a test for _headers_, so linking is not what's required
  (heck, it shouldn't have to do more than preprocess, but it also
  checks whether some standard functions are declared by them, hence
  the compilation).
- Any linking tests break cross-compilation, so they should be
  kept to a minimum.  Changing non-linking tests to ones that link
  is a no-no.

If the existing tests find headers for a library that isn't installed,
that's a problem with the system.  If it finds headers for a library
that isn't added to the link line, that's a problem with either the
system (broken default linker script) or the configure script
(missing AC_CHECK_LIB).
AC_HEADER_STDC only checks that header with the names defined in
the C standard are available and contain a few of the standard
functions; if you want to know if /specific/ standard _functions_ are
available, you need to test for those separately (AC_CHECK_FUNCS).

A more specific report ("it fails to link on system XXX because symbol
YYY is not found") would be more helpful.  In any case, this seems to
lead to a libiberty bug report, not an autoconf one.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]