This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
[PATCH, ARM] Don't use __thumb2__ to select _REENT_SMALL
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: newlib at sourceware dot org
- Cc: Paul Brook <paul at codesourcery dot com>
- Date: Tue, 02 Jun 2009 13:54:35 +0100
- Subject: [PATCH, ARM] Don't use __thumb2__ to select _REENT_SMALL
This cost me at least a couple of hours debugging at the weekend; I was
trying to work out why my file handles were all corrupted when compiling
code for Thumb-2. It turns out that Newlib's config.h was changing the
ABI depending on the instruction set it was compiling for -- a big No
No, since code is supposed to interwork freely between the two ISAs!
Anyway, I think the following (added by Paul back in 2006) is just
wrong. We need a more precise way to detect M-profile devices if they
must have smaller newlib footprints.
I've chosen to comment out this code rather than remove it, since that
way it acts as a clear reminder as to why we don't want to do this. If
someone adds more precise targeting of M-profile cores, then the code
here can then go entirely.
R.
2009-06-02 Richard Earnshaw <rearnsha@arm.com>
* include/sys/config.h ([__thumb2__]): Don't define _REENT_SMALL.
Index: config.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/sys/config.h,v
retrieving revision 1.49
diff -p -r1.49 config.h
*** config.h 19 Nov 2008 21:05:31 -0000 1.49
--- config.h 2 Jun 2009 12:45:22 -0000
***************
*** 125,134 ****
--- 125,138 ----
#define _REENT_SMALL
#endif /* __m32c__ */
+ #if 0
+ /* This causes ABI differences between ARM and Thumb code for ARMv7-A
+ and -R profile devices. */
#ifdef __thumb2__
/* Thumb-2 based ARMv7M devices are really small. */
#define _REENT_SMALL
#endif
+ #endif
#ifdef __SPU__
#define MALLOC_ALIGNMENT 16