bug-gnulib
[Top][All Lists]
Advanced

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

Re: unicode printf modules failures on powerpc


From: Bruno Haible
Subject: Re: unicode printf modules failures on powerpc
Date: Tue, 20 Jan 2009 00:57:29 +0100
User-agent: KMail/1.9.9

Hi Simon,

> Several of the unicode printf modules appear to fail on powerpc:
> 
> http://autobuild.josefsson.org/gnulib/log-200901190238061664000.txt
> http://autobuild.josefsson.org/gnulib/log-200901190501828983000.txt
> http://autobuild.josefsson.org/gnulib/log-200901190606100971000.txt
> http://autobuild.josefsson.org/gnulib/log-200901190501400253000.txt
> http://autobuild.josefsson.org/gnulib/log-200901190501597362000.txt
> http://autobuild.josefsson.org/gnulib/log-200901190606174926000.txt
> http://autobuild.josefsson.org/gnulib/log-200901190606896547000.txt
> http://autobuild.josefsson.org/gnulib/log-200901190737343641000.txt
> http://autobuild.josefsson.org/gnulib/log-200901181202216275000.txt
> http://autobuild.josefsson.org/gnulib/log-200901190237739632000.txt
> http://autobuild.josefsson.org/gnulib/log-200901181202454488000.txt
> http://autobuild.josefsson.org/gnulib/log-200901181202581614000.txt
> http://autobuild.josefsson.org/gnulib/log-200901181202836993000.txt
> 
> I suspect the reason for the failures are the same, or at least that
> there aren't more than a couple of different problems here.  I'm not
> familiar with the code base, and I don't care strongly to see these
> fixed, but I thought I should mention it.

Thank you for reporting this. Yes, the failure reason is the same for all.
The function u16_conv_from_encoding is converting to UTF-16LE instead of
UTF-16BE (on a big-endian PowerPC machine!). This is because WORDS_BIGENDIAN
is not defined in config.h. Because the "checking whether byte ordering is
bigendian" has not been executed by configure. Because
AC_REQUIRE([AC_C_BIGENDIAN]) had not the intended effect.

This is a documentated restriction on AC_REQUIRE, see today's commit
to the autoconf documentation:
<http://lists.gnu.org/archive/html/autoconf-patches/2009-01/msg00014.html>

 "Most macros fall in one of two general categories.  The first category
  includes macros which take arguments, in order to generate output
  parameterized by those arguments.  Macros in this category are designed
  to be directly expanded, often multiple times, and should not be used as
  the argument to @code{AC_REQUIRE}."

I'm fixing it like this.

Jim, it might be a good idea to do the same thing in coreutils/m4/jm-macros.m4.


2009-01-19  Bruno Haible  <address@hidden>

        Don't use AC_REQUIRE([AC_C_BIGENDIAN]).
        * m4/gnulib-common.m4 (gl_BIGENDIAN): New macro.
        * m4/exponentl.m4 (gl_LONG_DOUBLE_EXPONENT_LOCATION): Require
        gl_BIGENDIAN, not AC_C_BIGENDIAN.
        * m4/isfinite.m4 (gl_ISFINITEL_WORKS): Likewise.
        * m4/isinf.m4 (gl_ISINFL_WORKS): Likewise.
        * m4/isnanl.m4 (gl_FUNC_ISNANL_WORKS): Likewise.
        * m4/md4.m4 (gl_MD4): Likewise.
        * m4/md5.m4 (gl_MD5): Likewise.
        * m4/printf.m4 (gl_PRINTF_INFINITE_LONG_DOUBLE): Likewise.
        * m4/sha1.m4 (gl_SHA1): Likewise.
        * m4/sha256.m4 (gl_SHA256): Likewise.
        * m4/sha512.m4 (gl_SHA512): Likewise.

--- m4/gnulib-common.m4.orig    2009-01-20 00:48:25.000000000 +0100
+++ m4/gnulib-common.m4 2009-01-20 00:36:04.000000000 +0100
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 7
+# gnulib-common.m4 serial 8
 dnl Copyright (C) 2007-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -99,3 +99,12 @@
    *)  AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;;
  esac
 ])
