[Top][All Lists]

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

Re: Trouble with gnulib/float.h on Intrepid

From: Eric Blake
Subject: Re: Trouble with gnulib/float.h on Intrepid
Date: Fri, 11 Oct 2013 12:25:02 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0

On 10/11/2013 12:11 PM, Rhys Ulerich wrote:
>> $ echo '#include <float.h>' > foo.c
>> $ bgxlc_r -E foo.c > float.out
> This produces a zero-length float.out.  My user reports there's no
> float.h file sitting alongside other headers in the usual places.

Makes sense on two fronts - at least with gcc, <float.h> is managed by
the compiler and not by libc, so it lives in a compiler-specific
directory; furthermore, <float.h> has no function declarations (just
#defines), so a normal preprocessor run strips it so that there's
nothing left.  Meanwhile, adding -C no longer strips comments, so...

>> We already special-case AIX, using a different mode of
>> '$CC -C -E' to make the preprocessed output more verbose; is there some
>> compiler switch for bgxlc_r (maybe -C, maybe some other spelling) that
>> makes the output more verbose?
> Trying again with -C (documented in the attached man page, in case
> that's helpful at all) a la
>> $ echo '#include <float.h>' > foo.c
>> $ bgxlc_r -C -E foo.c > float.out
> produces the output attached as float_with_-C.out.

Hooray!  It begins with:
#line 1 "/soft/apps/ibmcmp-jan2013/vac/bg/9.0/crt/include/float.h"

so that should be enough for us.  Now we just need to modify the .m4
file to use -C whenever $CC is bgxlc_r.

Does this work for your user?  If so, I'll turn it into a formal commit.
 I'm a little bit hesitant to key off of $CC; what is $host_os for your
user?  (We can't blindly add -C to ALL platforms, but if all compilers
on the host that has bgxlc_r are likely to support -C, the way we did it
for AIX based solely on $host_os is nicer than trying to guess based on
compiler name).

diff --git i/m4/absolute-header.m4 w/m4/absolute-header.m4
index 89ff5be..8725e22 100644
--- i/m4/absolute-header.m4
+++ w/m4/absolute-header.m4
@@ -1,4 +1,4 @@
-# absolute-header.m4 serial 16
+# absolute-header.m4 serial 17
 dnl Copyright (C) 2006-2013 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -61,9 +61,10 @@ AC_DEFUN([gl_ABSOLUTE_HEADER_ONE],
   dnl detect the absolute name of <dirent.h>, <signal.h>, <poll.h>
   dnl and others. The workaround is to force preservation of comments
   dnl through option -C. This ensures all necessary #line directives
-  dnl are present. GCC supports option -C as well.
-  case "$host_os" in
-    aix*) gl_absname_cpp="$ac_cpp -C" ;;
+  dnl are present. GCC supports option -C as well.  bgxlc_r on Intrepid
+  dnl has a similar failure for <float.h>, with a similar fix.
+  case $host_os:$CC in
+    aix*:* | *:bgxlc_r) gl_absname_cpp="$ac_cpp -C" ;;
     *)    gl_absname_cpp="$ac_cpp" ;;

Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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