GNU bug report logs - #10520
[platform-testers] Guile 2.0.4 release imminent

Previous Next

Package: guile;

Reported by: Bruno Haible <bruno <at> clisp.org>

Date: Mon, 16 Jan 2012 01:41:02 UTC

Severity: normal

Done: ludo <at> gnu.org (Ludovic Courtès)

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 10520 in the body.
You can then email your comments to 10520 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#10520; Package guile. (Mon, 16 Jan 2012 01:41:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bruno Haible <bruno <at> clisp.org>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Mon, 16 Jan 2012 01:41:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Bruno Haible <bruno <at> clisp.org>
To: bug-guile <at> gnu.org
Cc: Andy Wingo <wingo <at> pobox.com>,
	Ludovic Courtès <ludo <at> gnu.org>
Subject: Re: [platform-testers] Guile 2.0.4 release imminent
Date: Mon, 16 Jan 2012 02:38:58 +0100
Hi Ludo,

> We’d like to release GNU Guile 2.0.4 within the next few days.  The
> latest 2.0.x tarball can be found at:
> 
>   http://hydra.nixos.org/job/gnu/guile-2-0/tarball/latest/download-by-type/file/source-dist
> 
> Guile has the following dependencies:
> 
>   - libgmp 4.1+
>   - libiconv on non-GNU systems
>   - libintl on non-GNU systems
>   - libltdl (from GNU Libtool)
>   - libunistring
>   - libgc 7.x
>   - libffi

The build reports below are with
  gmp 5.0.2
  libiconv 1.14
  libintl 0.18.1.1
  libltdl 2.4.2
  libunistring 0.9.3
  gc 7.2alpha6
  libffi 3.0.10
  guile-2.0.3.152-c5f6c2

* gmp 5.0.2 has some configuration trouble on systems with recent
  coreutils utils installed. Could be worked around by setting NM=nm.
  It also has configuration trouble on bi-arch systems, that can be
  worked around by setting ABI=32.
  It also has configuration trouble on MacOS X 10.5 and mingw, that
  requires effort to work around.

* libintl 0.18.1.1 has configuration trouble on Solaris 11: must use
  --with-included-gettext, otherwise the gettext() function never actually
  returns the translations.

* libffi 3.0.10 has configuration trouble on OpenBSD, NetBSD, Solaris 11.
  Must use --disable-builddir as workaround.
  Also "make check" shows lots of test failures on Linux/SPARC64,
  NetBSD 5.1, Cygwin 1.7.9.

* gc 7.2alpha6 has compilation trouble and doesn't work reliably on
  NetBSD 5.1/x86 and on mingw.

Now about the configuration of guile itself.


1) On nearly all platforms, guile's configure does not find the libgc or
libffi library, although these packages were configured and installed
with the same --prefix as guile. The culprit is PKG_CONFIG_PATH.
guile's installation instruction don't mention it:

  - INSTALL doesn't mention PKG_CONFIG_PATH.

  - README mentions PKG_CONFIG_PATH only in the section "Using Guile
    Without Installing It", which is not my situation.

  - README's section "Required External Packages" mentions pkg-config,
    but it suggest to set BDW_GC_CFLAGS, BDW_GC_LIBS, LIBFFI_CFLAGS,
    LIBFFI_LIBS, which is even *more* complicated than setting
    PKG_CONFIG_PATH.

    How about changing that section to mention
      1) that pkg-config ought to be installed before libffi and libgc?
      2) that usually setting PKG_CONFIG_PATH to include
           $BDW_LIBDIR/pkgconfig:$LIBFFI_LIBDIR/pkgconfig:/usr/lib/pkgconfig
         will work,
      3) the BDW_GC_CFLAGS, BDW_GC_LIBS, LIBFFI_CFLAGS, LIBFFI_LIBS
         approach as a last resort.


2) On Linux/glibc/PowerPC, MacOS X 10.5, Cygwin, I happen not to have
pkg-config installed. But I have installed all the other packages!
The configuration fails:

checking for pkg-config... no
checking for LIBFFI... configure: error: in `/home/haible/multibuild-1614/linuxppc32/guile-2.0.3.152-c5f6c2':
configure: error: The pkg-config script could not be found or is too old.  Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.

Isn't this a *gratuitous* build dependency?

Suggestion: Add code to configure.ac that searches for an installed
library, like it does for libgmp and libunistring (via
AC_LIB_HAVE_LINKFLAGS), before searching via pkg-config.

I won't install pkg-config. If you want me to test guile on Linux/PowerPC,
MacOS X 10.5, Cygwin, and mingw, provide an alternative.


3) On Solaris 11, the build fails:

$ make
...
Making all in libguile
make: Fatal error in reader: Makefile, line 3443: Macro assignment on dependency line
Current working directory /home/bruno/multibuild-1610/solaris11x8664/guile-2.0.3.152-c5f6c2/libguile
*** Error code 1

The line about which the Solaris 'make' is complaining is the blank line
between these two rules in libguile/Makefile:


.c.i:
        $(AM_V_GEN)$(GREP) '^VM_DEFINE' $< > $@

install-exec-hook:
        rm -f $(DESTDIR)$(bindir)/guile-snarf.awk
#    $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES) \
#    guile-procedures.txt guile.texi


The workaround is to use GNU make.


4) On Solaris 11 (both x86 and x86_64), the compilation fails in the
directory libguile:

  CC     libguile_2.0_la-filesys.lo
filesys.c: In function 'scm_readdir':
filesys.c:1716:34: error: 'DIR' has no member named 'dd_fd'
gmake[3]: *** [libguile_2.0_la-filesys.lo] Error 1

Instead of whacking your own implementation of dirfd, why not just
use the 'dirfd' module from gnulib? (Actually Solaris 11 has dirfd(),
it is declared as a function in <dirent.h>.) See
http://www.gnu.org/software/gnulib/manual/html_node/dirfd.html


5) On OpenBSD 4.6/SPARC64, compilation failure in libguile directory:

  CC     libguile_2.0_la-i18n.lo
i18n.c: In function `define_langinfo_items':
i18n.c:1747: error: `ERA' undeclared (first use in this function)
i18n.c:1747: error: (Each undeclared identifier is reported only once
i18n.c:1747: error: for each function it appears in.)
i18n.c:1748: error: `ERA_D_FMT' undeclared (first use in this function)
i18n.c:1749: error: `ERA_D_T_FMT' undeclared (first use in this function)
i18n.c:1751: error: `ERA_T_FMT' undeclared (first use in this function)
i18n.c:1753: error: `ALT_DIGITS' undeclared (first use in this function)
gmake[3]: *** [libguile_2.0_la-i18n.lo] Error 1

This could be easily fixed by including the gnulib module 'nl_langinfo'. See
http://www.gnu.org/software/gnulib/manual/html_node/nl_005flanginfo.html


6) On Linux/IA-64, compilation failure in libguile directory:

  CC     libguile_2.0_la-threads.lo
threads.c: In function 'guilify_self_1':
threads.c:554: error: 'struct GC_stack_base' has no member named 'reg'
make[3]: *** [libguile_2.0_la-threads.lo] Error 1

On this platform, gc/gc.h contains this definition:

/* Structure representing the base of a thread stack.  On most          */
/* platforms this contains just a single address.                       */
struct GC_stack_base {
  void * mem_base; /* Base of memory stack. */
# if defined(__ia64) || defined(__ia64__) || defined(_M_IA64)
    void * reg_base; /* Base of separate register stack. */
# endif
};

It looks like a typo in threads.c:554. Fix: s/reg-base/reg_base/


7) On NetBSD 5.1/x86_64, build failure:

Making all in module
  GUILEC ice-9/eval.go
GC Warning: Out of Memory! Heap size: 248 MiB. Returning NULL!
[1]   Segmentation fault (core dumped) GUILE_AUTO_COMPI...
*** Error code 139

What's the reason of an "Out of Memory"? The machine has 3 GB RAM, and
ca. 650 MB RAM and 6 GB of swap are free.


8) On Linux/hppa and Linux/SPARC32 and Linux/IA-64, build failure in the
libguile directory:

  SNARF  socket.doc
  SNARF  regex-posix.doc
  GEN    guile-procedures.texi
/bin/sh: line 1:  1022 Broken pipe             cat alist.doc arbiters.doc array-handle.doc array-map.doc arrays.doc async.doc backtrace.doc boolean.doc bitvectors.doc bytevectors.doc chars.doc control.doc continuations.doc debug.doc deprecated.doc deprecation.doc dynl.doc dynwind.doc eq.doc error.doc eval.doc evalext.doc expand.doc extensions.doc feature.doc filesys.doc fluids.doc foreign.doc fports.doc gc-malloc.doc gc.doc gettext.doc generalized-arrays.doc generalized-vectors.doc goops.doc gsubr.doc guardians.doc hash.doc hashtab.doc hooks.doc i18n.doc init.doc ioext.doc keywords.doc list.doc load.doc macros.doc mallocs.doc memoize.doc modules.doc numbers.doc objprop.doc options.doc pairs.doc ports.doc print.doc procprop.doc procs.doc promises.doc r6rs-ports.doc random.doc rdelim.doc read.doc root.doc rw.doc scmsigs.doc script.doc simpos.doc smob.doc sort.doc srcprop.doc srfi-1.doc srfi-4.doc srfi-13.doc srfi-14.doc srfi-60.doc stackchk.doc stacks.doc stime.doc strings.doc strorder.doc strports.doc struct.doc symbols.doc threads.doc throw.doc trees.doc uniform.doc values.doc variable.doc vectors.doc version.doc vports.doc weaks.doc dynl.doc posix.doc net_db.doc socket.doc regex-posix.doc
      1023 Segmentation fault      | GUILE_AUTO_COMPILE=0 ../meta/uninstalled-env guild snarf-check-and-output-texi > guile-procedures.texi
make[3]: *** [guile-procedures.texi] Error 1


9) Test failure on Linux/glibc/i386 (32-bit build on a x86_64 machine):

FAIL: gc.test: gc: Lexical vars are collectable

Totals for this test run:
passes:                 34887
failures:               1
unexpected passes:      0
expected failures:      30
unresolved test cases:  18
untested test cases:    1
unsupported test cases: 9
errors:                 0


10) Linux/glibc/x86_64

All tests passed.

(This must be the platform that all guile developers use, I guess?)


Bruno

Information forwarded to bug-guile <at> gnu.org:
bug#10520; Package guile. (Mon, 16 Jan 2012 01:56:01 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Bruno Haible <bruno <at> clisp.org>
To: bug-guile <at> gnu.org
Cc: Andy Wingo <wingo <at> pobox.com>,
	Ludovic Courtès <ludo <at> gnu.org>
Subject: Re: [platform-testers] Guile 2.0.4 release imminent
Date: Mon, 16 Jan 2012 02:54:27 +0100
PS: More failures:

11) On Solaris 11, "make check" gives 1 test failure:

gmake[5]: Entering directory `/home/bruno/multibuild-1614/solaris11x8632/guile-2.0.3.152-c5f6c2/test-suite/standalone'
PASS: test-system-cmds
PASS: test-bad-identifiers
PASS: test-require-extension
usage: tail [+/-[n][lbc][f]] [file]
       tail [+/-[n][l][r|f]] [file]
