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]

[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

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