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: [PATCH 3/3] Remove locale access for _REENT_SMALL


"Anmin via newlib" <newlib@sourceware.org> writes:

> Is there any way, such as using "configure" options or defines while
> building newlib, or defining some macros when building project, to
> make my small and simple project (with "C" locale) not to link with
> those "locale" objects?

I've got a long series of patches for newlib on arm-none-eabi that you
might be interested, and this is one of them.

diff --git a/newlib/libc/include/ctype.h b/newlib/libc/include/ctype.h
index f74b3499b..0e283afd6 100644
--- a/newlib/libc/include/ctype.h
+++ b/newlib/libc/include/ctype.h
@@ -66,7 +66,12 @@ extern int toascii_l (int __c, locale_t __l);
 #define _X     0100
 #define        _B      0200
 
+#ifdef NEWLIB_DISABLE_LOCALE
+#define __locale_ctype_ptr()   _ctype_
+#else
 const char *__locale_ctype_ptr (void);
+#endif
+
 # define __CTYPE_PTR   (__locale_ctype_ptr ())
 
 #ifndef __cplusplus

This doesn't actually set the NEWLIB_DISABLE_LOCALE define anywhere;
that's done in my 'meson' newlib configuration. You would have to hack
up something with CFLAGS to use this under autotools.

I'm still cleaning this series up before submitting the
upstream-relevant patches here, but if you want to take a look and see
what you think, the sources are available here:

        https://salsa.debian.org/electronics-team/toolchains/newlib-nano

I've got a submission in the debian new queue for this, so it should
eventually be something you can just install.

-- 
-keith

Attachment: signature.asc
Description: PGP signature


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