[patch] AVR support for newlib
Marek Michalkiewicz
marekm@t19.ds.pwr.wroc.pl
Tue Jun 27 06:39:00 GMT 2000
The patch below adds minimal AVR support to newlib, just to get it to
configure and build. For now, it is mainly useful for avr-gcc testing
(today's CVS gcc passes, but in the past, especially the math library
has already helped to find a few bugs). More changes to come later...
Thanks,
Marek
newlib/ChangeLog:
2000-06-27 Marek Michalkiewicz <marekm@linux.org.pl>
* configure.host: Add support for AVR target.
* libc/include/machine/ieeefp.h: Likewise.
* libc/include/sys/config.h: Likewise.
diff -Nrc3p orig/src/newlib/configure.host src/newlib/configure.host
*** orig/src/newlib/configure.host Thu May 11 08:01:15 2000
--- src/newlib/configure.host Tue Jun 27 12:16:15 2000
*************** case "${target_optspace}:${host}" in
*** 45,51 ****
yes:*)
newlib_cflags="${newlib_cflags} -Os"
;;
! :m32r-* | :d10v-* | :d30v-*)
newlib_cflags="${newlib_cflags} -Os"
;;
no:* | :*)
--- 45,51 ----
yes:*)
newlib_cflags="${newlib_cflags} -Os"
;;
! :m32r-* | :d10v-* | :d30v-* | :avr-*)
newlib_cflags="${newlib_cflags} -Os"
;;
no:* | :*)
*************** case "${host_cpu}" in
*** 68,73 ****
--- 68,76 ----
arm)
machine_dir=arm
;;
+ avr*)
+ newlib_cflags="${newlib_cflags} -DPREFER_SIZE_OVER_SPEED -mcall-prologues"
+ ;;
d10v*)
machine_dir=d10v
;;
*************** case "${host}" in
*** 337,342 ****
--- 340,348 ----
# See also thumb below.
# newlib_cflags="${newlib_cflags} -DARM_RDP_MONITOR"
newlib_cflags="${newlib_cflags} -DARM_RDI_MONITOR"
+ ;;
+ avr*)
+ newlib_cflags="${newlib_cflags} -DNO_EXEC -DSMALL_MEMORY -DMISSING_SYSCALL_NAMES"
;;
d10v*)
newlib_cflags="${newlib_cflags} -DSMALL_MEMORY"
diff -Nrc3p orig/src/newlib/libc/include/machine/ieeefp.h src/newlib/libc/include/machine/ieeefp.h
*** orig/src/newlib/libc/include/machine/ieeefp.h Thu May 11 08:01:15 2000
--- src/newlib/libc/include/machine/ieeefp.h Tue Jun 27 09:59:44 2000
***************
*** 152,157 ****
--- 152,163 ----
#endif
#endif
+ #ifdef __AVR__
+ #define __IEEE_LITTLE_ENDIAN
+ #define __SMALL_BITFIELDS
+ #define _DOUBLE_IS_32BITS
+ #endif
+
#ifndef __IEEE_BIG_ENDIAN
#ifndef __IEEE_LITTLE_ENDIAN
#error Endianess not declared!!
diff -Nrc3p orig/src/newlib/libc/include/sys/config.h src/newlib/libc/include/sys/config.h
*** orig/src/newlib/libc/include/sys/config.h Wed Jun 14 15:25:03 2000
--- src/newlib/libc/include/sys/config.h Tue Jun 27 10:15:11 2000
***************
*** 25,31 ****
#endif
/* 16 bit integer machines */
! #if defined(__Z8001__) || defined(__Z8002__) || defined(__H8300__) || defined(__H8500__) || defined(__W65__) || defined (__H8300H__) || defined (__H8300S__) || defined (__mn10200__)
#undef INT_MAX
#undef UINT_MAX
--- 25,31 ----
#endif
/* 16 bit integer machines */
! #if defined(__Z8001__) || defined(__Z8002__) || defined(__H8300__) || defined(__H8500__) || defined(__W65__) || defined (__H8300H__) || defined (__H8300S__) || defined (__mn10200__) || defined (__AVR__)
#undef INT_MAX
#undef UINT_MAX
***************
*** 71,76 ****
--- 71,83 ----
#define _DOUBLE_IS_32BITS
#define __SMALL_BITFIELDS
#define __IEEE_LITTLE_ENDIAN
+ #endif
+
+ #ifdef __AVR__
+ #define _DOUBLE_IS_32BITS
+ #define __SMALL_BITFIELDS
+ #define __IEEE_LITTLE_ENDIAN
+ #define _POINTER_INT short
#endif
#ifdef __TIC80__
More information about the Newlib
mailing list