This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Build fails with an error in setlocale.h


On 16/08/16 12:39, Matthew Wahab wrote:
On 16/08/16 11:48, Corinna Vinschen wrote:
On Aug 16 11:37, Matthew Wahab wrote:
I get a build failure when cross-compiling for aarch64-none-elf, the error
message is
----
newlib-cygwin/newlib/libc/stdlib/../locale/setlocale.h:206:38: error:
unknown type name 'locale_t'; did you mean 'clockid_t'?
          size_t, size_t, mbstate_t *, locale_t);
                                       ^~~~~~~~
                                       clockid_t


Can you test that the above patch works for you?  I'll check it in then.


Thanks for the patch. It fixes that failure but there's another in localeconv.c:

I've also tried with the second patch and still get the build errors.
Matthew

----
newlib-cygwin/newlib/libc/locale/localeconv.c: In function '__localeconv_l':
newlib-cygwin/newlib/libc/locale/localeconv.c:47:10: error: 'lconv' undeclared
(first use in this function); did you mean 'lconv'?
    return lconv;
           ^~~~~
           lconv
----
I think that this is because the lconv is declared and used
----
#ifdef __HAVE_LOCALE_INFO__
   struct lconv *lconv = &locale->lconv;
..
#endif /* __HAVE_LOCALE_INFO__ */
   return lconv;
----

That's easy to fix but I then get failures in time/strftime.c
for__get_time_locale:
----
newlib-cygwin/newlib/libc/time/../time/strftime.c: In function '__strftime':
newlib-cygwin/newlib/libc/time/../time/strftime.c:701:48: warning: implicit
declaration of function '__get_time_locale'; did you mean
'__get_current_locale'? [-Wimplicit-function-declaration]
    const struct lc_time_T *_CurrentTimeLocale = __get_time_locale (locale);
                                                 ^~~~~~~~~~~~~~~~~
                                                 __get_current_locale
----

I also get errors for the use of era_info_t and other types in that function
----
newlib-cygwin/newlib/libc/time/../time/strftime.c: In function 'wcsftime':
newlib-cygwin/newlib/libc/time/../time/strftime.c:1446:3: error: unknown type
name 'era_info_t'; did you mean '__ino_t'?
    era_info_t *era_info = NULL;
    ^~~~~~~~~~
    __ino_t
----
But I haven't been able to track down what causes those.

Matthew


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]