Incorrect output: expected "a;", but got ""
FAIL: test-guile-snarf

The 'tail' program in Solaris does not understand the modern syntax.

$ printf 'a\nb\nc\nd\ne\n' | tail -n +2
usage: tail [+/-[n][lbc][f]] [file]
       tail [+/-[n][l][r|f]] [file]
$ printf 'a\nb\nc\nd\ne\n' | tail -n 2
usage: tail [+/-[n][lbc][f]] [file]
       tail [+/-[n][l][r|f]] [file]
$ printf 'a\nb\nc\nd\ne\n' | sed 1d
b
c
d
e

So I would suggest to replace "tail -n +2" with "sed 1d".


12) Still on Solaris 11, "make check" gives more test failures:

Running gc.test
FAIL: gc.test: gc: Lexical vars are collectable

Running net-db.test
ERROR: net-db.test: getaddrinfo: 127.0.0.1:80 - arguments: ((getaddrinfo-error 8))
ERROR: net-db.test: getaddrinfo: port 80 - arguments: ((getaddrinfo-error 8))

Running time.test
FAIL: time.test: strftime: C99 %z format: EST+5

Totals for this test run:
passes:                 34338
failures:               2
unexpected passes:      0
expected failures:      30
unresolved test cases:  562
untested test cases:    1
unsupported test cases: 11
errors:                 2


Bruno





Information forwarded to bug-guile <at> gnu.org:
bug#10520; Package guile. (Mon, 16 Jan 2012 23:10:02 GMT) Full text and rfc822 format available.

Message #11 received at 10520 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Bruno Haible <bruno <at> clisp.org>
Cc: Andy Wingo <wingo <at> pobox.com>, 10520 <at> debbugs.gnu.org
Subject: Re: [platform-testers] Guile 2.0.4 release imminent
Date: Tue, 17 Jan 2012 00:08:13 +0100
retitle 2.0.3+ portability issues
thanks


Hi Bruno,

Thanks for the quick and detailed report!

Bruno Haible <bruno <at> clisp.org> skribis:

[...]

>     How about changing that section to mention
>       1) that pkg-config ought to be installed before libffi and libgc?
>       2) that usually setting PKG_CONFIG_PATH to include
>            $BDW_LIBDIR/pkgconfig:$LIBFFI_LIBDIR/pkgconfig:/usr/lib/pkgconfig
>          will work,
>       3) the BDW_GC_CFLAGS, BDW_GC_LIBS, LIBFFI_CFLAGS, LIBFFI_LIBS
>          approach as a last resort.

I’ve done something along these lines:

  http://git.savannah.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=ad17b1551241a0fbaa9f9557016cbe440cc6338b

> 2) On Linux/glibc/PowerPC, MacOS X 10.5, Cygwin, I happen not to have
> pkg-config installed. But I have installed all the other packages!
> The configuration fails:

[...]

> Isn't this a *gratuitous* build dependency?

Isn’t this a gratuitous troll?  ;-)

Seriously, I understand your frustration.  Yet, we use upstream’s method
to check for package availability, whether we like it or not.

> I won't install pkg-config. If you want me to test guile on Linux/PowerPC,
> MacOS X 10.5, Cygwin, and mingw, provide an alternative.

One can define $BDW_GC_LIB, etc. as described in the manual.  Would that
work for you?

> 4) On Solaris 11 (both x86 and x86_64),

Do you mean OpenIndiana or something?

> the compilation fails in the directory libguile:
>
>   CC     libguile_2.0_la-filesys.lo
> filesys.c: In function 'scm_readdir':
> filesys.c:1716:34: error: 'DIR' has no member named 'dd_fd'
> gmake[3]: *** [libguile_2.0_la-filesys.lo] Error 1
>
> Instead of whacking your own implementation of dirfd, why not just
> use the 'dirfd' module from gnulib? (Actually Solaris 11 has dirfd(),
> it is declared as a function in <dirent.h>.) See
> http://www.gnu.org/software/gnulib/manual/html_node/dirfd.html

Done:

  http://git.savannah.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=f0007cade095c5a2878ebbb8ea8c9b40810e4509

Funnily, Solaris 2.10 (as available on the OpenCSW machines) doesn’t
have this problem.

> 5) On OpenBSD 4.6/SPARC64, compilation failure in libguile directory:
>
>   CC     libguile_2.0_la-i18n.lo
> i18n.c: In function `define_langinfo_items':
> i18n.c:1747: error: `ERA' undeclared (first use in this function)
> i18n.c:1747: error: (Each undeclared identifier is reported only once
> i18n.c:1747: error: for each function it appears in.)
> i18n.c:1748: error: `ERA_D_FMT' undeclared (first use in this function)
> i18n.c:1749: error: `ERA_D_T_FMT' undeclared (first use in this function)
> i18n.c:1751: error: `ERA_T_FMT' undeclared (first use in this function)
> i18n.c:1753: error: `ALT_DIGITS' undeclared (first use in this function)
> gmake[3]: *** [libguile_2.0_la-i18n.lo] Error 1

This was fixed in the meantime:

  http://git.savannah.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=1bd9a697b186c9a2c84f7c1028c9292f779ec79a

> This could be easily fixed by including the gnulib module 'nl_langinfo'. See
> http://www.gnu.org/software/gnulib/manual/html_node/nl_005flanginfo.html

I considered using it some time ago but decided not to, as the comment
in i18n.c says:

   Note: We don't use Gnulib's `nl_langinfo' module because it's currently not
   as complete as the compatibility hacks in `i18n.scm'.  */

> 6) On Linux/IA-64, compilation failure in libguile directory:
>
>   CC     libguile_2.0_la-threads.lo
> threads.c: In function 'guilify_self_1':
> threads.c:554: error: 'struct GC_stack_base' has no member named 'reg'
> make[3]: *** [libguile_2.0_la-threads.lo] Error 1
>
> On this platform, gc/gc.h contains this definition:
>
> /* Structure representing the base of a thread stack.  On most          */
> /* platforms this contains just a single address.                       */
> struct GC_stack_base {
>   void * mem_base; /* Base of memory stack. */
> # if defined(__ia64) || defined(__ia64__) || defined(_M_IA64)
>     void * reg_base; /* Base of separate register stack. */
> # endif
> };
>
> It looks like a typo in threads.c:554. Fix: s/reg-base/reg_base/

Indeed!

  http://git.savannah.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=bbd210517f12fdabb51e0dc2527ba186bb1ba549

> 7) On NetBSD 5.1/x86_64, build failure:

Will investigate later.

> 8) On Linux/hppa and Linux/SPARC32 and Linux/IA-64, build failure in the
> libguile directory:
>
>   SNARF  socket.doc
>   SNARF  regex-posix.doc
>   GEN    guile-procedures.texi
> /bin/sh: line 1:  1022 Broken pipe             cat alist.doc arbiters.doc array-handle.doc array-map.doc arrays.doc async.doc backtrace.doc boolean.doc bitvectors.doc bytevectors.doc chars.doc control.doc continuations.doc debug.doc deprecated.doc deprecation.doc dynl.doc dynwind.doc eq.doc error.doc eval.doc evalext.doc expand.doc extensions.doc feature.doc filesys.doc fluids.doc foreign.doc fports.doc gc-malloc.doc gc.doc gettext.doc generalized-arrays.doc generalized-vectors.doc goops.doc gsubr.doc guardians.doc hash.doc hashtab.doc hooks.doc i18n.doc init.doc ioext.doc keywords.doc list.doc load.doc macros.doc mallocs.doc memoize.doc modules.doc numbers.doc objprop.doc options.doc pairs.doc ports.doc print.doc procprop.doc procs.doc promises.doc r6rs-ports.doc random.doc rdelim.doc read.doc root.doc rw.doc scmsigs.doc script.doc simpos.doc smob.doc sort.doc srcprop.doc srfi-1.doc srfi-4.doc srfi-13.doc srfi-14.doc srfi-60.doc stackchk.doc stacks.doc stime.doc strings.doc strorder.doc strports.doc struct.doc symbols.doc threads.doc throw.doc trees.doc uniform.doc values.doc variable.doc vectors.doc version.doc vports.doc weaks.doc dynl.doc posix.doc net_db.doc socket.doc regex-posix.doc
>       1023 Segmentation fault      | GUILE_AUTO_COMPILE=0 ../meta/uninstalled-env guild snarf-check-and-output-texi > guile-procedures.texi
> make[3]: *** [guile-procedures.texi] Error 1

I reproduced the problem on SPARC64 and am investigating (2.0.1 works
well on this platform, so this looks like a regression.)

> 9) Test failure on Linux/glibc/i386 (32-bit build on a x86_64 machine):
>
> FAIL: gc.test: gc: Lexical vars are collectable

This is a known “problem”, and harmless.

> 10) Linux/glibc/x86_64
>
> All tests passed.
>
> (This must be the platform that all guile developers use, I guess?)

Heheh.

Thanks,
Ludo’.




Information forwarded to bug-guile <at> gnu.org:
bug#10520; Package guile. (Mon, 16 Jan 2012 23:45:02 GMT) Full text and rfc822 format available.

Message #14 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Bruno Haible <bruno <at> clisp.org>
To: bug-guile <at> gnu.org
Cc: Andy Wingo <wingo <at> pobox.com>,
	Ludovic Courtès <ludo <at> gnu.org>
Subject: Re: [platform-testers] Guile 2.0.4 release imminent
Date: Tue, 17 Jan 2012 00:44:10 +0100
PS: More portability problems:

