diff --git a/dkarm-eabi/patches/newlib-3.1.0.patch b/dkarm-eabi/patches/newlib-3.3.0.patch similarity index 99% rename from dkarm-eabi/patches/newlib-3.1.0.patch rename to dkarm-eabi/patches/newlib-3.3.0.patch index b115915..52cbda0 100644 --- a/dkarm-eabi/patches/newlib-3.1.0.patch +++ b/dkarm-eabi/patches/newlib-3.3.0.patch @@ -1,8 +1,8 @@ diff --git a/libgloss/configure b/libgloss/configure -index 1a4033dce..ba7aea7b0 100755 +index 0d2918cee..bccfb07b4 100755 --- a/libgloss/configure +++ b/libgloss/configure -@@ -2599,6 +2599,8 @@ if test "${config_libnosys}" = "true"; then +@@ -2604,6 +2604,8 @@ if test "${config_libnosys}" = "true"; then fi @@ -12,7 +12,7 @@ index 1a4033dce..ba7aea7b0 100755 ac_config_commands="$ac_config_commands depfiles" diff --git a/libgloss/configure.in b/libgloss/configure.in -index 41843eed1..dc0e2a5fd 100644 +index f38d5298e..509c31071 100644 --- a/libgloss/configure.in +++ b/libgloss/configure.in @@ -2,6 +2,7 @@ dnl Process this file with autoconf to produce a configure script. @@ -23,7 +23,7 @@ index 41843eed1..dc0e2a5fd 100644 if test "${enable_shared}" = "yes" ; then echo "Shared libraries not supported for cross compiling, ignored" -@@ -190,6 +191,7 @@ dnl fi +@@ -193,6 +194,7 @@ dnl fi if test "${config_libnosys}" = "true"; then AC_CONFIG_SUBDIRS([libnosys]) fi @@ -7408,10 +7408,10 @@ index 000000000..61de918bc + return ret; +} diff --git a/newlib/configure.host b/newlib/configure.host -index 6c49cb750..6a5e1c78d 100644 +index a84c0c80a..29fb7ed24 100644 --- a/newlib/configure.host +++ b/newlib/configure.host -@@ -666,6 +666,14 @@ newlib_cflags="${newlib_cflags} -DCLOCK_PROVIDED -DMALLOC_PROVIDED -DEXIT_PROVID +@@ -687,6 +687,14 @@ newlib_cflags="${newlib_cflags} -DCLOCK_PROVIDED -DMALLOC_PROVIDED -DEXIT_PROVID syscall_dir=syscalls default_newlib_io_long_long="yes" ;; @@ -7440,7 +7440,7 @@ index 164d95bca..083e48758 100644 void clearerr (FILE *); int feof (FILE *); diff --git a/newlib/libc/include/sys/config.h b/newlib/libc/include/sys/config.h -index 49b62ebf6..d84ffaa59 100644 +index d746b15fc..80169d9b7 100644 --- a/newlib/libc/include/sys/config.h +++ b/newlib/libc/include/sys/config.h @@ -4,6 +4,9 @@ @@ -7520,7 +7520,7 @@ index a3fb5c02c..5debd1525 100644 + +#endif // _dirent_h_ diff --git a/newlib/libc/include/sys/features.h b/newlib/libc/include/sys/features.h -index f28dd071b..96980676d 100644 +index 218807178..c9efd7d03 100644 --- a/newlib/libc/include/sys/features.h +++ b/newlib/libc/include/sys/features.h @@ -330,6 +330,9 @@ extern "C" { @@ -7651,11 +7651,25 @@ index 000000000..c190fa37d +//--------------------------------------------------------------------------------- +#endif // __iosupp_h__ +//--------------------------------------------------------------------------------- +diff --git a/newlib/libc/include/sys/param.h b/newlib/libc/include/sys/param.h +index 9a6f115a6..142e71d35 100644 +--- a/newlib/libc/include/sys/param.h ++++ b/newlib/libc/include/sys/param.h +@@ -19,9 +19,6 @@ + #ifndef NOFILE + # define NOFILE (60) + #endif +-#ifndef PATHSIZE +-# define PATHSIZE (1024) +-#endif + + #define MAXPATHLEN PATH_MAX + diff --git a/newlib/libc/include/sys/reent.h b/newlib/libc/include/sys/reent.h -index 6e55e1c1f..6e0c1c9cf 100644 +index 74b70e9c0..d8c5410ec 100644 --- a/newlib/libc/include/sys/reent.h +++ b/newlib/libc/include/sys/reent.h -@@ -416,6 +416,8 @@ struct _reent +@@ -421,6 +421,8 @@ struct _reent __FILE *__sf; /* file descriptors */ struct _misc_reent *_misc; /* strtok, multibyte states */ char *_signal_buf; /* strsignal */ @@ -7664,7 +7678,7 @@ index 6e55e1c1f..6e0c1c9cf 100644 }; #ifdef _REENT_GLOBAL_STDIO_STREAMS -@@ -686,6 +688,7 @@ struct _reent +@@ -691,6 +693,7 @@ struct _reent # ifndef _REENT_GLOBAL_STDIO_STREAMS __FILE __sf[3]; /* first three file descriptors */ # endif @@ -7673,10 +7687,10 @@ index 6e55e1c1f..6e0c1c9cf 100644 #ifdef _REENT_GLOBAL_STDIO_STREAMS diff --git a/newlib/libc/include/sys/stat.h b/newlib/libc/include/sys/stat.h -index eee98db64..aed9c1746 100644 +index 8769112b0..5526e59ee 100644 --- a/newlib/libc/include/sys/stat.h +++ b/newlib/libc/include/sys/stat.h -@@ -152,8 +152,9 @@ int mkfifo (const char *__path, mode_t __mode ); +@@ -142,8 +142,9 @@ int mkfifo (const char *__path, mode_t __mode ); int stat (const char *__restrict __path, struct stat *__restrict __sbuf ); mode_t umask (mode_t __mask ); @@ -8017,7 +8031,7 @@ index 9b982a993..8c0aaac8c 100644 +*/ #endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */ diff --git a/newlib/libc/stdio/fread.c b/newlib/libc/stdio/fread.c -index b358d2b4a..29cec0229 100644 +index b358d2b4a..a3e597fd2 100644 --- a/newlib/libc/stdio/fread.c +++ b/newlib/libc/stdio/fread.c @@ -135,7 +135,7 @@ crlf_r (struct _reent * ptr, @@ -8029,7 +8043,24 @@ index b358d2b4a..29cec0229 100644 } #endif -@@ -225,7 +225,32 @@ _fread_r (struct _reent * ptr, +@@ -187,7 +187,6 @@ _fread_r (struct _reent * ptr, + int rc = 0; + /* save fp buffering state */ + void *old_base = fp->_bf._base; +- void * old_p = fp->_p; + int old_size = fp->_bf._size; + /* allow __refill to use user's buffer */ + fp->_bf._base = (unsigned char *) p; +@@ -197,7 +196,7 @@ _fread_r (struct _reent * ptr, + /* restore fp buffering back to original state */ + fp->_bf._base = old_base; + fp->_bf._size = old_size; +- fp->_p = old_p; ++ fp->_p = old_base; + resid -= fp->_r; + p += fp->_r; + fp->_r = 0; +@@ -225,7 +224,31 @@ _fread_r (struct _reent * ptr, /* fp->_r = 0 ... done in __srefill */ p += r; resid -= r; @@ -8037,11 +8068,10 @@ index b358d2b4a..29cec0229 100644 + + int rc = 0; + -+ if (resid>BUFSIZ) ++ if (resid>fp->_bf._size) + { + /* save fp buffering state */ + void *old_base = fp->_bf._base; -+ void * old_p = fp->_p; + int old_size = fp->_bf._size; + /* allow __refill to use user's buffer */ + fp->_bf._base = (unsigned char *) p; @@ -8051,7 +8081,7 @@ index b358d2b4a..29cec0229 100644 + /* restore fp buffering back to original state */ + fp->_bf._base = old_base; + fp->_bf._size = old_size; -+ fp->_p = old_p; ++ fp->_p = old_base; + resid -= fp->_r; + p += fp->_r; + fp->_r = 0; @@ -8122,7 +8152,7 @@ index 980b31e3b..722be905e 100644 #ifdef INTEGER_ONLY diff --git a/newlib/libc/stdio/vfwscanf.c b/newlib/libc/stdio/vfwscanf.c -index 0464b0837..435fc0142 100644 +index ffb6cc85b..db33d4f29 100644 --- a/newlib/libc/stdio/vfwscanf.c +++ b/newlib/libc/stdio/vfwscanf.c @@ -74,6 +74,9 @@ PORTABILITY @@ -8276,16 +8306,3 @@ index 000000000..567fed56b + __libc_lock_release_recursive(&(NAME)) + +#endif // __SYS_LOCK_H__ -diff --git a/newlib/libc/sys/arm/sys/param.h b/newlib/libc/sys/arm/sys/param.h -index 5b9464cca..e8969b954 100644 ---- a/newlib/libc/sys/arm/sys/param.h -+++ b/newlib/libc/sys/arm/sys/param.h -@@ -19,6 +19,8 @@ - # define PATHSIZE (1024) - #endif - -+#define MAXPATHLEN PATHSIZE -+ - #define MAX(a,b) ((a) > (b) ? (a) : (b)) - #define MIN(a,b) ((a) < (b) ? (a) : (b)) - diff --git a/select_toolchain.sh b/select_toolchain.sh index ff709ae..e739ea2 100755 --- a/select_toolchain.sh +++ b/select_toolchain.sh @@ -32,7 +32,7 @@ case "$VERSION" in "1" ) GCC_VER=10.1.0 BINUTILS_VER=2.32 - NEWLIB_VER=3.1.0 + NEWLIB_VER=3.3.0 GDB_VER=8.2.1 basedir='dkarm-eabi' package=devkitARM