public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Native build fails in winsup/cygwin/libc/strptime.cc because of strtou?l_l()
@ 2016-08-24  0:22 Hans-Bernhard Bröker
  2016-08-24  8:38 ` Corinna Vinschen
  0 siblings, 1 reply; 3+ messages in thread
From: Hans-Bernhard Bröker @ 2016-08-24  0:22 UTC (permalink / raw)
  To: cygwin

Hello everyone,

building the git version of cygwin natively on Cygwin-2.5.3, I'm running 
into a problem with strtoul_l / strtol_l. 
winsup/cygwin/libc/strptime.cc fails to build:

hbbro@NB4 ~/prg/cygwin/bld/x86_64-unknown-cygwin/winsup/cygwin
$ make
c++wrap -O2 -g -fno-rtti -fno-exceptions -fno-use-cxa-atexit -Wall 
-Wstrict-aliasing -Wwrite-strings -fno-common -pipe -fbuiltin 
-fmessage-length=0 -MMD -Werror -fmerge-constants -ftracer 
-mcmodel=small -c -o strptime.o 
../../../../newlib-cygwin/winsup/cygwin/libc/strptime.cc
../../../../newlib-cygwin/winsup/cygwin/libc/strptime.cc: In function 
'era_info_t* get_era_info(const char*, locale_t)':
../../../../newlib-cygwin/winsup/cygwin/libc/strptime.cc:125:53: error: 
'strtol_l' was not declared in this scope
        ei[cur].offset = strtol_l (era, &c, 10, locale);
                                                      ^
../../../../newlib-cygwin/winsup/cygwin/libc/strptime.cc: In function 
'char* __strptime(const char*, const char*, tm*, era_info_t**, 
alt_digits_t**, locale_t)':
../../../../newlib-cygwin/winsup/cygwin/libc/strptime.cc:390:50: error: 
'strtoul_l' was not declared in this scope
       width = strtoul_l (fmt - 1, &end, 10, locale);
                                                   ^
make: *** 
[../../../../newlib-cygwin/winsup/cygwin/../Makefile.common:41: 
strptime.o] Fehler 1


Looking at the .ii file, it appears __GNU_VISIBLE is not active for this 
C++ source file?

--
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] 3+ messages in thread

* Re: Native build fails in winsup/cygwin/libc/strptime.cc because of strtou?l_l()
  2016-08-24  0:22 Native build fails in winsup/cygwin/libc/strptime.cc because of strtou?l_l() Hans-Bernhard Bröker
@ 2016-08-24  8:38 ` Corinna Vinschen
  2016-08-24 18:39   ` Hans-Bernhard Bröker
  0 siblings, 1 reply; 3+ messages in thread
From: Corinna Vinschen @ 2016-08-24  8:38 UTC (permalink / raw)
  To: cygwin

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

On Aug 24 00:19, Hans-Bernhard Bröker wrote:
> Hello everyone,
> 
> building the git version of cygwin natively on Cygwin-2.5.3, I'm running
> into a problem with strtoul_l / strtol_l. winsup/cygwin/libc/strptime.cc
> fails to build:
> [...]
> 
> Looking at the .ii file, it appears __GNU_VISIBLE is not active for this C++
> source file?

Yes, we discussed this already yesterday on the Freenode #cygwin-developers
IRC channel.  The reason is that sys/cdefs.h is included before winsup.h
is included, the latter defining _GNU_SOURCE.

However, it appears that I don't see this problem when cross building on
Linux.  It only shows up in a native build.

After some digging it turned out that in the cross build case _GNU_SOURCE
is predefined when using the -xc++ option:

Native:

  $ x86_64-pc-cygwin-c++ -xc++ -dM -E - < /dev/null | grep GNU_SOURCE
  [no output]

Linux:

  $ x86_64-pc-cygwin-c++ -xc++ -dM -E - < /dev/null | grep GNU_SOURCE
  #define _GNU_SOURCE 1

That's pretty weird since _GNU_SOURCE is not supposed to be defined
by the compiler or C preprocessor at all.


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] 3+ messages in thread

* Re: Native build fails in winsup/cygwin/libc/strptime.cc because of strtou?l_l()
  2016-08-24  8:38 ` Corinna Vinschen
@ 2016-08-24 18:39   ` Hans-Bernhard Bröker
  0 siblings, 0 replies; 3+ messages in thread
From: Hans-Bernhard Bröker @ 2016-08-24 18:39 UTC (permalink / raw)
  To: cygwin

Am 24.08.2016 um 10:28 schrieb Corinna Vinschen:
> On Aug 24 00:19, Hans-Bernhard Bröker wrote:
>> Hello everyone,
>>
>> building the git version of cygwin natively on Cygwin-2.5.3, I'm running
>> into a problem with strtoul_l / strtol_l. winsup/cygwin/libc/strptime.cc
>> fails to build:
>> [...]
>>
>> Looking at the .ii file, it appears __GNU_VISIBLE is not active for this C++
>> source file?
>
> Yes, we discussed this already yesterday on the Freenode #cygwin-developers
> IRC channel.  The reason is that sys/cdefs.h is included before winsup.h
> is included, the latter defining _GNU_SOURCE.

Ah, yes.  That would do it.  The build does indeed work now, with the 
fix in git.  Thanks.

[...]
> That's pretty weird since _GNU_SOURCE is not supposed to be defined
> by the compiler or C preprocessor at all.

Well, it could be the specs file "contributing" it...


--
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] 3+ messages in thread

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-24  0:22 Native build fails in winsup/cygwin/libc/strptime.cc because of strtou?l_l() Hans-Bernhard Bröker
2016-08-24  8:38 ` Corinna Vinschen
2016-08-24 18:39   ` 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).