13) On Solaris 11/x86_64, "make check" hangs:
...
Running texinfo.string-utils.test
Running texinfo.test
Running threads.test

The process
  guile-2.0.3.152-c5f6c2/libguile/.libs/guile --debug --no-auto-compile -e main -s guile-2.0.3.152-c5f6c2/test-suite/guile-test --test-suite guile-2.0.3.152-c5f6c2/test-suite/tests --log-file check-guile.log
is running for more than 16 hours, not eating CPU time, but with a lot of
memory: 144 MB virtual size, 120 MB in RAM.


Bruno





Information forwarded to bug-guile <at> gnu.org:
bug#10520; Package guile. (Mon, 16 Jan 2012 23:45:02 GMT) Full text and rfc822 format available.

Message #17 received at 10520 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Bruno Haible <bruno <at> clisp.org>
Cc: Andy Wingo <wingo <at> pobox.com>, 10520 <at> debbugs.gnu.org
Subject: Re: [platform-testers] Guile 2.0.4 release imminent
Date: Tue, 17 Jan 2012 00:43:44 +0100
Bruno Haible <bruno <at> clisp.org> skribis:

> 11) On Solaris 11, "make check" gives 1 test failure:
>
> gmake[5]: Entering directory `/home/bruno/multibuild-1614/solaris11x8632/guile-2.0.3.152-c5f6c2/test-suite/standalone'
> PASS: test-system-cmds
> PASS: test-bad-identifiers
> PASS: test-require-extension
> usage: tail [+/-[n][lbc][f]] [file]
>        tail [+/-[n][l][r|f]] [file]
> Incorrect output: expected "a;", but got ""
> FAIL: test-guile-snarf
>
> The 'tail' program in Solaris does not understand the modern syntax.

This was fixed in the meantime as well:

  http://git.savannah.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=25dc93dd575994fabdcfb558521d3287f604f081

Thanks,
Ludo’.




Information forwarded to bug-guile <at> gnu.org:
bug#10520; Package guile. (Tue, 17 Jan 2012 00:24:01 GMT) Full text and rfc822 format available.

Message #20 received at 10520 <at> debbugs.gnu.org (full text, mbox):

From: Bruno Haible <bruno <at> clisp.org>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Andy Wingo <wingo <at> pobox.com>, 10520 <at> debbugs.gnu.org
Subject: Re: [platform-testers] Guile 2.0.4 release imminent
Date: Tue, 17 Jan 2012 01:22:52 +0100
Hi Ludo,

> Thanks for the quick and detailed report!

Another set of platforms is being tested right now.

  --------------------------------------------------

About configuration of the dependencies:

> >     How about changing that section to mention
> >       1) that pkg-config ought to be installed before libffi and libgc?
> >       2) that usually setting PKG_CONFIG_PATH to include
> >            $BDW_LIBDIR/pkgconfig:$LIBFFI_LIBDIR/pkgconfig:/usr/lib/pkgconfig
> >          will work,
> >       3) the BDW_GC_CFLAGS, BDW_GC_LIBS, LIBFFI_CFLAGS, LIBFFI_LIBS
> >          approach as a last resort.
> 
> I’ve done something along these lines:
> 
>   http://git.savannah.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=ad17b1551241a0fbaa9f9557016cbe440cc6338b

Hmm, two comments about your advice
  PKG_CONFIG_PATH=/path/to/libgc/lib/pkgconfig:/path/to/libffi/lib/pkgconfig

- When the packages are installed on a bi-arch system, in $prefix/lib64/
  (or, on Solaris, $prefix/lib/64/), then the pkgconfig dir is a subdir
  of that directory. More precisely, if the package was installed with
  --libdir=$LIBFFI_LIBDIR, then the dir to use is $LIBFFI_LIBDIR/pkgconfig.

- If the user sets this variable and then forgets about it, and it does not
  contain /usr/lib/pkgconfig or /usr/lib64/pkgconfig, then AFAIU other
  packages installed in /usr/lib[64] will no longer be found.

> > 2) On Linux/glibc/PowerPC, MacOS X 10.5, Cygwin, I happen not to have
> > pkg-config installed. But I have installed all the other packages!
> > The configuration fails:
> 
> [...]
> 
> > Isn't this a *gratuitous* build dependency?
> 
> Isn’t this a gratuitous troll?  ;-)

Given the size of the thread about this topic in gnu-prog-discuss, it
is not gratuitous to talk about it.

> Seriously, I understand your frustration.  Yet, we use upstream’s method
> to check for package availability, whether we like it or not.

You can do better than that.

> > I won't install pkg-config. If you want me to test guile on Linux/PowerPC,
> > MacOS X 10.5, Cygwin, and mingw, provide an alternative.
> 
> One can define $BDW_GC_LIB, etc. as described in the manual.  Would that
> work for you?

This is even more work, no thanks.

I mean, after I installed the prerequisite packages with the same --prefix,
guile found libiconv, libintl, libunistring, libgmp all automatically,
without any further ado - because you are using the gnulib module 'havelib'.
For packages as simple as libffi and gc, these macros will work as well.

Can't you just change 

  PKG_CHECK_MODULES(LIBFFI, libffi)

to

  AC_LIB_HAVE_LINKFLAGS([ffi],
    [],
    [#include <ffi.h>
     #include <stdlib.h>],
    [ffi_call (NULL, NULL, NULL, NULL);])
  if test "$HAVE_LIBFFI" = yes; then
    LIBFFI_CFLAGS=          # CPPFLAGS already augmented
    LIBFFI_LIBS="$LTLIBFFI" # since linking is done with libtool
  else
    PKG_CHECK_MODULES(LIBFFI, libffi)
  fi

and similarly for libgc.

If this gets too complicated, I can extend the gnulib 'havelib' module to
also invoke pkg-config when the search in the various directories failed.

  --------------------------------------------------

> > 4) On Solaris 11 (both x86 and x86_64),
> 
> Do you mean OpenIndiana or something?

No, I meant Oracle Solaris 11, released on 2011-11-09. Cf.
http://en.wikipedia.org/wiki/Solaris_(operating_system)
http://www.oracle.com/technetwork/server-storage/solaris11/downloads/index.html

But I warn you: with this OS, before you have a usable system,
you have to learn how to use their package manager. Otherwise,
no gcc, no development tools.

  --------------------------------------------------

> > This could be easily fixed by including the gnulib module 'nl_langinfo'. See
> > http://www.gnu.org/software/gnulib/manual/html_node/nl_005flanginfo.html
> 
> I considered using it some time ago but decided not to, as the comment
> in i18n.c says:
> 
>    Note: We don't use Gnulib's `nl_langinfo' module because it's currently not
>    as complete as the compatibility hacks in `i18n.scm'.  */

If you are not satisfied with the contents of a particular gnulib module,
please by all means say so on the bug-gnulib list. I beg you. Then the
enhancements will not only profit guile but also other packages.

  --------------------------------------------------

> > 9) Test failure on Linux/glibc/i386 (32-bit build on a x86_64 machine):
> >
> > FAIL: gc.test: gc: Lexical vars are collectable
> 
> This is a known “problem”, and harmless.

Then, why not change the test so that it only prints a warning message,
and always succeeds?

  --------------------------------------------------

Bruno





Information forwarded to bug-guile <at> gnu.org:
bug#10520; Package guile. (Tue, 17 Jan 2012 15:03:01 GMT) Full text and rfc822 format available.

Message #23 received at 10520 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Bruno Haible <bruno <at> clisp.org>
Cc: Andy Wingo <wingo <at> pobox.com>, 10520 <at> debbugs.gnu.org
Subject: Re: [platform-testers] Guile 2.0.4 release imminent
Date: Tue, 17 Jan 2012 16:01:33 +0100
[Message part 1 (text/plain, inline)]
Hi Bruno,

Bruno Haible <bruno <at> clisp.org> skribis:

>> >     How about changing that section to mention
>> >       1) that pkg-config ought to be installed before libffi and libgc?
>> >       2) that usually setting PKG_CONFIG_PATH to include
>> >            $BDW_LIBDIR/pkgconfig:$LIBFFI_LIBDIR/pkgconfig:/usr/lib/pkgconfig
>> >          will work,
>> >       3) the BDW_GC_CFLAGS, BDW_GC_LIBS, LIBFFI_CFLAGS, LIBFFI_LIBS
>> >          approach as a last resort.
>> 
>> I’ve done something along these lines:
>> 
>>   http://git.savannah.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=ad17b1551241a0fbaa9f9557016cbe440cc6338b
>
> Hmm, two comments about your advice
>   PKG_CONFIG_PATH=/path/to/libgc/lib/pkgconfig:/path/to/libffi/lib/pkgconfig
>
> - When the packages are installed on a bi-arch system, in $prefix/lib64/
>   (or, on Solaris, $prefix/lib/64/), then the pkgconfig dir is a subdir
>   of that directory. More precisely, if the package was installed with
>   --libdir=$LIBFFI_LIBDIR, then the dir to use is $LIBFFI_LIBDIR/pkgconfig.
>
> - If the user sets this variable and then forgets about it, and it does not
>   contain /usr/lib/pkgconfig or /usr/lib64/pkgconfig, then AFAIU other
>   packages installed in /usr/lib[64] will no longer be found.

I know, I know.  I really view README as a hint, in the hope that the
user will understand that /path/to/libgc/lib/pkgconfig will have to be
replaced by the correct file name.  I don’t think another convention,
such as writing $LIBFFI_LIBDIR, really helps.

>> > 2) On Linux/glibc/PowerPC, MacOS X 10.5, Cygwin, I happen not to have
>> > pkg-config installed. But I have installed all the other packages!
>> > The configuration fails:
>> 
>> [...]
>> 
>> > Isn't this a *gratuitous* build dependency?
>> 
>> Isn’t this a gratuitous troll?  ;-)
>
> Given the size of the thread about this topic in gnu-prog-discuss, it
> is not gratuitous to talk about it.
>
>> Seriously, I understand your frustration.  Yet, we use upstream’s method
>> to check for package availability, whether we like it or not.
>
> You can do better than that.

[...]

> Can't you just change 
>
>   PKG_CHECK_MODULES(LIBFFI, libffi)
>
> to
>
>   AC_LIB_HAVE_LINKFLAGS([ffi],
>     [],
>     [#include <ffi.h>
>      #include <stdlib.h>],
>     [ffi_call (NULL, NULL, NULL, NULL);])
>   if test "$HAVE_LIBFFI" = yes; then
>     LIBFFI_CFLAGS=          # CPPFLAGS already augmented
>     LIBFFI_LIBS="$LTLIBFFI" # since linking is done with libtool
>   else
>     PKG_CHECK_MODULES(LIBFFI, libffi)
>   fi
>
> and similarly for libgc.

The problem we could run into, by not using libffi’s and BDW-GC’s
recommended methods, is that we could miss CFLAGS, CPPFLAGS, or LDFLAGS
that appear in their .pc files.

Thus, it seems more robust to configure these packages the way they are
meant to be configured, rather than do our own guesswork.

WDYT?

Perhaps the pkg-config discussion should actually be moved to bug-gnulib
or bug-standards, because it’s beyond Guile’s scope.

> No, I meant Oracle Solaris 11, released on 2011-11-09. Cf.
> http://en.wikipedia.org/wiki/Solaris_(operating_system)
> http://www.oracle.com/technetwork/server-storage/solaris11/downloads/index.html
>
> But I warn you: with this OS, before you have a usable system,
> you have to learn how to use their package manager. Otherwise,
> no gcc, no development tools.

Hmm, OK, noted!

>> > This could be easily fixed by including the gnulib module 'nl_langinfo'. See
>> > http://www.gnu.org/software/gnulib/manual/html_node/nl_005flanginfo.html
>> 
>> I considered using it some time ago but decided not to, as the comment
>> in i18n.c says:
>> 
>>    Note: We don't use Gnulib's `nl_langinfo' module because it's currently not
>>    as complete as the compatibility hacks in `i18n.scm'.  */
>
> If you are not satisfied with the contents of a particular gnulib module,
> please by all means say so on the bug-gnulib list. I beg you. Then the
> enhancements will not only profit guile but also other packages.

Yes, sure.  It turns out that i18n.{c,scm} in Guile predate the
‘langinfo’ module in Gnulib, and Guile’s needs may be different than
those of other packages.

Actually, I have a stash here to do that (see below), but I can’t
remember why I didn’t apply it.  I’ll try again and report back.

>> > 9) Test failure on Linux/glibc/i386 (32-bit build on a x86_64 machine):
>> >
>> > FAIL: gc.test: gc: Lexical vars are collectable
>> 
>> This is a known “problem”, and harmless.
>
> Then, why not change the test so that it only prints a warning message,
> and always succeeds?

This is being discussed elsewhere:

  http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10336
  http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9900#35

Thanks,
Ludo’.

[Message part 2 (text/x-patch, inline)]
	Modified configure.ac
diff --git a/configure.ac b/configure.ac
index 35e902c..8fcea88 100644
--- a/configure.ac
+++ b/configure.ac
@@ -663,13 +663,13 @@ AC_SUBST([SCM_I_GSC_HAVE_STRUCT_DIRENT64])
 #   machine/fpu.h - on Tru64 5.1b, the declaration of fesetround(3) is in
 #     this file instead of <fenv.h>
 #   process.h - mingw specific
-#   langinfo.h, nl_types.h - SuS v2
+#   nl_types.h - SuS v2
 #
 AC_CHECK_HEADERS([complex.h fenv.h io.h libc.h limits.h malloc.h memory.h process.h string.h \
 regex.h rxposix.h rx/rxposix.h sys/dir.h sys/ioctl.h sys/select.h \
 sys/time.h sys/timeb.h sys/times.h sys/stdtypes.h sys/types.h \
 sys/utime.h time.h unistd.h utime.h pwd.h grp.h sys/utsname.h \
-direct.h langinfo.h nl_types.h machine/fpu.h])
+direct.h nl_types.h machine/fpu.h])
 
 # "complex double" is new in C99, and "complex" is only a keyword if
 # <complex.h> is included
@@ -763,10 +763,9 @@ AC_CHECK_HEADERS([assert.h crt_externs.h])
 #   isblank - available as a GNU extension or in C99
 #   _NSGetEnviron - Darwin specific
 #   strcoll_l, newlocale - GNU extensions (glibc), also available on Darwin
-#   nl_langinfo - X/Open, not available on Windows.
 #   utimensat: posix.1-2008
 #
-AC_CHECK_FUNCS([DINFINITY DQNAN cexp chsize clog clog10 ctermid fesetround ftime ftruncate fchown getcwd geteuid getsid gettimeofday gmtime_r ioctl lstat mkdir mknod nice pipe _pipe readdir_r readdir64_r readlink rename rmdir select setegid seteuid setlocale setpgid setsid sigaction siginterrupt stat64 strftime strptime symlink sync sysconf tcgetpgrp tcsetpgrp times uname waitpid strdup system usleep atexit on_exit chown link fcntl ttyname getpwent getgrent kill getppid getpgrp fork setitimer getitimer strchr strcmp index bcopy memcpy rindex truncate unsetenv isblank _NSGetEnviron strcoll strcoll_l newlocale nl_langinfo utimensat])
+AC_CHECK_FUNCS([DINFINITY DQNAN cexp chsize clog clog10 ctermid fesetround ftime ftruncate fchown getcwd geteuid getsid gettimeofday gmtime_r ioctl lstat mkdir mknod nice pipe _pipe readdir_r readdir64_r readlink rename rmdir select setegid seteuid setlocale setpgid setsid sigaction siginterrupt stat64 strftime strptime symlink sync sysconf tcgetpgrp tcsetpgrp times uname waitpid strdup system usleep atexit on_exit chown link fcntl ttyname getpwent getgrent kill getppid getpgrp fork setitimer getitimer strchr strcmp index bcopy memcpy rindex truncate unsetenv isblank _NSGetEnviron strcoll strcoll_l newlocale utimensat])
 
 # Reasons for testing:
 #   netdb.h - not in mingw
	Modified lib/Makefile.am
diff --git a/lib/Makefile.am b/lib/Makefile.am
index b9f4f8a..648a62e 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -9,7 +9,7 @@
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=3 --libtool --macro-prefix=gl --no-vc-files alignof alloca-opt announce-gen autobuild byteswap canonicalize-lgpl duplocale environ extensions flock fpieee full-read full-write gendocs getaddrinfo gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton lib-symbol-versions lib-symbol-visibility libunistring locale maintainer-makefile putenv stdlib strcase strftime striconveh string sys_stat verify version-etc-fsf vsnprintf warnings
+# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=3 --libtool --macro-prefix=gl --no-vc-files alignof alloca-opt announce-gen autobuild byteswap canonicalize-lgpl duplocale environ extensions flock fpieee full-read full-write gendocs getaddrinfo gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton lib-symbol-versions lib-symbol-visibility libunistring locale maintainer-makefile nl_langinfo putenv stdlib strcase strftime striconveh string sys_stat verify version-etc-fsf vsnprintf warnings
 
 AUTOMAKE_OPTIONS = 1.5 gnits subdir-objects
 
@@ -449,6 +449,34 @@ EXTRA_libgnu_la_SOURCES += inet_pton.c
 
 ## end   gnulib module inet_pton
 
+## begin gnulib module langinfo
+
+BUILT_SOURCES += langinfo.h
+
+# We need the following in order to create an empty placeholder for
+# <langinfo.h> when the system doesn't have one.
+langinfo.h: langinfo.in.h $(WARN_ON_USE_H)
+	$(AM_V_GEN)rm -f $@-t $@ && \
+	{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+	  sed -e 's|@''HAVE_LANGINFO_H''@|$(HAVE_LANGINFO_H)|g' \
+	      -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+	      -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+	      -e 's|@''NEXT_LANGINFO_H''@|$(NEXT_LANGINFO_H)|g' \
+	      -e 's|@''GNULIB_NL_LANGINFO''@|$(GNULIB_NL_LANGINFO)|g' \
+	      -e 's|@''HAVE_LANGINFO_CODESET''@|$(HAVE_LANGINFO_CODESET)|g' \
+	      -e 's|@''HAVE_LANGINFO_ERA''@|$(HAVE_LANGINFO_ERA)|g' \
+	      -e 's|@''HAVE_NL_LANGINFO''@|$(HAVE_NL_LANGINFO)|g' \
+	      -e 's|@''REPLACE_NL_LANGINFO''@|$(REPLACE_NL_LANGINFO)|g' \
+	      -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+	      < $(srcdir)/langinfo.in.h; \
+	} > $@-t && \
+	mv $@-t $@
+MOSTLYCLEANFILES += langinfo.h langinfo.h-t
+
+EXTRA_DIST += langinfo.in.h
+
+## end   gnulib module langinfo
+
 ## begin gnulib module lib-symbol-visibility
 
 # The value of $(CFLAG_VISIBILITY) needs to be added to the CFLAGS for the
@@ -680,6 +708,15 @@ EXTRA_DIST += netinet_in.in.h
 
 ## end   gnulib module netinet_in
 
+## begin gnulib module nl_langinfo
+
+
+EXTRA_DIST += nl_langinfo.c
+
+EXTRA_libgnu_la_SOURCES += nl_langinfo.c
+
+## end   gnulib module nl_langinfo
+
 ## begin gnulib module pathmax
 
 
	New      lib/langinfo.in.h
diff --git a/lib/langinfo.in.h b/lib/langinfo.in.h
new file mode 100644
index 0000000..6d15f2f
--- /dev/null
+++ b/lib/langinfo.in.h
@@ -0,0 +1,162 @@
+/* Substitute for and wrapper around <langinfo.h>.
+   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+/*
+ * POSIX <langinfo.h> for platforms that lack it or have an incomplete one.
+ * <http://www.opengroup.org/onlinepubs/9699919799/basedefs/langinfo.h.html>
+ */
+
+#ifndef _GL_LANGINFO_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+
+/* The include_next requires a split double-inclusion guard.  */
+#if @HAVE_LANGINFO_H@
+# @INCLUDE_NEXT@ @NEXT_LANGINFO_H@
+#endif
+
+#ifndef _GL_LANGINFO_H
+#define _GL_LANGINFO_H
+
+
+#if !@HAVE_LANGINFO_H@
+
+/* A platform that lacks <langinfo.h>.  */
+
+/* Assume that it also lacks <nl_types.h> and the nl_item type.  */
+typedef int nl_item;
+
+/* nl_langinfo items of the LC_CTYPE category */
+# define CODESET     10000
+/* nl_langinfo items of the LC_NUMERIC category */
+# define RADIXCHAR   10001
+# define THOUSEP     10002
+/* nl_langinfo items of the LC_TIME category */
+# define D_T_FMT     10003
+# define D_FMT       10004
+# define T_FMT       10005
+# define T_FMT_AMPM  10006
+# define AM_STR      10007
+# define PM_STR      10008
+# define DAY_1       10009
+# define DAY_2       (DAY_1 + 1)
+# define DAY_3       (DAY_1 + 2)
+# define DAY_4       (DAY_1 + 3)
+# define DAY_5       (DAY_1 + 4)
+# define DAY_6       (DAY_1 + 5)
+# define DAY_7       (DAY_1 + 6)
+# define ABDAY_1     10016
+# define ABDAY_2     (ABDAY_1 + 1)
+# define ABDAY_3     (ABDAY_1 + 2)
+# define ABDAY_4     (ABDAY_1 + 3)
+# define ABDAY_5     (ABDAY_1 + 4)
+# define ABDAY_6     (ABDAY_1 + 5)
+# define ABDAY_7     (ABDAY_1 + 6)
+# define MON_1       10023
+# define MON_2       (MON_1 + 1)
+# define MON_3       (MON_1 + 2)
+# define MON_4       (MON_1 + 3)
+# define MON_5       (MON_1 + 4)
+# define MON_6       (MON_1 + 5)
+# define MON_7       (MON_1 + 6)
+# define MON_8       (MON_1 + 7)
+# define MON_9       (MON_1 + 8)
+# define MON_10      (MON_1 + 9)
+# define MON_11      (MON_1 + 10)
+# define MON_12      (MON_1 + 11)
+# define ABMON_1     10035
+# define ABMON_2     (ABMON_1 + 1)
+# define ABMON_3     (ABMON_1 + 2)
+# define ABMON_4     (ABMON_1 + 3)
+# define ABMON_5     (ABMON_1 + 4)
+# define ABMON_6     (ABMON_1 + 5)
+# define ABMON_7     (ABMON_1 + 6)
+# define ABMON_8     (ABMON_1 + 7)
+# define ABMON_9     (ABMON_1 + 8)
+# define ABMON_10    (ABMON_1 + 9)
+# define ABMON_11    (ABMON_1 + 10)
+# define ABMON_12    (ABMON_1 + 11)
+# define ERA         10047
+# define ERA_D_FMT   10048
+# define ERA_D_T_FMT 10049
+# define ERA_T_FMT   10050
+# define ALT_DIGITS  10051
+/* nl_langinfo items of the LC_MONETARY category */
+# define CRNCYSTR    10052
+/* nl_langinfo items of the LC_MESSAGES category */
+# define YESEXPR     10053
+# define NOEXPR      10054
+
+#else
+
+/* A platform that has <langinfo.h>.  */
+
+# if !@HAVE_LANGINFO_CODESET@
+#  define CODESET     10000
+#  define GNULIB_defined_CODESET 1
+# endif
+
+# if !@HAVE_LANGINFO_ERA@
+#  define ERA         10047
+#  define ERA_D_FMT   10048
+#  define ERA_D_T_FMT 10049
+#  define ERA_T_FMT   10050
+#  define ALT_DIGITS  10051
+#  define GNULIB_defined_ERA 1
+# endif
+
+#endif
+
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
+/* Declare overridden functions.  */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Return a piece of locale dependent information.
+   Note: The difference between nl_langinfo (CODESET) and locale_charset ()
+   is that the latter normalizes the encoding names to GNU conventions.  */
+
+#if @GNULIB_NL_LANGINFO@
+# if @REPLACE_NL_LANGINFO@
+#  undef nl_langinfo
+#  define nl_langinfo rpl_nl_langinfo
+# endif
+# if !@HAVE_NL_LANGINFO@ || @REPLACE_NL_LANGINFO@
+extern char *nl_langinfo (nl_item item);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef nl_langinfo
+# if HAVE_RAW_DECL_NL_LANGINFO
+_GL_WARN_ON_USE (nl_langinfo, "nl_langinfo is not portable - "
+                 "use gnulib module nl_langinfo for portability");
+# endif
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* _GL_LANGINFO_H */
+#endif /* _GL_LANGINFO_H */
	New      lib/nl_langinfo.c
diff --git a/lib/nl_langinfo.c b/lib/nl_langinfo.c
new file mode 100644
index 0000000..0c02346
--- /dev/null
+++ b/lib/nl_langinfo.c
@@ -0,0 +1,260 @@
+/* nl_langinfo() replacement: query locale dependent information.
+
+   Copyright (C) 2007-2010 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU Lesser General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <langinfo.h>
+
+#if REPLACE_NL_LANGINFO
+
+/* Override nl_langinfo with support for added nl_item values.  */
+
+# include <locale.h>
+# include <string.h>
+
+# undef nl_langinfo
+
+char *
+rpl_nl_langinfo (nl_item item)
+{
+  switch (item)
+    {
+# if GNULIB_defined_CODESET
+    case CODESET:
+      {
+        const char *locale;
+        static char buf[2 + 10 + 1];
+
+        locale = setlocale (LC_CTYPE, NULL);
+        if (locale != NULL && locale[0] != '\0')
+          {
+            /* If the locale name contains an encoding after the dot, return
+               it.  */
+            const char *dot = strchr (locale, '.');
+
+            if (dot != NULL)
+              {
+                const char *modifier;
+
+                dot++;
+                /* Look for the possible @... trailer and remove it, if any.  */
+                modifier = strchr (dot, '@');
+                if (modifier == NULL)
+                  return dot;
+                if (modifier - dot < sizeof (buf))
+                  {
+                    memcpy (buf, dot, modifier - dot);
+                    buf [modifier - dot] = '\0';
+                    return buf;
+                  }
+              }
+          }
+        return "";
+      }
+# endif
+# if GNULIB_defined_ERA
+    case ERA:
+      /* The format is not standardized.  In glibc it is a sequence of strings
+         of the form "direction:offset:start_date:end_date:era_name:era_format"
+         with an empty string at the end.  */
+      return "";
+    case ERA_D_FMT:
+      /* The %Ex conversion in strftime behaves like %x if the locale does not
+         have an alternative time format.  */
+      item = D_FMT;
+      break;
+    case ERA_D_T_FMT:
+      /* The %Ec conversion in strftime behaves like %c if the locale does not
+         have an alternative time format.  */
+      item = D_T_FMT;
+      break;
+    case ERA_T_FMT:
+      /* The %EX conversion in strftime behaves like %X if the locale does not
+         have an alternative time format.  */
+      item = T_FMT;
+      break;
+    case ALT_DIGITS:
+      /* The format is not standardized.  In glibc it is a sequence of 10
+         strings, appended in memory.  */
+      return "\0\0\0\0\0\0\0\0\0\0";
+# endif
+    default:
+      break;
+    }
+  return nl_langinfo (item);
+}
+
+#else
+
+/* Provide nl_langinfo from scratch.  */
+
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+
+/* Native Windows platforms.  */
+
+#  define WIN32_LEAN_AND_MEAN  /* avoid including junk */
+#  include <windows.h>
+
+#  include <stdio.h>
+
+# else
+
+/* An old Unix platform without locales, such as Linux libc5 or BeOS.  */
+
+# endif
+
+# include <locale.h>
+
+char *
+nl_langinfo (nl_item item)
+{
+  switch (item)
+    {
+    /* nl_langinfo items of the LC_CTYPE category */
+    case CODESET:
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+      {
+        static char buf[2 + 10 + 1];
+
+        /* Woe32 has a function returning the locale's codepage as a number.  */
+        sprintf (buf, "CP%u", GetACP ());
+        return buf;
+      }
+# elif defined __BEOS__
+      return "UTF-8";
+# else
+      return "ISO-8859-1";
+# endif
+    /* nl_langinfo items of the LC_NUMERIC category */
+    case RADIXCHAR:
+      return localeconv () ->decimal_point;
+    case THOUSEP:
+      return localeconv () ->thousands_sep;
+    /* nl_langinfo items of the LC_TIME category.
+       TODO: Really use the locale.  */
+    case D_T_FMT:
+    case ERA_D_T_FMT:
+      return "%a %b %e %H:%M:%S %Y";
+    case D_FMT:
+    case ERA_D_FMT:
+      return "%m/%d/%y";
+    case T_FMT:
+    case ERA_T_FMT:
+      return "%H:%M:%S";
+    case T_FMT_AMPM:
+      return "%I:%M:%S %p";
+    case AM_STR:
+      return "AM";
+    case PM_STR:
+      return "PM";
+    case DAY_1:
+      return "Sunday";
+    case DAY_2:
+      return "Monday";
+    case DAY_3:
+      return "Tuesday";
+    case DAY_4:
+      return "Wednesday";
+    case DAY_5:
+      return "Thursday";
+    case DAY_6:
+      return "Friday";
+    case DAY_7:
+      return "Saturday";
+    case ABDAY_1:
+      return "Sun";
+    case ABDAY_2:
+      return "Mon";
+    case ABDAY_3:
+      return "Tue";
+    case ABDAY_4:
+      return "Wed";
+    case ABDAY_5:
+      return "Thu";
+    case ABDAY_6:
+      return "Fri";
+    case ABDAY_7:
+      return "Sat";
+    case MON_1:
+      return "January";
+    case MON_2:
+      return "February";
+    case MON_3:
+      return "March";
+    case MON_4:
+      return "April";
+    case MON_5:
+      return "May";
+    case MON_6:
+      return "June";
+    case MON_7:
+      return "July";
+    case MON_8:
+      return "August";
+    case MON_9:
+      return "September";
+    case MON_10:
+      return "October";
+    case MON_11:
+      return "November";
+    case MON_12:
+      return "December";
+    case ABMON_1:
+      return "Jan";
+    case ABMON_2:
+      return "Feb";
+    case ABMON_3:
+      return "Mar";
+    case ABMON_4:
+      return "Apr";
+    case ABMON_5:
+      return "May";
+    case ABMON_6:
+      return "Jun";
+    case ABMON_7:
+      return "Jul";
+    case ABMON_8:
+      return "Aug";
+    case ABMON_9:
+      return "Sep";
+    case ABMON_10:
+      return "Oct";
+    case ABMON_11:
+      return "Nov";
+    case ABMON_12:
+      return "Dec";
+    case ERA:
+      return "";
+    case ALT_DIGITS:
+      return "\0\0\0\0\0\0\0\0\0\0";
+    /* nl_langinfo items of the LC_MONETARY category
+       TODO: Really use the locale. */
+    case CRNCYSTR:
+      return "-";
+    /* nl_langinfo items of the LC_MESSAGES category
+       TODO: Really use the locale. */
+    case YESEXPR:
+      return "^[yY]";
+    case NOEXPR:
+      return "^[nN]";
+    default:
+      return "";
+    }
+}
+
+#endif
	Modified libguile/Makefile.am
diff --git a/libguile/Makefile.am b/libguile/Makefile.am
index 206c4f4..6e0e7e5 100644
--- a/libguile/Makefile.am
+++ b/libguile/Makefile.am
@@ -443,7 +443,7 @@ noinst_HEADERS += vm-engine.c vm-i-system.c vm-i-scheme.c vm-i-loader.c
 libguile_la_DEPENDENCIES = @LIBLOBJS@
 libguile_la_LIBADD =				\
   @LIBLOBJS@ $(gnulib_library) $(LTLIBGMP)	\
-  $(LTLIBUNISTRING) $(LTLIBICONV)
+  $(LTLIBUNISTRING) $(LTLIBINTL) $(LTLIBICONV)
 libguile_la_LDFLAGS =											\
   @LTLIBINTL@ $(LIBFFI_LIBS) $(INET_NTOP_LIB) $(INET_PTON_LIB)						\
   $(GETADDRINFO_LIB) $(HOSTENT_LIB) $(SERVENT_LIB)							\
	Modified libguile/i18n.c
diff --git a/libguile/i18n.c b/libguile/i18n.c
index b381b05..4bf3764 100644
--- a/libguile/i18n.c
+++ b/libguile/i18n.c
@@ -59,8 +59,8 @@
 
 #include "libguile/posix.h"  /* for `scm_i_locale_mutex' */
 
