public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* GIT source build failure: wcwidth.c::_wcwidth misses __locale_cjk_lang()
@ 2016-08-21  4:01 Hans-Bernhard Bröker
  2016-08-21 15:04 ` Corinna Vinschen
  0 siblings, 1 reply; 5+ messages in thread
From: Hans-Bernhard Bröker @ 2016-08-21  4:01 UTC (permalink / raw)
  To: cygwin

Hello everyone,

FWIW, I can't get the current may git clone of Cygwin to build on the 
current release version of itself: (64-bit "Current" on Win10):

/home/hbbro/prg/cygwin/bld/x86_64-unknown-cygwin/newlib/libc/libc.a(lib_a-wcwidth.o): 
In function `__wcwidth':
/home/hbbro/prg/cygwin/bld/x86_64-unknown-cygwin/newlib/libc/string/../../../../../newlib-cygwin/newlib/libc/string/wcwidth.c:301: 
undefined reference to `__locale_cjk_lang'
/home/hbbro/prg/cygwin/bld/x86_64-unknown-cygwin/newlib/libc/citrin/../../../../../newlib-cygwin/newlib/libc/string/wcwidth.c:301:(.text+0xa4):relocation 
truncated to fit: R_X86_64_PC32 against undefined symbol `__locale_cjk_lang'
collect2: error: ld returned 1 exit status
make: *** [Makefile:670: cygwin0.dll] Error 1


Adding

	#include "../locale/setlocale.h"
	
in libc/string/wcwidth.c appears to fix this.


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: GIT source build failure: wcwidth.c::_wcwidth misses __locale_cjk_lang()
  2016-08-21  4:01 GIT source build failure: wcwidth.c::_wcwidth misses __locale_cjk_lang() Hans-Bernhard Bröker
@ 2016-08-21 15:04 ` Corinna Vinschen
  2016-08-21 15:25   ` Hans-Bernhard Bröker
  0 siblings, 1 reply; 5+ messages in thread
From: Corinna Vinschen @ 2016-08-21 15:04 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 2193 bytes --]

Hi Hans-Bernhard,

On Aug 21 00:09, Hans-Bernhard Bröker wrote:
> Hello everyone,
> 
> FWIW, I can't get the current may git clone of Cygwin to build on the
> current release version of itself: (64-bit "Current" on Win10):
> 
> /home/hbbro/prg/cygwin/bld/x86_64-unknown-cygwin/newlib/libc/libc.a(lib_a-wcwidth.o):
> In function `__wcwidth':
> /home/hbbro/prg/cygwin/bld/x86_64-unknown-cygwin/newlib/libc/string/../../../../../newlib-cygwin/newlib/libc/string/wcwidth.c:301:
> undefined reference to `__locale_cjk_lang'
> /home/hbbro/prg/cygwin/bld/x86_64-unknown-cygwin/newlib/libc/citrin/../../../../../newlib-cygwin/newlib/libc/string/wcwidth.c:301:(.text+0xa4):relocation
> truncated to fit: R_X86_64_PC32 against undefined symbol `__locale_cjk_lang'
> collect2: error: ld returned 1 exit status
> make: *** [Makefile:670: cygwin0.dll] Error 1
> 
> 
> Adding
> 
> 	#include "../locale/setlocale.h"
> 	
> in libc/string/wcwidth.c appears to fix this.

thanks for the report, but I can't reproduce this.  I can build Cygwin
fine natively as well as on Linux, with and without optimization.

gcc -H shows how setlocale.h is already included via the inclusion of
./local.h --> ../ctype/local.h (simplified for readability):

  newlib/libc/string/wcwidth.c
  . newlib/libc/string/local.h
  .. newlib/libc/string/../ctype/local.h
  ... newlib/libc/string/../ctype/../locale/setlocale.h

This even works for me when building from within the source dir, which
isn't a supported build configuration.

So why does this fail for you?  I wonder if some compile time settings
are responsible for this problem.  How do you build Cygwin from the git
repo?  Do you use some special debug options or something like that?

Btw., there *is* a minor glitch in string/local.h.  The extern
declaration of __locale_cjk_lang should have been removed when changing
__locale_cjk_lang to an always inline function in setlocale.h, but it
has no negative impact on my builds.  I just removed the declaration.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: GIT source build failure: wcwidth.c::_wcwidth misses __locale_cjk_lang()
  2016-08-21 15:04 ` Corinna Vinschen
@ 2016-08-21 15:25   ` Hans-Bernhard Bröker
  2016-08-21 22:03     ` Corinna Vinschen
  0 siblings, 1 reply; 5+ messages in thread
From: Hans-Bernhard Bröker @ 2016-08-21 15:25 UTC (permalink / raw)
  To: cygwin

Am 21.08.2016 um 12:30 schrieb Corinna Vinschen:

> thanks for the report, but I can't reproduce this.  I can build Cygwin
> fine natively as well as on Linux, with and without optimization.

That's strange.  On Re-examination, it builds here, too, even without 
the added include.  I.e. effectively it took only a `touch` of wcwidth.c 
to fix this.

Could there be a problem with the dependency handling in the newlib 
auto-foo which caused changes to header files to fail triggering a rebuild?

And while I'm at it: what _is_ the dependency handling here, anyway?  I 
can't seem to find any.  Which could indeed explain the problem.

> So why does this fail for you?  I wonder if some compile time settings
> are responsible for this problem.  How do you build Cygwin from the git
> repo?  Do you use some special debug options or something like that?

