GIT source build failure: wcwidth.c::_wcwidth misses __locale_cjk_lang()

Hans-Bernhard Bröker
Mon Aug 22 21:23:00 GMT 2016

Hello Corinna,

Am 22.08.2016 um 11:29 schrieb Corinna Vinschen:
> On Aug 22 00:18, Hans-Bernhard Bröker wrote:
>> Am 21.08.2016 um 20:15 schrieb Corinna Vinschen:

>> [Now subscribed to newlib list to follow this there, too]
> Cool!  I think we can drop the cygwin ML list from CC then.

Fine with me.

>>> A big problem for many people keeping them from provide patches to the
>>> configury is that newlib's build system still requires the automake
>>> --cygnus option, which isn't supported by automake for quite some time.
>> And one of the effects of --cygnus is: to enables option "no-dependencies",
>> thus turning off dependency tracking.  Hrmpf.
> Oh!  I really didn't know that.

I didn't either, until I looked it up and found

	info Automake-1.11 Cygnus

So here's the slightly amended recipe, as discovered so far:

>> 1) Get rid of for'cygnus' options. In all 134 replace
>> by 	AUTOMAKE_OPTIONS = foreign no-installinfo no-dist
>> and delete cygnus from one or two AM_INIT([]) calls, too
>> 2) autoupdate in newlib, using autoconf-2.69 and automake-1.15

2.1) fix some breakage inserted by autoupdate (LT_INIT wants to be 
updated manually, some spurious __au_m4_changequote()),
2.2) repeat from 2) until no more errors

>> 3) autoreconf in newlib, using autoconf-2.69 and automake-1.15

3.1) add AM_PROG_AS to acinclude.m4, or autoreconf refuses to work
3.2) repeat from 3) until no more errors

> If you're willing to provide a patch, the patch does not have to contain
> the generated files.  I would create them locally and push the result.

Well, OK, so here goes. The core of the modification is best expressed 
as a pseudo shell script (don't run this without double-checking it!)

cd newlib
find . -type f -name '' | \
   xargs sed -i -e '/AUTOMAKE_OPTIONS.*=/s/cygnus/foreign no-installinfo 
cd ..

and then apply the attached patch 
"newlib-de-cygnussify-remaining-patch.diff" for the finer details, fix 
auto-tools to latest versions, then autoupdate, autoreconf.

>> main::scan_file() called too early to check prototype at
>> /usr/bin/aclocal-1.11 line 644.
> Yeah, I was already wondering about this.  Patches *extremely* gratefully
> accepted.

All I can see off-hand is that scan_file() calls itself recursively in 
that line 644, which would tend to explain that message.  aclocal-1.12 
gets rid of that by adding prototype declarations (lines 156 ff.). 
Back-porting most of those prototypes into 1.11.6 appears to get rid of 
this warning without too much pain.

A real Perl programmer should look over this, though.

>> That did not work for me. config/override.m4 insisted rather strictly that
>> only 2.64 is allowed to be used.  I shredded lines 30ff. from that file to
>> get past that one.
> Same here.  Neither Jeff nor I are autotools experts, so we would be
> mightly happy if we could get patches to pull the repo to a newer
> autotools state.

Well, FWIW, the attached lift-autconf-version-restriction.diff bluntly 
removes that restriction.  I won't guarante the absence of any adverse 
effect, thoughe ;-)

And just in case: yes, all these patches are free for unrestricted used 
by the public.
-------------- next part --------------
diff --git a/config/override.m4 b/config/override.m4
index 52bd1c3..3af7e21 100644
--- a/config/override.m4
+++ b/config/override.m4
@@ -27,27 +27,6 @@ AC_DEFUN([AC_PREREQ], [frob])
 m4_copy_force([_AC_PREREQ], [AC_PREREQ])
-dnl Ensure exactly this Autoconf version is used
-  [m4_define([_GCC_AUTOCONF_VERSION], [2.64])])
-dnl Test for the exact version when AC_INIT is expanded.
-dnl This allows to update the tree in steps (for testing)
-dnl by putting
-dnl   m4_define([_GCC_AUTOCONF_VERSION], [X.Y])
-dnl in before AC_INIT,
-dnl without rewriting this file.
-dnl Or for updating the whole tree at once with the definition above.
-  m4_defn([m4_PACKAGE_VERSION]), [],
-  [m4_fatal([Please use exactly Autoconf ]_GCC_AUTOCONF_VERSION[ instead of ]m4_defn([m4_PACKAGE_VERSION])[.])])
-m4_define([AC_INIT], m4_defn([AC_INIT])[
 dnl Ensure we do not use a buggy M4.
 m4_if(m4_index([..wi.d.], [.d.]), [-1],
   [m4_fatal(m4_do([m4 with buggy strstr detected.  Please install
-------------- next part --------------
diff --git a/newlib/acinclude.m4 b/newlib/acinclude.m4
index 10671f8..ced86dc 100644
--- a/newlib/acinclude.m4
+++ b/newlib/acinclude.m4
@@ -110,7 +110,7 @@ AC_SUBST(newlib_basedir)
-AM_INIT_AUTOMAKE([cygnus no-define 1.9.5])
+AM_INIT_AUTOMAKE([foreign no-installinfo no-dist no-define])
 # FIXME: We temporarily define our own version of AC_PROG_CC.  This is
 # copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS.  We
@@ -187,6 +187,7 @@ ac_given_INSTALL=$INSTALL
 # We need AC_EXEEXT to keep automake happy in cygnus mode.  However,
 # at least currently, we never actually build a program, so we never
diff --git a/newlib/ b/newlib/
index 01c6367..e16271a 100644
--- a/newlib/
+++ b/newlib/
@@ -1,7 +1,7 @@
 dnl This is the newlib file.
 dnl Process this file with autoconf to produce a configure script.
 AC_CONFIG_HEADERS([_newlib_version.h:_newlib_version.hin newlib.h:newlib.hin])
@@ -227,8 +227,7 @@ _LT_DECL_SED
 if test "${use_libtool}" = "yes"; then
 dnl The following is being disabled because the mathfp library is

More information about the Newlib mailing list