-#if (defined HAVE_LANGINFO_H) && (defined HAVE_NL_TYPES_H)
-# include <langinfo.h>
+#include <langinfo.h>
+#ifdef HAVE_NL_TYPES_H
 # include <nl_types.h>
 #endif
 
@@ -209,7 +209,7 @@ SCM_GLOBAL_VARIABLE (scm_global_locale, "%global-locale");
 #define SCM_VALIDATE_OPTIONAL_LOCALE_COPY(_pos, _arg, _c_locale)	\
   do									\
     {									\
-      if ((_arg) != SCM_UNDEFINED)					\
+      if (!SCM_UNBNDP (_arg) && scm_is_true (_arg))			\
 	SCM_VALIDATE_LOCALE_COPY (_pos, _arg, _c_locale);		\
       else								\
 	(_c_locale) = NULL;						\
@@ -1472,14 +1472,11 @@ SCM_DEFINE (scm_nl_langinfo, "nl-langinfo", 1, 1, 0,
 	    "Reference Manual}).")
 #define FUNC_NAME s_scm_nl_langinfo
 {
-#ifdef HAVE_NL_LANGINFO
   SCM result;
   nl_item c_item;
   char *c_result;
   scm_t_locale c_locale;
-#ifdef HAVE_LANGINFO_CODESET
   char *codeset;
-#endif
 
   SCM_VALIDATE_INT_COPY (2, item, c_item);
   SCM_VALIDATE_OPTIONAL_LOCALE_COPY (2, locale, c_locale);
@@ -1496,9 +1493,7 @@ SCM_DEFINE (scm_nl_langinfo, "nl-langinfo", 1, 1, 0,
     {
 #ifdef USE_GNU_LOCALE_API
       c_result = nl_langinfo_l (c_item, c_locale);
-#ifdef HAVE_LANGINFO_CODESET
       codeset = nl_langinfo_l (CODESET, c_locale);
-#endif /* HAVE_LANGINFO_CODESET */
 #else /* !USE_GNU_LOCALE_API */
       /* We can't use `RUN_IN_LOCALE_SECTION ()' here because the locale
 	 mutex is already taken.  */
@@ -1523,9 +1518,7 @@ SCM_DEFINE (scm_nl_langinfo, "nl-langinfo", 1, 1, 0,
       else
 	{
 	  c_result = nl_langinfo (c_item);
-#ifdef HAVE_LANGINFO_CODESET
           codeset = nl_langinfo (CODESET);
-#endif /* HAVE_LANGINFO_CODESET */
 
 	  restore_locale_settings (&lsec_prev_locale);
 	  free_locale_settings (&lsec_prev_locale);
@@ -1535,9 +1528,7 @@ SCM_DEFINE (scm_nl_langinfo, "nl-langinfo", 1, 1, 0,
   else
     {
       c_result = nl_langinfo (c_item);
-#ifdef HAVE_LANGINFO_CODESET
       codeset = nl_langinfo (CODESET);
-#endif /* HAVE_LANGINFO_CODESET */
     }
 
   c_result = strdup (c_result);
@@ -1646,26 +1637,14 @@ SCM_DEFINE (scm_nl_langinfo, "nl-langinfo", 1, 1, 0,
 #endif
 
 	default:
-#ifdef HAVE_LANGINFO_CODESET
           result = scm_from_stringn (c_result, strlen (c_result),
                                      codeset,
                                      SCM_FAILED_CONVERSION_QUESTION_MARK);
-#else /* !HAVE_LANGINFO_CODESET */
-          /* This may be incorrectly encoded if the locale differs
-             from the c_locale.  */
-          result = scm_from_locale_string (c_result);
-#endif /* !HAVE_LANGINFO_CODESET */
           free (c_result);
 	}
     }
 
   return result;
-#else
-  scm_syserror_msg (FUNC_NAME, "`nl-langinfo' not supported on your system",
-		    SCM_EOL, ENOSYS);
-
-  return SCM_BOOL_F;
-#endif
 }
 #undef FUNC_NAME
 
@@ -1673,7 +1652,7 @@ SCM_DEFINE (scm_nl_langinfo, "nl-langinfo", 1, 1, 0,
 static inline void
 define_langinfo_items (void)
 {
-#if (defined HAVE_NL_TYPES_H) && (defined HAVE_LANGINFO_H)
+#ifdef HAVE_NL_TYPES_H
 
 #define DEFINE_NLITEM_CONSTANT(_item)		\
   scm_c_define (# _item, scm_from_int (_item))
@@ -1839,10 +1818,7 @@ scm_init_i18n ()
 {
   SCM global_locale_smob;
 
-#ifdef HAVE_NL_LANGINFO
-  scm_add_feature ("nl-langinfo");
   define_langinfo_items ();
-#endif
 
 #include "libguile/i18n.x"
 
	Modified m4/gnulib-cache.m4
diff --git a/m4/gnulib-cache.m4 b/m4/gnulib-cache.m4
index 3326fb9..d3eca04 100644
--- a/m4/gnulib-cache.m4
+++ b/m4/gnulib-cache.m4
@@ -15,7 +15,7 @@
 
 
 # Specification in the form of a command-line invocation:
-#   gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=3 --libtool --macro-prefix=gl --no-vc-files alignof alloca-opt announce-gen autobuild byteswap canonicalize-lgpl duplocale environ extensions flock fpieee full-read full-write gendocs getaddrinfo gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton lib-symbol-versions lib-symbol-visibility libunistring locale maintainer-makefile putenv stdlib strcase strftime striconveh string sys_stat verify version-etc-fsf vsnprintf warnings
+#   gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --lgpl=3 --libtool --macro-prefix=gl --no-vc-files alignof alloca-opt announce-gen autobuild byteswap canonicalize-lgpl duplocale environ extensions flock fpieee full-read full-write gendocs getaddrinfo gitlog-to-changelog gnu-web-doc-update gnupload havelib iconv_open-utf inet_ntop inet_pton lib-symbol-versions lib-symbol-visibility libunistring locale maintainer-makefile nl_langinfo putenv stdlib strcase strftime striconveh string sys_stat verify version-etc-fsf vsnprintf warnings
 
 # Specification in the form of a few gnulib-tool.m4 macro invocations:
 gl_LOCAL_DIR([])
@@ -47,6 +47,7 @@ gl_MODULES([
   libunistring
   locale
   maintainer-makefile
+  nl_langinfo
   putenv
   stdlib
   strcase
	Modified m4/gnulib-comp.m4
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index fc989b2..87825ce 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -89,6 +89,7 @@ AC_DEFUN([gl_INIT],
   gl_INET_PTON
   gl_ARPA_INET_MODULE_INDICATOR([inet_pton])
   gl_INLINE
+  gl_LANGINFO_H
   gl_LD_VERSION_SCRIPT
   gl_VISIBILITY
   gl_LIBUNISTRING
@@ -115,6 +116,8 @@ AC_DEFUN([gl_INIT],
   gl_HEADER_NETDB
   gl_HEADER_NETINET_IN
   AC_PROG_MKDIR_P
+  gl_FUNC_NL_LANGINFO
+  gl_LANGINFO_MODULE_INDICATOR([nl_langinfo])
   gl_PATHMAX
   gl_FUNC_PUTENV
   gl_STDLIB_MODULE_INDICATOR([putenv])
@@ -343,6 +346,7 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/iconveh.h
   lib/inet_ntop.c
   lib/inet_pton.c
+  lib/langinfo.in.h
   lib/localcharset.c
   lib/localcharset.h
   lib/locale.in.h
@@ -358,6 +362,7 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/memchr.valgrind
   lib/netdb.in.h
   lib/netinet_in.in.h
+  lib/nl_langinfo.c
   lib/pathmax.h
   lib/printf-args.c
   lib/printf-args.h
@@ -447,6 +452,7 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/inline.m4
   m4/intmax_t.m4
   m4/inttypes_h.m4
+  m4/langinfo_h.m4
   m4/ld-version-script.m4
   m4/lib-ld.m4
   m4/lib-link.m4
@@ -470,6 +476,7 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/multiarch.m4
   m4/netdb_h.m4
   m4/netinet_in_h.m4
+  m4/nl_langinfo.m4
   m4/pathmax.m4
   m4/printf.m4
   m4/putenv.m4
	New      m4/langinfo_h.m4
diff --git a/m4/langinfo_h.m4 b/m4/langinfo_h.m4
new file mode 100644
index 0000000..a4c5409
--- /dev/null
+++ b/m4/langinfo_h.m4
@@ -0,0 +1,74 @@
+# langinfo_h.m4 serial 3
+dnl Copyright (C) 2009, 2010 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_LANGINFO_H],
+[
+  AC_REQUIRE([gl_LANGINFO_H_DEFAULTS])
+
+  dnl Persuade glibc-2.0.6 <langinfo.h> to define CODESET.
+  AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+  gl_CHECK_NEXT_HEADERS([langinfo.h])
+
+  dnl Determine whether <langinfo.h> exists. It is missing on mingw and BeOS.
+  HAVE_LANGINFO_CODESET=0
+  HAVE_LANGINFO_ERA=0
+  AC_CHECK_HEADERS_ONCE([langinfo.h])
+  if test $ac_cv_header_langinfo_h = yes; then
+    HAVE_LANGINFO_H=1
+    dnl Determine what <langinfo.h> defines. CODESET and ERA etc. are missing
+    dnl on OpenBSD 3.8.
+    AC_CACHE_CHECK([whether langinfo.h defines CODESET],
+      [gl_cv_header_langinfo_codeset],
+      [AC_COMPILE_IFELSE(
+         [AC_LANG_PROGRAM([[#include <langinfo.h>
+int a = CODESET;
+]])],
+         [gl_cv_header_langinfo_codeset=yes],
+         [gl_cv_header_langinfo_codeset=no])
+      ])
+    if test $gl_cv_header_langinfo_codeset = yes; then
+      HAVE_LANGINFO_CODESET=1
+    fi
+    AC_CACHE_CHECK([whether langinfo.h defines ERA],
+      [gl_cv_header_langinfo_era],
+      [AC_COMPILE_IFELSE(
+         [AC_LANG_PROGRAM([[#include <langinfo.h>
+int a = ERA;
+]])],
+         [gl_cv_header_langinfo_era=yes],
+         [gl_cv_header_langinfo_era=no])
+      ])
+    if test $gl_cv_header_langinfo_era = yes; then
+      HAVE_LANGINFO_ERA=1
+    fi
+  else
+    HAVE_LANGINFO_H=0
+  fi
+  AC_SUBST([HAVE_LANGINFO_H])
+  AC_SUBST([HAVE_LANGINFO_CODESET])
+  AC_SUBST([HAVE_LANGINFO_ERA])
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[#include <langinfo.h>
+    ]], [nl_langinfo])
+])
+
+AC_DEFUN([gl_LANGINFO_MODULE_INDICATOR],
+[
+  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
+  AC_REQUIRE([gl_LANGINFO_H_DEFAULTS])
+  GNULIB_[]m4_translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])=1
+])
+
+AC_DEFUN([gl_LANGINFO_H_DEFAULTS],
+[
+  GNULIB_NL_LANGINFO=0;  AC_SUBST([GNULIB_NL_LANGINFO])
+  dnl Assume proper GNU behavior unless another module says otherwise.
+  HAVE_NL_LANGINFO=1;    AC_SUBST([HAVE_NL_LANGINFO])
+  REPLACE_NL_LANGINFO=0; AC_SUBST([REPLACE_NL_LANGINFO])
+])
	New      m4/nl_langinfo.m4
diff --git a/m4/nl_langinfo.m4 b/m4/nl_langinfo.m4
new file mode 100644
index 0000000..ad456a2
--- /dev/null
+++ b/m4/nl_langinfo.m4
@@ -0,0 +1,25 @@
+# nl_langinfo.m4 serial 3
+dnl Copyright (C) 2009, 2010 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_FUNC_NL_LANGINFO],
+[
+  AC_REQUIRE([gl_LANGINFO_H_DEFAULTS])
+  AC_REQUIRE([gl_LANGINFO_H])
+  AC_CHECK_FUNCS_ONCE([nl_langinfo])
+  if test $ac_cv_func_nl_langinfo = yes; then
+    if test $HAVE_LANGINFO_CODESET = 1 && test $HAVE_LANGINFO_ERA = 1; then
+      :
+    else
+      REPLACE_NL_LANGINFO=1
+      AC_DEFINE([REPLACE_NL_LANGINFO], [1],
+        [Define if nl_langinfo exists but is overridden by gnulib.])
+      AC_LIBOBJ([nl_langinfo])
+    fi
+  else
+    HAVE_NL_LANGINFO=0
+    AC_LIBOBJ([nl_langinfo])
+  fi
+])
	Modified module/ice-9/i18n.scm
diff --git a/module/ice-9/i18n.scm b/module/ice-9/i18n.scm
index 6fa31e4..8002656 100644
--- a/module/ice-9/i18n.scm
+++ b/module/ice-9/i18n.scm
@@ -100,13 +100,10 @@
 ;;;
 
 ;; Helper macro: Define a procedure named NAME that maps its argument to
-;; NL-ITEMS (when `nl-langinfo' is provided) or DEFAULTS (when `nl-langinfo'
-;; is not provided).
-(define-macro (define-vector-langinfo-mapping name nl-items defaults)
+;; NL-ITEMS (when `nl-langinfo' is provided).
+(define-macro (define-vector-langinfo-mapping name nl-items)
   (let* ((item-count (length nl-items))
-         (defines    (if (provided? 'nl-langinfo)
-                         `(define %nl-items (vector #f ,@nl-items))
-                         `(define %defaults (vector #f ,@defaults))))
+         (defines   `(define %nl-items (vector #f ,@nl-items)))
          (make-body (lambda (result)
                       `(if (and (integer? item) (exact? item))
                            (if (and (>= item 1) (<= item ,item-count))
@@ -115,28 +112,21 @@
                            (throw 'wrong-type-arg "wrong argument type" item)))))
     `(define (,name item . locale)
        ,defines
-       ,(make-body (if (provided? 'nl-langinfo)
-                       '(apply nl-langinfo (vector-ref %nl-items item) locale)
-                       '(vector-ref %defaults item))))))
+       ,(make-body '(apply nl-langinfo (vector-ref %nl-items item) locale)))))
 
 
 (define-vector-langinfo-mapping locale-day-short
-  (ABDAY_1 ABDAY_2 ABDAY_3 ABDAY_4 ABDAY_5 ABDAY_6 ABDAY_7)
-  ("Sun" "Mon" "Tue" "Wed" "Thu" "Fri" "Sat"))
+  (ABDAY_1 ABDAY_2 ABDAY_3 ABDAY_4 ABDAY_5 ABDAY_6 ABDAY_7))
 
 (define-vector-langinfo-mapping locale-day
-  (DAY_1 DAY_2 DAY_3 DAY_4 DAY_5 DAY_6 DAY_7)
-  ("Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday"))
+  (DAY_1 DAY_2 DAY_3 DAY_4 DAY_5 DAY_6 DAY_7))
 
 (define-vector-langinfo-mapping locale-month-short
   (ABMON_1 ABMON_2 ABMON_3 ABMON_4 ABMON_5 ABMON_6
-   ABMON_7 ABMON_8 ABMON_9 ABMON_10 ABMON_11 ABMON_12)
-  ("Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oct" "Nov" "Dec"))
+   ABMON_7 ABMON_8 ABMON_9 ABMON_10 ABMON_11 ABMON_12))
 
 (define-vector-langinfo-mapping locale-month
-  (MON_1 MON_2 MON_3 MON_4 MON_5 MON_6 MON_7 MON_8 MON_9 MON_10 MON_11 MON_12)
-  ("January" "February" "March" "April" "May" "June" "July" "August"
-   "September" "October" "November" "December"))
+  (MON_1 MON_2 MON_3 MON_4 MON_5 MON_6 MON_7 MON_8 MON_9 MON_10 MON_11 MON_12))
 
 
 
@@ -145,35 +135,34 @@
 ;;;
 
 ;; Helper macro: Define a procedure NAME that gets langinfo item ITEM.
-(define-macro (define-simple-langinfo-mapping name item default)
-  (let ((body (if (and (provided? 'nl-langinfo) (defined? item))
-                  `(apply nl-langinfo ,item locale)
-                  default)))
-    `(define (,name . locale)
-       ,body)))
+(define-syntax define-simple-langinfo-mapping
+  (syntax-rules ()
+    ((_ name item)
+     (define* (name #:optional locale)
+       (nl-langinfo item locale)))))
 
 (define-simple-langinfo-mapping locale-am-string
-  AM_STR "AM")
+  AM_STR)
 (define-simple-langinfo-mapping locale-pm-string
-  PM_STR "PM")
+  PM_STR)
 (define-simple-langinfo-mapping locale-date+time-format
-  D_T_FMT "%a %b %e %H:%M:%S %Y")
+  D_T_FMT)
 (define-simple-langinfo-mapping locale-date-format
-  D_FMT   "%m/%d/%y")
+  D_FMT)
 (define-simple-langinfo-mapping locale-time-format
-  T_FMT   "%H:%M:%S")
+  T_FMT)
 (define-simple-langinfo-mapping locale-time+am/pm-format
-  T_FMT_AMPM "%I:%M:%S %p")
+  T_FMT_AMPM)
 (define-simple-langinfo-mapping locale-era
-  ERA        "")
+  ERA)
 (define-simple-langinfo-mapping locale-era-year
-  ERA_YEAR   "")
+  ERA_YEAR)
 (define-simple-langinfo-mapping locale-era-date+time-format
-  ERA_D_T_FMT "")
+  ERA_D_T_FMT)
 (define-simple-langinfo-mapping locale-era-date-format
-  ERA_D_FMT   "")
+  ERA_D_FMT)
 (define-simple-langinfo-mapping locale-era-time-format
-  ERA_T_FMT   "")
+  ERA_T_FMT)
 
 
 


Information forwarded to bug-guile <at> gnu.org:
bug#10520; Package guile. (Sat, 21 Jan 2012 12:11:01 GMT) Full text and rfc822 format available.

Message #26 received at 10520 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Bruno Haible <bruno <at> clisp.org>
Cc: Andy Wingo <wingo <at> pobox.com>, 10520 <at> debbugs.gnu.org
Subject: Re: bug#10520: [platform-testers] Guile 2.0.4 release imminent
Date: Sat, 21 Jan 2012 13:10:29 +0100
[Message part 1 (text/plain, inline)]
Hi Bruno,

Bruno Haible <bruno <at> clisp.org> skribis:

> 8) On Linux/hppa and Linux/SPARC32 and Linux/IA-64, build failure in the
> libguile directory:
>
>   SNARF  socket.doc
>   SNARF  regex-posix.doc
>   GEN    guile-procedures.texi
> /bin/sh: line 1:  1022 Broken pipe             cat alist.doc arbiters.doc array-handle.doc array-map.doc arrays.doc async.doc backtrace.doc boolean.doc bitvectors.doc bytevectors.doc chars.doc control.doc continuations.doc debug.doc deprecated.doc deprecation.doc dynl.doc dynwind.doc eq.doc error.doc eval.doc evalext.doc expand.doc extensions.doc feature.doc filesys.doc fluids.doc foreign.doc fports.doc gc-malloc.doc gc.doc gettext.doc generalized-arrays.doc generalized-vectors.doc goops.doc gsubr.doc guardians.doc hash.doc hashtab.doc hooks.doc i18n.doc init.doc ioext.doc keywords.doc list.doc load.doc macros.doc mallocs.doc memoize.doc modules.doc numbers.doc objprop.doc options.doc pairs.doc ports.doc print.doc procprop.doc procs.doc promises.doc r6rs-ports.doc random.doc rdelim.doc read.doc root.doc rw.doc scmsigs.doc script.doc simpos.doc smob.doc sort.doc srcprop.doc srfi-1.doc srfi-4.doc srfi-13.doc srfi-14.doc srfi-60.doc stackchk.doc stacks.doc stime.doc strings.doc strorder.doc strports.doc struct.doc symbols.doc threads.doc throw.doc trees.doc uniform.doc values.doc variable.doc vectors.doc version.doc vports.doc weaks.doc dynl.doc posix.doc net_db.doc socket.doc regex-posix.doc
>       1023 Segmentation fault      | GUILE_AUTO_COMPILE=0 ../meta/uninstalled-env guild snarf-check-and-output-texi > guile-procedures.texi
> make[3]: *** [guile-procedures.texi] Error 1

I bisected this and found this harmless-looking patch to be the culprit:

  http://git.savannah.gnu.org/cgit/guile.git/commit/?id=3e54fdfc217969abb50a46ec9c9c5c02a2c7d369

The segfault would occur in vm-i-system.c:1281, in the ‘CACHE_PROGRAM’
macro, while trying to access ‘SCM_PROGRAM_DATA’, because of a bogus
value for ‘program’, stemming from a bogus ‘fp’.

After a long and tiring period of investigation, I found that reverting
just the definitions SCM_FRAME_DYNAMIC_LINK and
SCM_FRAME_SET_DYNAMIC_LINK would solve the problem.

Eventually, I found that, keeping frames.h unchanged, adding a compiler
barrier after each ‘fp’ assignment would solve the problem:

[Message part 2 (text/x-patch, inline)]
diff --git a/libguile/vm-i-system.c b/libguile/vm-i-system.c
index 474fe78..a47ac38 100644
--- a/libguile/vm-i-system.c
+++ b/libguile/vm-i-system.c
@@ -55,6 +55,7 @@ VM_DEFINE_INSTRUCTION (1, halt, "halt", 0, 0, 0)
        stack */
     ip = SCM_FRAME_RETURN_ADDRESS (fp);
     fp = SCM_FRAME_DYNAMIC_LINK (fp);
+    asm volatile ("");
     NULLSTACK (old_sp - sp);
   }
   
@@ -1267,6 +1268,7 @@ VM_DEFINE_INSTRUCTION (67, return, "return", 0, 1, 1)
     sp = SCM_FRAME_LOWER_ADDRESS (fp);
     ip = SCM_FRAME_RETURN_ADDRESS (fp);
     fp = SCM_FRAME_DYNAMIC_LINK (fp);
+    asm volatile ("");
 
 #ifdef VM_ENABLE_STACK_NULLING
     NULLSTACK (old_sp - sp);
@@ -1302,6 +1304,7 @@ VM_DEFINE_INSTRUCTION (68, return_values, "return/values", 1, -1, -1)
       sp = SCM_FRAME_LOWER_ADDRESS (fp) - 1;
       ip = SCM_FRAME_MV_RETURN_ADDRESS (fp);
       fp = SCM_FRAME_DYNAMIC_LINK (fp);
+      asm volatile ("");
         
       /* Push return values, and the number of values */
       for (i = 0; i < nvalues; i++)
@@ -1322,6 +1325,7 @@ VM_DEFINE_INSTRUCTION (68, return_values, "return/values", 1, -1, -1)
       sp = SCM_FRAME_LOWER_ADDRESS (fp) - 1;
       ip = SCM_FRAME_RETURN_ADDRESS (fp);
       fp = SCM_FRAME_DYNAMIC_LINK (fp);
+      asm volatile ("");
         
       /* Push first value */
       *++sp = vals[1];
[Message part 3 (text/plain, inline)]
This is not entirely satisfactory either, because I don’t see why this
barrier would be needed.  It could be a GCC bug, as this file is a real
stress test.  Ideas?

Unless someone comes up with a better idea, I’ll commit a portable
version of the above patch.

(Tested on sparc64-unknown-linux-gnu and hppa2.0-unknown-linux-gnu.)

Thanks,
Ludo’.

Information forwarded to bug-guile <at> gnu.org:
bug#10520; Package guile. (Sat, 21 Jan 2012 12:14:02 GMT) Full text and rfc822 format available.

Message #29 received at 10520 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: bug#10520 <10520 <at> debbugs.gnu.org>
Subject: Re: Status: [platform-testers] Guile 2.0.4 release imminent
Date: Sat, 21 Jan 2012 13:13:09 +0100
retitle 10520 2.0.3+ portability issues

thanks




Reply sent to ludo <at> gnu.org (Ludovic Courtès):
You have taken responsibility. (Tue, 24 Jan 2012 22:55:02 GMT) Full text and rfc822 format available.

Notification sent to Bruno Haible <bruno <at> clisp.org>:
bug acknowledged by developer. (Tue, 24 Jan 2012 22:55:02 GMT) Full text and rfc822 format available.

Message #34 received at 10520-done <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Bruno Haible <bruno <at> clisp.org>
Cc: Andy Wingo <wingo <at> pobox.com>, 10520-done <at> debbugs.gnu.org
Subject: Re: bug#10520: [platform-testers] Guile 2.0.4 release imminent
Date: Tue, 24 Jan 2012 23:53:35 +0100
Hi Bruno,

ludo <at> gnu.org (Ludovic Courtès) skribis:

> Bruno Haible <bruno <at> clisp.org> skribis:
>
>> 8) On Linux/hppa and Linux/SPARC32 and Linux/IA-64, build failure in the
>> libguile directory:
>>
>>   SNARF  socket.doc
>>   SNARF  regex-posix.doc
>>   GEN    guile-procedures.texi
>> /bin/sh: line 1:  1022 Broken pipe             cat alist.doc arbiters.doc array-handle.doc array-map.doc arrays.doc async.doc backtrace.doc boolean.doc bitvectors.doc bytevectors.doc chars.doc control.doc continuations.doc debug.doc deprecated.doc deprecation.doc dynl.doc dynwind.doc eq.doc error.doc eval.doc evalext.doc expand.doc extensions.doc feature.doc filesys.doc fluids.doc foreign.doc fports.doc gc-malloc.doc gc.doc gettext.doc generalized-arrays.doc generalized-vectors.doc goops.doc gsubr.doc guardians.doc hash.doc hashtab.doc hooks.doc i18n.doc init.doc ioext.doc keywords.doc list.doc load.doc macros.doc mallocs.doc memoize.doc modules.doc numbers.doc objprop.doc options.doc pairs.doc ports.doc print.doc procprop.doc procs.doc promises.doc r6rs-ports.doc random.doc rdelim.doc read.doc root.doc rw.doc scmsigs.doc script.doc simpos.doc smob.doc sort.doc srcprop.doc srfi-1.doc srfi-4.doc srfi-13.doc srfi-14.doc srfi-60.doc stackchk.doc stacks.doc stime.doc strings.doc strorder.doc strports.doc struct.doc symbols.doc threads.doc throw.doc trees.doc uniform.doc values.doc variable.doc vectors.doc version.doc vports.doc weaks.doc dynl.doc posix.doc net_db.doc socket.doc regex-posix.doc
>>       1023 Segmentation fault      | GUILE_AUTO_COMPILE=0 ../meta/uninstalled-env guild snarf-check-and-output-texi > guile-procedures.texi
>> make[3]: *** [guile-procedures.texi] Error 1
>
> I bisected this and found this harmless-looking patch to be the culprit:
>
>   http://git.savannah.gnu.org/cgit/guile.git/commit/?id=3e54fdfc217969abb50a46ec9c9c5c02a2c7d369
>
> The segfault would occur in vm-i-system.c:1281, in the ‘CACHE_PROGRAM’
> macro, while trying to access ‘SCM_PROGRAM_DATA’, because of a bogus
> value for ‘program’, stemming from a bogus ‘fp’.
>
> After a long and tiring period of investigation, I found that reverting
> just the definitions SCM_FRAME_DYNAMIC_LINK and
> SCM_FRAME_SET_DYNAMIC_LINK would solve the problem.
>
> Eventually, I found that, keeping frames.h unchanged, adding a compiler
> barrier after each ‘fp’ assignment would solve the problem:

I’ve checked this in:

  http://git.sv.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=2b264d7e4fb649955ade1814527b6eb6f34f4e18

Closing the bug, because I think bugs were all addressed.  Let us know
if you think I got it wrong!

Thanks,
Ludo’.




Information forwarded to bug-guile <at> gnu.org:
bug#10520; Package guile. (Sun, 29 Jan 2012 21:25:01 GMT) Full text and rfc822 format available.

Message #37 received at 10520 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Bruno Haible <bruno <at> clisp.org>
Cc: Andy Wingo <wingo <at> pobox.com>, 10520 <at> debbugs.gnu.org
Subject: Re: bug#10520: [platform-testers] Guile 2.0.4 release imminent
Date: Sun, 29 Jan 2012 22:24:13 +0100
Hello,

ludo <at> gnu.org (Ludovic Courtès) skribis:

> Eventually, I found that, keeping frames.h unchanged, adding a compiler
> barrier after each ‘fp’ assignment would solve the problem:

For the record, compiling with -fno-strict-aliasing solves the problem
too, and possibly other similar issues, so we took that route for the
moment (commit f5ea0499a411309014475dc7f7983e827f431af2).

Thanks,
Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 27 Feb 2012 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 68 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.