None that I'm aware of.  The only differences in may sandbox prior to 
occurence of the failure were in winsup/doc Makefile.in and configure. 
Other than that it's a straight-up

   ../newlib-cygwin/configure --prefix=/home/hbbro/prg/cygwin/inst

build.



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: GIT source build failure: wcwidth.c::_wcwidth misses __locale_cjk_lang()
  2016-08-21 15:25   ` Hans-Bernhard Bröker
@ 2016-08-21 22:03     ` Corinna Vinschen
  2016-08-22  1:31       ` Hans-Bernhard Bröker
  0 siblings, 1 reply; 5+ messages in thread
From: Corinna Vinschen @ 2016-08-21 22:03 UTC (permalink / raw)
  To: cygwin, newlib

[-- Attachment #1: Type: text/plain, Size: 1976 bytes --]


[CC newlib mailing list since it affects newlib in the first place]

On Aug 21 14:28, Hans-Bernhard Bröker wrote:
> Am 21.08.2016 um 12:30 schrieb Corinna Vinschen:
> 
> > thanks for the report, but I can't reproduce this.  I can build Cygwin
> > fine natively as well as on Linux, with and without optimization.
> 
> That's strange.  On Re-examination, it builds here, too, even without the
> added include.  I.e. effectively it took only a `touch` of wcwidth.c to fix
> this.
> 
> Could there be a problem with the dependency handling in the newlib auto-foo
> which caused changes to header files to fail triggering a rebuild?

Yes.  If you just pulled and rebuilt, there's a chance that you got
the new headers without triggering a rebuild of dependent sources.

> And while I'm at it: what _is_ the dependency handling here, anyway?  I
> can't seem to find any.  Which could indeed explain the problem.

That's because dependency handling is basically non-existing in newlib.

Nobody added a patch yet to do that.  Newlib being open-source, there's
of course nothing keeping anybody from adding it (*nudge*, *nudge*).

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.
The trick is to use an older versions of automake for rebuilding the
configury.  I'm having goods results with this script, which can be
called from newlib or the libc/libm subdirs:

  #!/bin/bash
  aclocal-1.12.2 -I. -I..
  autoconf
  automake-1.12.2 --cygnus --no-force

The autoconf version actually doesn't matter much so I'm using 2.69.

I'm not automake savvy enough to know what to do to get rid of the
--cygnus requirement :(


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: GIT source build failure: wcwidth.c::_wcwidth misses __locale_cjk_lang()
  2016-08-21 22:03     ` Corinna Vinschen
@ 2016-08-22  1:31       ` Hans-Bernhard Bröker
  0 siblings, 0 replies; 5+ messages in thread
From: Hans-Bernhard Bröker @ 2016-08-22  1:31 UTC (permalink / raw)
  To: cygwin, newlib

[Now subscribed to newlib list to follow this there, too]

Hi Corinna, hi everyone on both lists

Am 21.08.2016 um 20:15 schrieb Corinna Vinschen:
> [CC newlib mailing list since it affects newlib in the first place]

> On Aug 21 14:28, Hans-Bernhard Bröker wrote:
>> Am 21.08.2016 um 12:30 schrieb Corinna Vinschen:

>> And while I'm at it: what _is_ the dependency handling here, anyway?  I
>> can't seem to find any.  Which could indeed explain the problem.

> That's because dependency handling is basically non-existing in newlib.

> Nobody added a patch yet to do that.  Newlib being open-source, there's
> of course nothing keeping anybody from adding it (*nudge*, *nudge*).

That wouldn't be so much a patch as a redesign, I'm afraid, because it's 
strongly tied to the following:

> 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.

So let's see how far I get trying to un--cygnusify newlib (as part of 
Cygwin):

1) Get rid of for'cygnus' options. In all 134 Makefile.am replace

	AUTOMAKE_OPTIONS = cygwin
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
3) autoreconf in newlib, using autoconf-2.69 and automake-1.15
4) run "make" in my build dir
5) touch libc/locale/setlocale.h
6) run "make" again

Et voila!  Step 6 now recompiles 4 files that depend on setlocale.h, 
then re-builds the libraries using them

7) Get a rough glimpse of what I did:

$ git diff --stat newlib | tail -1
  438 files changed, 264967 insertions(+), 101151 deletions(-)

Well, that's what you get for having generated files like Makefile.in, 
configure and aclocal.m4 in version control...


> The trick is to use an older versions of automake for rebuilding the
> configury.  I'm having goods results with this script, which can be
> called from newlib or the libc/libm subdirs:
>
>   #!/bin/bash
>   aclocal-1.12.2 -I. -I..
>   autoconf
>   automake-1.12.2 --cygnus --no-force

Side note: in a cygwin environment (or any that uses Gentoo's 
automake/autoconf wrapper scripts), this should be reducible to:

	WANT_AUTOMAKE=1.12 autoreconf -I. -I..

But I'm afraid the time this approach worked reliably may be nearing its 
end.  Automake-1.11/1.12 appears to be no longer fully compatible with 
current versions of Perl.  At least I don't remember having had error 
messages like this back when 1.12 or 1.11 were still on point:

main::scan_file() called too early to check prototype at 
/usr/bin/aclocal-1.11 line 644.

> The autoconf version actually doesn't matter much so I'm using 2.69.

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.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-08-21 22:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-21  4:01 GIT source build failure: wcwidth.c::_wcwidth misses __locale_cjk_lang() Hans-Bernhard Bröker
2016-08-21 15:04 ` Corinna Vinschen
2016-08-21 15:25   ` Hans-Bernhard Bröker
2016-08-21 22:03     ` Corinna Vinschen
2016-08-22  1:31       ` Hans-Bernhard Bröker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).