+
+# gl_BIGENDIAN
+# is like AC_C_BIGENDIAN, except that it can be AC_REQUIREd.
+# Note that AC_REQUIRE([AC_C_BIGENDIAN]) does not work reliably because some
+# macros invoke AC_C_BIGENDIAN with arguments.
+AC_DEFUN([gl_BIGENDIAN],
+[
+  AC_C_BIGENDIAN
+])
--- m4/exponentl.m4.orig        2009-01-20 00:48:25.000000000 +0100
+++ m4/exponentl.m4     2009-01-20 00:38:08.000000000 +0100
@@ -1,11 +1,11 @@
-# exponentl.m4 serial 1
-dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
+# exponentl.m4 serial 2
+dnl Copyright (C) 2007-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_LONG_DOUBLE_EXPONENT_LOCATION],
 [
-  AC_REQUIRE([AC_C_BIGENDIAN])
+  AC_REQUIRE([gl_BIGENDIAN])
   AC_CACHE_CHECK([where to find the exponent in a 'long double'],
     [gl_cv_cc_long_double_expbit0],
     [
--- m4/isfinite.m4.orig 2009-01-20 00:48:25.000000000 +0100
+++ m4/isfinite.m4      2009-01-20 00:38:28.000000000 +0100
@@ -1,5 +1,5 @@
-# isfinite.m4 serial 3
-dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
+# isfinite.m4 serial 4
+dnl Copyright (C) 2007-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -44,7 +44,7 @@
 AC_DEFUN([gl_ISFINITEL_WORKS],
 [
   AC_REQUIRE([AC_PROG_CC])
-  AC_REQUIRE([AC_C_BIGENDIAN])
+  AC_REQUIRE([gl_BIGENDIAN])
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   AC_CACHE_CHECK([whether isfinite(long double) works], 
[gl_cv_func_isfinitel_works],
     [
--- m4/isinf.m4.orig    2009-01-20 00:48:26.000000000 +0100
+++ m4/isinf.m4 2009-01-20 00:37:59.000000000 +0100
@@ -1,5 +1,5 @@
-# isinf.m4 serial 1
-dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
+# isinf.m4 serial 2
+dnl Copyright (C) 2007-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -35,7 +35,7 @@
 AC_DEFUN([gl_ISINFL_WORKS],
 [
   AC_REQUIRE([AC_PROG_CC])
-  AC_REQUIRE([AC_C_BIGENDIAN])
+  AC_REQUIRE([gl_BIGENDIAN])
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   AC_CACHE_CHECK([whether isinf(long double) works], [gl_cv_func_isinfl_works],
     [
--- m4/isnanl.m4.orig   2009-01-20 00:48:26.000000000 +0100
+++ m4/isnanl.m4        2009-01-20 00:37:32.000000000 +0100
@@ -1,4 +1,4 @@
-# isnanl.m4 serial 10
+# isnanl.m4 serial 11
 dnl Copyright (C) 2007-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -114,7 +114,7 @@
 AC_DEFUN([gl_FUNC_ISNANL_WORKS],
 [
   AC_REQUIRE([AC_PROG_CC])
-  AC_REQUIRE([AC_C_BIGENDIAN])
+  AC_REQUIRE([gl_BIGENDIAN])
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   AC_CACHE_CHECK([whether isnanl works], [gl_cv_func_isnanl_works],
     [
--- m4/md4.m4.orig      2009-01-20 00:48:26.000000000 +0100
+++ m4/md4.m4   2009-01-20 00:38:20.000000000 +0100
@@ -1,5 +1,5 @@
-# md4.m4 serial 3
-dnl Copyright (C) 2002, 2003, 2004, 2005, 2006, 2008 Free Software Foundation, 
Inc.
+# md4.m4 serial 4
+dnl Copyright (C) 2002, 2003, 2004, 2005, 2006, 2008, 2009 Free Software 
Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -9,6 +9,6 @@
   AC_LIBOBJ([md4])
 
   dnl Prerequisites of lib/md4.c.
-  AC_REQUIRE([AC_C_BIGENDIAN])
+  AC_REQUIRE([gl_BIGENDIAN])
   AC_REQUIRE([AC_C_INLINE])
 ])
--- m4/md5.m4.orig      2009-01-20 00:48:26.000000000 +0100
+++ m4/md5.m4   2009-01-20 00:37:14.000000000 +0100
@@ -1,5 +1,5 @@
-# md5.m4 serial 10
-dnl Copyright (C) 2002, 2003, 2004, 2005, 2006, 2008 Free Software Foundation, 
Inc.
+# md5.m4 serial 11
+dnl Copyright (C) 2002, 2003, 2004, 2005, 2006, 2008, 2009 Free Software 
Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -9,7 +9,7 @@
   AC_LIBOBJ([md5])
 
   dnl Prerequisites of lib/md5.c.
-  AC_REQUIRE([AC_C_BIGENDIAN])
+  AC_REQUIRE([gl_BIGENDIAN])
   AC_REQUIRE([AC_C_INLINE])
   :
 ])
--- m4/printf.m4.orig   2009-01-20 00:48:26.000000000 +0100
+++ m4/printf.m4        2009-01-20 00:37:02.000000000 +0100
@@ -1,4 +1,4 @@
-# printf.m4 serial 27
+# printf.m4 serial 28
 dnl Copyright (C) 2003, 2007-2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -225,7 +225,7 @@
 [
   AC_REQUIRE([gl_PRINTF_LONG_DOUBLE])
   AC_REQUIRE([AC_PROG_CC])
-  AC_REQUIRE([AC_C_BIGENDIAN])
+  AC_REQUIRE([gl_BIGENDIAN])
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   dnl The user can set or unset the variable gl_printf_safe to indicate
   dnl that he wishes a safe handling of non-IEEE-754 'long double' values.
--- m4/sha1.m4.orig     2009-01-20 00:48:26.000000000 +0100
+++ m4/sha1.m4  2009-01-20 00:37:27.000000000 +0100
@@ -1,5 +1,5 @@
-# sha1.m4 serial 8
-dnl Copyright (C) 2002, 2003, 2004, 2005, 2006, 2008 Free Software Foundation, 
Inc.
+# sha1.m4 serial 9
+dnl Copyright (C) 2002, 2003, 2004, 2005, 2006, 2008, 2009 Free Software 
Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -9,7 +9,7 @@
   AC_LIBOBJ([sha1])
 
   dnl Prerequisites of lib/sha1.c.
-  AC_REQUIRE([AC_C_BIGENDIAN])
+  AC_REQUIRE([gl_BIGENDIAN])
   AC_REQUIRE([AC_C_INLINE])
   :
 ])
--- m4/sha256.m4.orig   2009-01-20 00:48:26.000000000 +0100
+++ m4/sha256.m4        2009-01-20 00:37:52.000000000 +0100
@@ -1,5 +1,5 @@
-# sha256.m4 serial 3
-dnl Copyright (C) 2005, 2008 Free Software Foundation, Inc.
+# sha256.m4 serial 4
+dnl Copyright (C) 2005, 2008, 2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -9,6 +9,6 @@
   AC_LIBOBJ([sha256])
 
   dnl Prerequisites of lib/sha256.c.
-  AC_REQUIRE([AC_C_BIGENDIAN])
+  AC_REQUIRE([gl_BIGENDIAN])
   AC_REQUIRE([AC_C_INLINE])
 ])
--- m4/sha512.m4.orig   2009-01-20 00:48:26.000000000 +0100
+++ m4/sha512.m4        2009-01-20 00:37:43.000000000 +0100
@@ -1,5 +1,5 @@
-# sha512.m4 serial 4
-dnl Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc.
+# sha512.m4 serial 5
+dnl Copyright (C) 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -9,6 +9,6 @@
   AC_LIBOBJ([sha512])
 
   dnl Prerequisites of lib/sha512.c.
-  AC_REQUIRE([AC_C_BIGENDIAN])
+  AC_REQUIRE([gl_BIGENDIAN])
   AC_REQUIRE([AC_C_INLINE])
 ])




reply via email to

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