Matthew Burgess wrote:
> Hi all,
> 
> The following is taken from my build logs when using Glibc-2.13:
> 
> checking cpuid.h usability... no
> checking cpuid.h presence... yes
> configure: WARNING: cpuid.h: present but cannot be compiled
> configure: WARNING: cpuid.h:     check for missing prerequisite headers?
> configure: WARNING: cpuid.h: see the Autoconf documentation
> configure: WARNING: cpuid.h:     section "Present But Cannot Be Compiled"
> configure: WARNING: cpuid.h: proceeding with the preprocessor's result
> configure: WARNING: cpuid.h: in the future, the compiler will take precedence
> checking for cpuid.h... yes
> 
> Using Glibc-2.14, that final line reads 'no', and appears to stem from the
> lack of 'stdio.h'.  stdio.h is installed by Glibc, so it would appear as if
> we're getting into a circular dependency here somehow, but I'm yet to figure
> out how/why Glibc-2.14 is behaving so differently to Glibc-2.13.
> 
> I guess the first question is, has anyone else seen this issue?

Haven't done a build in a while (and my builds are 64-bit multilib
anyway, so I'm not sure if I get sysdeps/i386 configure scripts to run
or not :-) ), but I've done some digging.

The problem is autoconf.  By default the AC_CHECK_HEADER macro uses a
set of prerequisite headers that's supposed to cover most of the common
stuff on a system -- but that list is set up for full systems, not
bootstrapping like we're trying to do.

http://www.gnu.org/s/hello/manual/autoconf/Default-Includes.html#Default-Includes

But it turns out that cpuid.h is dead-simple (it has to be, since it's
installed with the compiler...  :-) ), and it doesn't need any of these
prerequisite headers at all.  So I *think* the attached patch will work.

(However, I can't actually test it, since glibc 2.14 refuses to
configure on this box as it is, complaining that my compiler is too old.
That's probably going to make the next upgrade a bit difficult...)

Anyway, see if it helps.  I'm fixing both configure.in and configure
here, but if you "patch -Z" then it shouldn't cause make to try to rerun
autoconf.  (Because it'll set the timestamps of the edited files to the
ones in the patch file, and I've ensured that configure is newer than
configure.in in this patch file.)
diff -Naur glibc-2.14/sysdeps/i386/configure 
glibc-2.14-patched/sysdeps/i386/configure
--- glibc-2.14/sysdeps/i386/configure   2011-05-30 21:12:33.000000000 -0700
+++ glibc-2.14-patched/sysdeps/i386/configure   2011-06-04 18:35:09.000000000 
-0700
@@ -632,7 +632,9 @@
 done
 
 
-ac_fn_c_check_header_mongrel "$LINENO" "cpuid.h" "ac_cv_header_cpuid_h" 
"$ac_includes_default"
+ac_fn_c_check_header_compile "$LINENO" "cpuid.h" "ac_cv_header_cpuid_h" "
+
+"
 if test "x$ac_cv_header_cpuid_h" = x""yes; then :
 
 else
diff -Naur glibc-2.14/sysdeps/i386/configure.in 
glibc-2.14-patched/sysdeps/i386/configure.in
--- glibc-2.14/sysdeps/i386/configure.in        2011-05-30 21:12:33.000000000 
-0700
+++ glibc-2.14-patched/sysdeps/i386/configure.in        2011-06-04 
18:31:05.000000000 -0700
@@ -2,7 +2,8 @@
 # Local configure fragment for sysdeps/i386.
 
 AC_HEADER_CHECK([cpuid.h], ,
-  [AC_MSG_ERROR([gcc must provide the <cpuid.h> header])])
+  [AC_MSG_ERROR([gcc must provide the <cpuid.h> header])], [
+])
 
 AC_CACHE_CHECK(if -g produces usable source locations for assembler-with-cpp,
               libc_cv_cpp_asm_debuginfo, [dnl

Attachment: signature.asc
Description: OpenPGP digital signature

-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to